19 package org.sleuthkit.autopsy.datamodel;
21 import java.text.MessageFormat;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.List;
25 import java.util.logging.Level;
26 import javax.swing.Action;
27 import org.openide.nodes.Children;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
30 import org.openide.util.lookup.Lookups;
51 private static final String
ICON_PATH =
"org/sleuthkit/autopsy/images/green-tag-icon-16.png";
52 private final BlackboardArtifactTag
tag;
55 super(Children.LEAF, Lookups.fixed(tag, tag.getArtifact(), tag.getContent()));
56 super.setName(tag.getContent().getName());
57 super.setDisplayName(tag.getContent().getName());
58 this.setIconBaseWithExtension(ICON_PATH);
64 Sheet propertySheet = super.createSheet();
65 Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);
66 if (properties == null) {
67 properties = Sheet.createPropertiesSet();
68 propertySheet.put(properties);
72 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
73 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
75 tag.getContent().getName()));
78 contentPath = tag.getContent().getUniquePath();
79 }
catch (TskCoreException ex) {
80 Logger.
getLogger(ContentTagNode.class.getName()).log(Level.SEVERE,
"Failed to get path for content (id = " + tag.getContent().getId() +
")", ex);
81 contentPath = NbBundle.getMessage(this.getClass(),
"BlackboardArtifactTagNode.createSheet.unavail.text");
84 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
85 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
89 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
90 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
92 tag.getArtifact().getDisplayName()));
94 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
95 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
102 @NbBundle.Messages(
"BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
105 List<Action> actions =
new ArrayList<>();
106 actions.addAll(Arrays.asList(super.getActions(context)));
107 BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
113 }
catch (TskCoreException ex) {
114 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting arttribute(s) from blackboard artifact{0}.", artifact.getArtifactID()), ex);
115 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_resultErrorMessage());
120 AbstractFile c = findLinked(artifact);
124 }
catch (TskCoreException ex) {
125 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex);
126 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_linkedFileMessage());
129 AbstractFile file = getLookup().lookup(AbstractFile.class);
133 actions.add(
new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
136 return actions.toArray(
new Action[0]);
141 return visitor.
visit(
this);
151 return getClass().getName();
BlackboardArtifactTagNode(BlackboardArtifactTag tag)
static boolean hasSupportedTimeStamp(BlackboardArtifact artifact)
static List< Action > getActions(File file, boolean isArtifactSource)
T visit(DataSourcesNode in)
static ViewFileInTimelineAction createViewSourceFileAction(AbstractFile file)
static final Logger LOGGER
static void error(String title, String message)
final BlackboardArtifactTag tag
synchronized static Logger getLogger(String name)
static final String ICON_PATH
Action[] getActions(boolean context)
static ViewFileInTimelineAction createViewFileAction(AbstractFile file)