19 package org.sleuthkit.autopsy.datasourcesummary.uiutils;
21 import java.awt.Component;
22 import java.awt.Insets;
23 import javax.swing.BorderFactory;
24 import javax.swing.JLabel;
25 import javax.swing.JTable;
26 import javax.swing.border.Border;
27 import javax.swing.table.DefaultTableCellRenderer;
28 import org.apache.commons.lang3.StringUtils;
55 this.jlabelAlignment = jlabelAlignment;
63 return this.jlabelAlignment;
148 this.horizontalAlignment = alignment;
176 private static final Border
DEFAULT_BORDER = BorderFactory.createEmptyBorder(1, 5, 1, 5);
180 boolean isSelected,
boolean hasFocus,
int row,
int column) {
182 JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
202 String text = cellModel.
getText();
203 if (StringUtils.isNotBlank(text)) {
204 defaultCell.setText(text);
206 defaultCell.setText(null);
211 if (StringUtils.isNotBlank(tooltip)) {
212 defaultCell.setToolTipText(tooltip);
214 defaultCell.setToolTipText(null);
219 if (insets != null) {
220 defaultCell.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
222 defaultCell.setBorder(DEFAULT_BORDER);
230 defaultCell.setHorizontalAlignment(alignment);
HorizontalAlign getHorizontalAlignment()
Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
HorizontalAlign(int jlabelAlignment)
DefaultCellModel setHorizontalAlignment(HorizontalAlign alignment)
static final Border DEFAULT_BORDER
HorizontalAlign horizontalAlignment
static final int DEFAULT_ALIGNMENT
DefaultCellModel setInsets(Insets insets)
final int jlabelAlignment
static final long serialVersionUID
HorizontalAlign getHorizontalAlignment()
Component getTableCellRendererComponent(JLabel defaultCell, CellModel cellModel)
DefaultCellModel(String text)
DefaultCellModel setTooltip(String tooltip)