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;
52 private static final String
ICON_PATH =
"org/sleuthkit/autopsy/images/green-tag-icon-16.png";
53 private final BlackboardArtifactTag
tag;
56 super(Children.LEAF, Lookups.fixed(tag, tag.getArtifact(), tag.getContent()));
57 super.setName(tag.getContent().getName());
58 super.setDisplayName(tag.getContent().getName());
59 this.setIconBaseWithExtension(ICON_PATH);
65 Sheet propertySheet = super.createSheet();
66 Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);
67 if (properties == null) {
68 properties = Sheet.createPropertiesSet();
69 propertySheet.put(properties);
73 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
74 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
76 tag.getContent().getName()));
79 contentPath = tag.getContent().getUniquePath();
80 }
catch (TskCoreException ex) {
81 Logger.
getLogger(ContentTagNode.class.getName()).log(Level.SEVERE,
"Failed to get path for content (id = " + tag.getContent().getId() +
")", ex);
82 contentPath = NbBundle.getMessage(this.getClass(),
"BlackboardArtifactTagNode.createSheet.unavail.text");
85 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
86 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
90 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
91 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
93 tag.getArtifact().getDisplayName()));
95 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
96 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
100 return propertySheet;
103 @NbBundle.Messages(
"BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
106 List<Action> actions =
new ArrayList<>();
107 actions.addAll(Arrays.asList(super.getActions(context)));
108 BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
114 }
catch (TskCoreException ex) {
115 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting arttribute(s) from blackboard artifact{0}.", artifact.getArtifactID()), ex);
116 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_resultErrorMessage());
121 AbstractFile c = findLinked(artifact);
125 }
catch (TskCoreException ex) {
126 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex);
127 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_linkedFileMessage());
130 AbstractFile file = getLookup().lookup(AbstractFile.class);
134 actions.add(
new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
137 return actions.toArray(
new Action[0]);
142 return v.
visit(
this);
152 return getClass().getName();
BlackboardArtifactTagNode(BlackboardArtifactTag tag)
static boolean hasSupportedTimeStamp(BlackboardArtifact artifact)
static List< Action > getActions(File file, boolean isArtifactSource)
static synchronized DeleteBlackboardArtifactTagAction getInstance()
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)