19 package org.sleuthkit.autopsy.timeline.explorernodes;
21 import java.lang.reflect.InvocationTargetException;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.List;
25 import java.util.logging.Level;
26 import javafx.beans.Observable;
27 import javax.swing.Action;
28 import org.joda.time.DateTime;
29 import org.joda.time.DateTimeZone;
30 import org.openide.nodes.Children;
31 import org.openide.nodes.PropertySupport;
32 import org.openide.nodes.Sheet;
33 import org.openide.util.lookup.Lookups;
54 EventNode(
TimeLineEvent eventById, AbstractFile file, BlackboardArtifact artifact) {
55 super(Children.LEAF, Lookups.fixed(eventById, file, artifact));
57 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/timeline/images/" + e.getType().getIconBase());
61 super(Children.LEAF, Lookups.fixed(eventById, file));
63 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/timeline/images/" + e.getType().getIconBase());
67 protected Sheet createSheet() {
68 Sheet s = super.createSheet();
69 Sheet.Set properties = s.get(Sheet.PROPERTIES);
70 if (properties == null) {
71 properties = Sheet.createPropertiesSet();
75 final TimeProperty timePropery =
new TimeProperty(
"time",
"Date/Time",
"time ", getDateTimeString());
79 timePropery.setValue(getDateTimeString());
80 }
catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
81 LOGGER.log(Level.SEVERE,
"unexpected error setting date/time property on EventNode explorer node", ex);
86 properties.put(timePropery);
95 private String getDateTimeString() {
100 public Action[] getActions(
boolean context) {
101 Action[] superActions = super.getActions(context);
102 List<Action> actionsList =
new ArrayList<>();
103 actionsList.addAll(Arrays.asList(superActions));
105 final Content content = getLookup().lookup(Content.class);
106 final BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
110 actionsList.addAll(factoryActions);
111 return actionsList.toArray(
new Action[actionsList.size()]);
115 public boolean isLeafTypeNode() {
121 throw new UnsupportedOperationException(
"Not supported yet.");
146 TimeProperty(String name, String displayName, String shortDescription, String value) {
147 super(name, String.class, displayName, shortDescription);
148 setValue(
"suppressCustomEditor", Boolean.TRUE);
153 public String
getValue() throws IllegalAccessException, InvocationTargetException {
158 public void setValue(String t)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
161 firePropertyChange(
"time", oldValue, t);
TskData.FileKnown getKnown()
static ReadOnlyObjectProperty< TimeZone > getTimeZone()
static List< Action > getActions(File file, boolean isArtifactSource)
synchronized static Logger getLogger(String name)
String getFullDescription()
static DateTimeFormatter getZonedFormatter()