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.NbBundle.Messages;
31 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);
63 @Messages({
"BlackboardArtifactTagNode.createSheet.userName.text=User Name"})
66 Sheet propertySheet = super.createSheet();
67 Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);
68 if (properties == null) {
69 properties = Sheet.createPropertiesSet();
70 propertySheet.put(properties);
74 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
75 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
77 tag.getContent().getName()));
80 contentPath = tag.getContent().getUniquePath();
81 }
catch (TskCoreException ex) {
82 Logger.
getLogger(ContentTagNode.class.getName()).log(Level.SEVERE,
"Failed to get path for content (id = " + tag.getContent().getId() +
")", ex);
83 contentPath = NbBundle.getMessage(this.getClass(),
"BlackboardArtifactTagNode.createSheet.unavail.text");
87 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
88 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
92 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
93 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
95 tag.getArtifact().getDisplayName()));
97 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
98 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
102 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
103 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
106 return propertySheet;
109 @NbBundle.Messages(
"BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
112 List<Action> actions =
new ArrayList<>();
113 actions.addAll(Arrays.asList(super.getActions(context)));
114 BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
120 }
catch (TskCoreException ex) {
121 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting arttribute(s) from blackboard artifact{0}.", artifact.getArtifactID()), ex);
122 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_resultErrorMessage());
131 }
catch (TskCoreException ex) {
132 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex);
133 MessageNotifyUtil.
Notify.
error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_linkedFileMessage());
136 AbstractFile file = getLookup().lookup(AbstractFile.class);
140 actions.add(
new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
143 return actions.toArray(
new Action[0]);
148 return visitor.
visit(
this);
158 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 AbstractFile findLinked(BlackboardArtifact artifact)
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)