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;
73 displayName = (dsObjId > 0) ? NbBundle.getMessage(
DataSourceFilesNode.class,
"DataSourcesNode.group_by_datasource.name") :
NAME;
79 setDisplayName(displayName);
80 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/image.png");
85 return getClass().getName();
96 List<Content> currentKeys;
103 super(
"ds_" + Long.toString(dsObjId));
104 this.currentKeys =
new ArrayList<>();
105 this.datasourceObjId = dsObjId;
108 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
110 public void propertyChange(PropertyChangeEvent evt) {
111 String eventType = evt.getPropertyName();
132 if (datasourceObjId == 0) {
136 currentKeys =
new ArrayList<>(Arrays.asList(content));
139 Collections.sort(currentKeys,
new Comparator<Content>() {
141 public int compare(Content content1, Content content2) {
142 String content1Name = content1.getName().toLowerCase();
143 String content2Name = content2.getName().toLowerCase();
144 return content1Name.compareTo(content2Name);
150 logger.log(Level.SEVERE,
"Error getting data sources: {0}", ex.getMessage());
164 return visitor.
visit(
this);
169 Sheet sheet = super.createSheet();
170 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
171 if (sheetSet == null) {
172 sheetSet = Sheet.createPropertiesSet();
176 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.name"),
177 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.displayName"),
178 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.desc"),
List< Content > getDataSources()
static String getNameIdentifier()
final PropertyChangeListener pcl
DataSourceFilesNode(long dsObjId)
static final Logger logger
DataSourcesNodeChildren(long dsObjId)
DataSourcesNodeChildren()
DataSourceFilesNode(List< Content > images)
SleuthkitCase getSleuthkitCase()
T visit(DataSourceFilesNode in)
final long datasourceObjId
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
List< Content > makeKeys()