19 package org.sleuthkit.autopsy.guiutils;
21 import java.awt.Component;
22 import java.lang.reflect.InvocationTargetException;
23 import javax.swing.ImageIcon;
24 import javax.swing.JTable;
25 import static javax.swing.SwingConstants.CENTER;
26 import org.openide.nodes.Node;
27 import org.openide.util.ImageUtilities;
28 import org.openide.util.NbBundle.Messages;
39 static final ImageIcon OK_ICON =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/tick.png",
false));
40 static final ImageIcon WARNING_ICON =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/warning16.png",
false));
41 static final ImageIcon ERROR_ICON =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/cross-script.png",
false));
44 "StatusIconCellRenderer.tooltiptext.ok=OK",
45 "StatusIconCellRenderer.tooltiptext.warning=A warning occurred",
46 "StatusIconCellRenderer.tooltiptext.error=An error occurred"
50 setHorizontalAlignment(CENTER);
51 Object switchValue = null;
55 switchValue = ((Node.Property) value).getValue();
56 }
catch (IllegalAccessException | InvocationTargetException ex) {
63 if ((switchValue instanceof
Status)) {
64 switch ((Status) switchValue) {
67 setToolTipText(
org.openide.util.NbBundle.getMessage(
StatusIconCellRenderer.class,
"StatusIconCellRenderer.tooltiptext.ok"));
70 setIcon(WARNING_ICON);
71 setToolTipText(
org.openide.util.NbBundle.getMessage(
StatusIconCellRenderer.class,
"StatusIconCellRenderer.tooltiptext.warning"));
75 setToolTipText(
org.openide.util.NbBundle.getMessage(
StatusIconCellRenderer.class,
"StatusIconCellRenderer.tooltiptext.error"));
Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
static final long serialVersionUID
void grayCellIfTableNotEnabled(JTable table, boolean isSelected)