19 package org.sleuthkit.autopsy.contentviewers;
21 import java.awt.Component;
23 import java.lang.reflect.InvocationTargetException;
24 import java.text.SimpleDateFormat;
25 import java.util.Date;
26 import java.util.logging.Level;
27 import javax.swing.JTable;
28 import javax.swing.table.DefaultTableCellRenderer;
29 import org.openide.nodes.Node;
42 private static final SimpleDateFormat
DATE_FORMAT =
new SimpleDateFormat(FORMAT_STRING);
55 super.setForeground(table.getSelectionForeground());
56 super.setBackground(table.getSelectionBackground());
58 super.setForeground( table.getForeground());
59 super.setBackground( table.getBackground());
69 if (value instanceof Node.Property<?>) {
70 Node.Property<?> nodeProp = (Node.Property)value;
71 textStr = nodeProp.getValue().toString();
75 long epochTime = Long.parseUnsignedLong(textStr);
77 Font font = getFont();
78 setFont(font.deriveFont(font.getStyle() | Font.ITALIC));
79 setText(DATE_FORMAT.format(
new Date(epochTime)));
89 catch (NumberFormatException e) {
91 LOGGER.log(Level.INFO,
"Error converting column value to number.", e);
92 }
catch (IllegalAccessException | InvocationTargetException ex) {
94 LOGGER.log(Level.SEVERE,
"Error in getting column value.", ex);
101 boolean isRenderingAsEpoch() {
final boolean renderAsEpoch
static final long serialVersionUID
static final String FORMAT_STRING
Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
synchronized static Logger getLogger(String name)
static final Logger LOGGER
static final SimpleDateFormat DATE_FORMAT