20 package org.sleuthkit.autopsy.commonpropertiessearch;
22 import java.util.HashMap;
23 import java.util.List;
25 import org.openide.nodes.ChildFactory;
26 import org.openide.nodes.Children;
27 import org.openide.nodes.Node;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
54 public InstanceCaseNode(String caseName, Map<String, CommonAttributeValueList> attributeValues) {
55 super(Children.create(
new CommonAttributeDataSourceNodeFactory(attributeValues),
true));
57 this.dataSourceToValueList = attributeValues;
58 this.setDisplayName(this.caseName);
59 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/briefcase.png");
67 String getCaseName() {
75 void createChildren() {
76 setChildren(Children.create(
new CommonAttributeDataSourceNodeFactory(dataSourceToValueList),
true));
85 Map<String, CommonAttributeValueList> getDataSourceToValueList() {
90 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
91 return visitor.visit(
this);
101 return getClass().getName();
106 Sheet sheet =
new Sheet();
107 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
108 if (sheetSet == null) {
109 sheetSet = Sheet.createPropertiesSet();
112 final String NO_DESCR = Bundle.InstanceCountNode_createSheet_noDescription();
114 sheetSet.put(
new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_localPath(), Bundle.CommonFilesSearchResultsViewerTable_localPath(), NO_DESCR,
""));
116 sheetSet.put(
new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_valueColLbl(), Bundle.CommonFilesSearchResultsViewerTable_valueColLbl(), NO_DESCR,
""));
124 static class CommonAttributeDataSourceNodeFactory
extends ChildFactory<String> {
130 private final Map<String, CommonAttributeValueList> metadata;
132 CommonAttributeDataSourceNodeFactory(Map<String, CommonAttributeValueList> attributeValues) {
133 this.metadata =
new HashMap<>();
134 this.metadata.putAll(attributeValues);
138 protected boolean createKeys(List<String> list) {
139 list.addAll(this.metadata.keySet());
144 protected Node createNodeForKey(String dataSourceName) {
145 return new InstanceDataSourceNode(dataSourceName, this.metadata.get(dataSourceName));
final Map< String, CommonAttributeValueList > dataSourceToValueList
InstanceCaseNode(String caseName, Map< String, CommonAttributeValueList > attributeValues)
synchronized static Logger getLogger(String name)
static final Logger logger