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.Sheet;
28 import org.openide.util.NbBundle;
29 import org.openide.util.NbBundle.Messages;
30 import org.openide.util.lookup.Lookups;
50 private static final String
ICON_PATH =
"org/sleuthkit/autopsy/images/green-tag-icon-16.png";
51 private final BlackboardArtifactTag
tag;
54 super(Lookups.fixed(tag, tag.getArtifact(), tag.getContent()), tag.getContent());
55 super.setName(tag.getContent().getName());
56 super.setDisplayName(tag.getContent().getName());
57 this.setIconBaseWithExtension(ICON_PATH);
61 @Messages({
"BlackboardArtifactTagNode.createSheet.userName.text=User Name"})
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()));
76 addOriginalNameProp(properties);
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 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
101 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
104 return propertySheet;
107 @NbBundle.Messages(
"BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
110 List<Action> actions =
new ArrayList<>();
111 actions.addAll(Arrays.asList(super.getActions(context)));
112 BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
118 }
catch (TskCoreException ex) {
119 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting arttribute(s) from blackboard artifact{0}.", artifact.getArtifactID()), ex);
124 AbstractFile c = findLinked(artifact);
128 }
catch (TskCoreException ex) {
129 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex);
132 AbstractFile file = getLookup().lookup(AbstractFile.class);
136 actions.add(
new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
139 return actions.toArray(
new Action[0]);
144 return visitor.
visit(
this);
149 return getClass().getName();
BlackboardArtifactTagNode(BlackboardArtifactTag tag)
static boolean hasSupportedTimeStamp(BlackboardArtifact artifact)
static List< Action > getActions(File file, boolean isArtifactSource)
static ViewFileInTimelineAction createViewSourceFileAction(AbstractFile file)
T visit(DataSourceFilesNode in)
static final Logger LOGGER
final BlackboardArtifactTag tag
synchronized static Logger getLogger(String name)
static final String ICON_PATH
Action[] getActions(boolean context)
static ViewFileInTimelineAction createViewFileAction(AbstractFile file)