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.Lookup;
29 import org.openide.util.NbBundle;
30 import org.openide.util.NbBundle.Messages;
31 import org.openide.util.lookup.Lookups;
54 private static final String
ICON_PATH =
"org/sleuthkit/autopsy/images/green-tag-icon-16.png";
55 private final BlackboardArtifactTag
tag;
59 String name = tag.getContent().getName();
61 name = tag.getArtifact().getShortDescription();
62 }
catch (TskCoreException ex) {
63 LOGGER.log(Level.WARNING,
"Failed to get short description for artifact id=" + tag.getArtifact().getId(), ex);
67 this.setIconBaseWithExtension(ICON_PATH);
87 Content sourceContent = tag.getContent();
88 BlackboardArtifact artifact = tag.getArtifact();
90 if (artifact instanceof AnalysisResult) {
95 return Lookups.fixed(tag, artifactItem, artifact, sourceContent);
98 @Messages({
"BlackboardArtifactTagNode.createSheet.userName.text=User Name"})
101 Sheet propertySheet = super.createSheet();
102 Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);
103 if (properties == null) {
104 properties = Sheet.createPropertiesSet();
105 propertySheet.put(properties);
109 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
110 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFile.text"),
113 addOriginalNameProp(properties);
116 contentPath = tag.getContent().getUniquePath();
117 }
catch (TskCoreException ex) {
118 Logger.
getLogger(ContentTagNode.class.getName()).log(Level.SEVERE,
"Failed to get path for content (id = " + tag.getContent().getId() +
")", ex);
119 contentPath = NbBundle.getMessage(this.getClass(),
"BlackboardArtifactTagNode.createSheet.unavail.text");
122 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
123 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
127 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
128 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.resultType.text"),
130 tag.getArtifact().getDisplayName()));
132 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
133 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.comment.text"),
137 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
138 NbBundle.getMessage(
this.getClass(),
"BlackboardArtifactTagNode.createSheet.userName.text"),
141 return propertySheet;
144 @NbBundle.Messages(
"BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
147 List<Action> actions =
new ArrayList<>();
148 BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
154 }
catch (TskCoreException ex) {
155 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting arttribute(s) from blackboard artifact{0}.", artifact.getArtifactID()), ex);
158 actions.add(
new ViewTaggedArtifactAction(Bundle.BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
162 AbstractFile c = findLinked(artifact);
166 }
catch (TskCoreException ex) {
167 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex);
170 AbstractFile file = getLookup().lookup(AbstractFile.class);
176 actions.addAll(Arrays.asList(super.getActions(context)));
177 return actions.toArray(
new Action[0]);
182 return visitor.
visit(
this);
187 return getClass().getName();
BlackboardArtifactTagNode(BlackboardArtifactTag tag)
static Lookup createLookup(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)