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.Comparator;
27 import java.util.EnumSet;
28 import java.util.List;
29 import java.util.logging.Level;
30 import org.openide.nodes.Children;
31 import org.openide.nodes.Sheet;
32 import org.openide.util.NbBundle;
33 import org.openide.util.lookup.Lookups;
61 displayName = (dsObjId > 0) ? NbBundle.getMessage(
DataSourcesNode.class,
"DataSourcesNode.group_by_datasource.name") :
NAME;
67 setDisplayName(displayName);
68 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/image.png");
73 return getClass().getName();
84 List<Content> currentKeys;
91 super(
"ds_" + Long.toString(dsObjId));
92 this.currentKeys =
new ArrayList<>();
93 this.datasourceObjId = dsObjId;
96 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
98 public void propertyChange(PropertyChangeEvent evt) {
99 String eventType = evt.getPropertyName();
120 if (datasourceObjId == 0) {
125 currentKeys =
new ArrayList<>(Arrays.asList(content));
128 Collections.sort(currentKeys,
new Comparator<Content>() {
130 public int compare(Content content1, Content content2) {
131 String content1Name = content1.getName().toLowerCase();
132 String content2Name = content2.getName().toLowerCase();
133 return content1Name.compareTo(content2Name);
139 logger.log(Level.SEVERE,
"Error getting data sources: {0}", ex.getMessage());
153 return visitor.
visit(
this);
158 Sheet sheet = super.createSheet();
159 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
160 if (sheetSet == null) {
161 sheetSet = Sheet.createPropertiesSet();
165 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.name"),
166 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.displayName"),
167 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)
DataSourcesNodeChildren(long dsObjId)
SleuthkitCase getSleuthkitCase()
List< Content > makeKeys()
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