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 javafx.beans.Observable;
26 import javax.swing.Action;
27 import org.joda.time.DateTime;
28 import org.joda.time.DateTimeZone;
29 import org.openide.nodes.Children;
30 import org.openide.nodes.PropertySupport;
31 import org.openide.nodes.Sheet;
32 import org.openide.util.Exceptions;
33 import org.openide.util.lookup.Lookups;
50 super(Children.LEAF, Lookups.fixed(eventById, file, artifact));
52 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/timeline/images/" + e.getType().getIconBase());
56 super(Children.LEAF, Lookups.fixed(eventById, file));
58 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/timeline/images/" + e.getType().getIconBase());
62 protected Sheet createSheet() {
63 Sheet s = super.createSheet();
64 Sheet.Set properties = s.get(Sheet.PROPERTIES);
65 if (properties == null) {
66 properties = Sheet.createPropertiesSet();
70 final TimeProperty timePropery =
new TimeProperty(
"time",
"Date/Time",
"time ", getDateTimeString());
74 timePropery.setValue(getDateTimeString());
75 }
catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
76 Exceptions.printStackTrace(ex);
81 properties.put(timePropery);
90 private String getDateTimeString() {
95 public Action[] getActions(
boolean context) {
96 Action[] superActions = super.getActions(context);
97 List<Action> actionsList =
new ArrayList<>();
98 actionsList.addAll(Arrays.asList(superActions));
105 actionsList.addAll(factoryActions);
106 return actionsList.toArray(
new Action[0]);
110 public boolean isLeafTypeNode() {
116 throw new UnsupportedOperationException(
"Not supported yet.");
119 class TimeProperty
extends PropertySupport.ReadWrite<String> {
121 private String value;
124 public boolean canWrite() {
128 public TimeProperty(String name, String displayName, String shortDescription, String value) {
129 super(name, String.class, displayName, shortDescription);
130 setValue(
"suppressCustomEditor", Boolean.TRUE);
135 public String getValue()
throws IllegalAccessException, InvocationTargetException {
140 public void setValue(String t)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
141 String oldValue = getValue();
143 firePropertyChange(
"time", oldValue, t);
TskData.FileKnown getKnown()
static ReadOnlyObjectProperty< TimeZone > getTimeZone()
static List< Action > getActions(File file, boolean isArtifactSource)
String getFullDescription()
static DateTimeFormatter getZonedFormatter()