19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.Comparator;
26 import java.util.HashMap;
27 import java.util.List;
28 import java.util.logging.Level;
29 import org.openide.nodes.ChildFactory;
30 import org.openide.nodes.Children;
31 import org.openide.nodes.Node;
32 import org.openide.nodes.Sheet;
33 import org.openide.util.NbBundle;
34 import org.openide.util.lookup.Lookups;
72 public static final String
NAME = NbBundle.getMessage(
RootNode.class,
"ExtractedContentNode.name.text");
79 public <T> T accept(AutopsyItemVisitor<T> v) {
90 super(Children.create(
new TypeFactory(),
true), Lookups.singleton(NAME));
92 super.setDisplayName(NAME);
93 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/extracted_content.png");
103 return v.
visit(
this);
108 Sheet s = super.createSheet();
109 Sheet.Set ss = s.get(Sheet.PROPERTIES);
111 ss = Sheet.createPropertiesSet();
115 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.name"),
116 NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.displayName"),
117 NbBundle.getMessage(
this.getClass(),
"ExtractedContentNode.createSheet.name.desc"),
128 private class TypeFactory extends ChildFactory.Detachable<BlackboardArtifact.ARTIFACT_TYPE> {
146 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
148 public void propertyChange(PropertyChangeEvent evt) {
149 String eventType = evt.getPropertyName();
153 if (
doNotShow.contains(event.getArtifactType()) ==
false) {
162 if (evt.getNewValue() == null) {
182 typeNodeList.clear();
186 protected boolean createKeys(List<BlackboardArtifact.ARTIFACT_TYPE> list) {
187 if (skCase == null) {
194 Collections.sort(inUse,
195 new Comparator<BlackboardArtifact.ARTIFACT_TYPE>() {
198 return a.getDisplayName().compareTo(b.getDisplayName());
206 TypeNode node = typeNodeList.get(art);
208 node.updateDisplayName();
212 Logger.
getLogger(
TypeFactory.class.getName()).log(Level.SEVERE,
"Error getting list of artifacts in use: " + ex.getLocalizedMessage());
221 typeNodeList.put(key, node);
239 super.setName(
type.getLabel());
241 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/" +
getIcon(
type));
245 final void updateDisplayName() {
246 if (skCase == null) {
255 }
catch (TskException ex) {
256 Logger.getLogger(TypeNode.class.getName())
257 .log(Level.WARNING,
"Error getting child count", ex);
264 Sheet s = super.createSheet();
265 Sheet.Set ss = s.get(Sheet.PROPERTIES);
267 ss = Sheet.createPropertiesSet();
271 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.name"),
272 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.displayName"),
273 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.artType.desc"),
276 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.name"),
277 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.displayName"),
278 NbBundle.getMessage(
this.getClass(),
"ArtifactTypeNode.createSheet.childCnt.desc"),
286 return v.
visit(
this);
292 case TSK_WEB_BOOKMARK:
293 return "bookmarks.png";
295 return "cookies.png";
296 case TSK_WEB_HISTORY:
297 return "history.png";
298 case TSK_WEB_DOWNLOAD:
299 return "downloads.png";
300 case TSK_INSTALLED_PROG:
301 return "programs.png";
302 case TSK_RECENT_OBJECT:
303 return "recent_docs.png";
304 case TSK_DEVICE_ATTACHED:
305 return "usb_devices.png";
306 case TSK_WEB_SEARCH_QUERY:
307 return "searchquery.png";
308 case TSK_METADATA_EXIF:
309 return "camera-icon-16.png";
311 return "mail-icon-16.png";
313 return "contact.png";
315 return "message.png";
317 return "calllog.png";
318 case TSK_CALENDAR_ENTRY:
319 return "calendar.png";
320 case TSK_SPEED_DIAL_ENTRY:
321 return "speeddialentry.png";
322 case TSK_BLUETOOTH_PAIRING:
323 return "bluetooth.png";
324 case TSK_GPS_BOOKMARK:
326 case TSK_GPS_LAST_KNOWN_LOCATION:
327 return "gps-lastlocation.png";
329 return "gps-search.png";
330 case TSK_SERVICE_ACCOUNT:
331 return "account-icon-16.png";
332 case TSK_ENCRYPTION_DETECTED:
333 return "encrypted-file.png";
334 case TSK_EXT_MISMATCH_DETECTED:
335 return "mismatch-16.png";
337 return "computer.png";
340 return "artifact-icon.png";
361 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
363 public void propertyChange(PropertyChangeEvent evt) {
364 String eventType = evt.getPropertyName();
368 if (event.getArtifactType() ==
type) {
391 protected boolean createKeys(List<BlackboardArtifact> list) {
392 if (skCase == null) {
TSK_INTERESTING_ARTIFACT_HIT
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
ArrayList< BlackboardArtifact > getBlackboardArtifacts(int artifactTypeID)
TSK_EXT_MISMATCH_DETECTED
T visit(DataSourcesNode in)
void removeIngestJobEventListener(final PropertyChangeListener listener)
ArrayList< BlackboardArtifact.ARTIFACT_TYPE > getBlackboardArtifactTypesInUse()
void addIngestJobEventListener(final PropertyChangeListener listener)
TSK_GPS_LAST_KNOWN_LOCATION
static synchronized void removePropertyChangeListener(PropertyChangeListener listener)
long getBlackboardArtifactsTypeCount(int artifactTypeID)
void addIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized void addPropertyChangeListener(PropertyChangeListener listener)
static Logger getLogger(String name)