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.Arrays;
25 import java.util.Collections;
26 import java.util.EnumSet;
27 import java.util.List;
28 import java.util.logging.Level;
29 import org.openide.nodes.Sheet;
30 import org.openide.util.NbBundle;
31 import org.openide.util.lookup.Lookups;
59 displayName = (dsObjId > 0) ? NbBundle.getMessage(
DataSourcesNode.class,
"DataSourcesNode.group_by_datasource.name") :
NAME;
65 setDisplayName(displayName);
66 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/image.png");
71 return getClass().getName();
82 List<Content> currentKeys;
90 this.currentKeys =
new ArrayList<>();
91 this.datasourceObjId = dsObjId;
94 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
96 public void propertyChange(PropertyChangeEvent evt) {
97 String eventType = evt.getPropertyName();
114 setKeys(Collections.<Content>emptySet());
119 if (datasourceObjId == 0) {
124 currentKeys =
new ArrayList<>(Arrays.asList(content));
126 setKeys(currentKeys);
128 logger.log(Level.SEVERE,
"Error getting data sources: {0}", ex.getMessage());
129 setKeys(Collections.<Content>emptySet());
137 for (Content key : currentKeys) {
150 return visitor.
visit(
this);
155 Sheet sheet = super.createSheet();
156 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
157 if (sheetSet == null) {
158 sheetSet = Sheet.createPropertiesSet();
162 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.name"),
163 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.displayName"),
164 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.desc"),
List< Content > getDataSources()
DataSourcesNode(List< Content > images)
T visit(DataSourcesNode in)
final PropertyChangeListener pcl
static final Logger logger
DataSourcesNode(long dsObjId)
void refreshContentKeys()
DataSourcesNodeChildren(long dsObjId)
SleuthkitCase getSleuthkitCase()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
DataSourcesNodeChildren()
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
final long datasourceObjId