19 package org.sleuthkit.autopsy.timeline.explorernodes;
21 import java.lang.reflect.InvocationTargetException;
22 import java.text.MessageFormat;
23 import java.util.ArrayList;
24 import java.util.Arrays;
25 import java.util.List;
26 import java.util.logging.Level;
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.NbBundle;
34 import org.openide.util.lookup.Lookups;
64 super(Children.LEAF, Lookups.fixed(event, file, artifact));
70 super(Children.LEAF, Lookups.fixed(event, file));
77 "NodeProperty.displayName.icon=Icon",
78 "NodeProperty.displayName.description=Description",
79 "NodeProperty.displayName.baseType=Base Type",
80 "NodeProperty.displayName.subType=Sub Type",
81 "NodeProperty.displayName.known=Known",
82 "NodeProperty.displayName.dateTime=Date/Time"})
84 Sheet s = super.createSheet();
85 Sheet.Set properties = s.get(Sheet.PROPERTIES);
86 if (properties == null) {
87 properties = Sheet.createPropertiesSet();
91 properties.put(
new NodeProperty<>(
"icon", Bundle.NodeProperty_displayName_icon(),
"icon",
true));
93 properties.put(
new NodeProperty<>(
"description", Bundle.NodeProperty_displayName_description(),
"description",
event.getFullDescription()));
94 properties.put(
new NodeProperty<>(
"eventBaseType", Bundle.NodeProperty_displayName_baseType(),
"base type",
event.getEventType().getSuperType().getDisplayName()));
95 properties.put(
new NodeProperty<>(
"eventSubType", Bundle.NodeProperty_displayName_subType(),
"sub type",
event.getEventType().getDisplayName()));
96 properties.put(
new NodeProperty<>(
"Known", Bundle.NodeProperty_displayName_known(),
"known",
event.getKnown().toString()));
114 "EventNode.getAction.errorTitle=Error getting actions",
115 "EventNode.getAction.linkedFileMessage=There was a problem getting actions for the selected result. "
116 +
" The 'View File in Timeline' action will not be available."})
118 Action[] superActions = super.getActions(context);
119 List<Action> actionsList =
new ArrayList<>();
120 actionsList.addAll(Arrays.asList(superActions));
129 if (artifact != null) {
132 if (linkedfile != null) {
136 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.
getArtifactID()), ex);
141 if (null != sourceFile) {
149 actionsList.addAll(factoryActions);
150 return actionsList.toArray(
new Action[actionsList.size()]);
160 throw new UnsupportedOperationException(
"Not supported yet.");
165 return getClass().getName();
172 final private class TimeProperty extends PropertySupport.ReadWrite<String> {
181 TimeProperty(String name, String displayName, String shortDescription, String value) {
182 super(name, String.class, displayName, shortDescription);
183 setValue(
"suppressCustomEditor", Boolean.TRUE);
188 }
catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
189 LOGGER.log(Level.SEVERE,
"Unexpected error setting date/time property on EventNode explorer node", ex);
196 public String
getValue() throws IllegalAccessException, InvocationTargetException {
201 public void setValue(String t)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
204 firePropertyChange(
"time", oldValue, t);
223 final SingleEvent eventById = eventsModel.getEventById(eventID);
230 return new EventNode(eventById, file, blackboardArtifact);
252 if (pathIDAttribute != null) {
254 if (contentID != -1) {
255 return artifact.getSleuthkitCase().getAbstractFileById(contentID);
Optional< Long > getArtifactID()
static EventNode createEventNode(final Long eventID, FilteredEventsModel eventsModel)
Action[] getActions(boolean context)
static ReadOnlyObjectProperty< TimeZone > getTimeZone()
static List< Action > getActions(File file, boolean isArtifactSource)
BlackboardArtifact getBlackboardArtifact(long artifactID)
AbstractFile getAbstractFileById(long id)
String getDateTimeString()
static ViewFileInTimelineAction createViewSourceFileAction(AbstractFile file)
static final long serialVersionUID
SleuthkitCase getSleuthkitCase()
static void error(String title, String message)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static final Logger LOGGER
static DateTimeFormatter getZonedFormatter()
static ViewFileInTimelineAction createViewFileAction(AbstractFile file)