19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.EnumSet;
24 import java.util.List;
26 import java.util.logging.Level;
27 import java.util.stream.Collectors;
28 import org.openide.nodes.ChildFactory;
29 import org.openide.nodes.Children;
30 import org.openide.nodes.Node;
31 import org.openide.nodes.Sheet;
32 import org.openide.util.NbBundle;
33 import org.openide.util.NbBundle.Messages;
34 import org.openide.util.WeakListeners;
35 import org.openide.util.lookup.Lookups;
51 "DataSourcesHostsNode_name=Data Sources"
65 private static final Set<String> UPDATE_EVT_STRS = UPDATE_EVTS.stream()
66 .map(evt -> evt.name())
67 .collect(Collectors.toSet());
71 private final PropertyChangeListener pcl =
new PropertyChangeListener() {
73 public void propertyChange(PropertyChangeEvent evt) {
74 String eventType = evt.getPropertyName();
75 if (UPDATE_EVT_STRS.contains(eventType)) {
81 private final PropertyChangeListener weakPcl = WeakListeners.propertyChange(pcl, null);
95 protected boolean createKeys(List<HostDataSources> toPopulate) {
98 .map(HostDataSources::new)
100 .forEach(toPopulate::add);
103 logger.log(Level.SEVERE,
"Error getting data sources: {0}", ex.getMessage());
116 private static final String NAME = Bundle.DataSourcesHostsNode_name();
129 super(Children.create(
new DataSourcesByTypeChildren(),
true), Lookups.singleton(NAME));
131 setDisplayName(NAME);
132 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/image.png");
137 return getClass().getName();
147 return visitor.
visit(
this);
152 Sheet sheet = super.createSheet();
153 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
154 if (sheetSet == null) {
155 sheetSet = Sheet.createPropertiesSet();
159 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.name"),
160 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.displayName"),
161 NbBundle.getMessage(
this.getClass(),
"DataSourcesNode.createSheet.name.desc"),
Node createNodeForKey(HostDataSources key)
boolean createKeys(List< HostDataSources > toPopulate)
SleuthkitCase getSleuthkitCase()
T visit(DataSourceFilesNode in)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static String getNameIdentifier()
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)