20 package org.sleuthkit.autopsy.commonpropertiessearch;
22 import java.util.List;
23 import org.openide.nodes.ChildFactory;
24 import org.openide.nodes.Children;
25 import org.openide.nodes.Node;
26 import org.openide.nodes.Sheet;
27 import org.openide.util.NbBundle;
54 super(Children.create(
new FileInstanceNodeFactory(attributeValues),
true));
57 this.dataSourceToValueList = attributeValues;
59 this.setDisplayName(this.dataSourceName);
60 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/image.png");
68 String getDatasourceName() {
76 void createChildren() {
78 setChildren(Children.create(
new FileInstanceNodeFactory(dataSourceToValueList),
true));
88 return getClass().getName();
93 Sheet sheet =
new Sheet();
94 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
95 if (sheetSet == null) {
96 sheetSet = Sheet.createPropertiesSet();
99 final String NO_DESCR = Bundle.InstanceCountNode_createSheet_noDescription();
101 sheetSet.put(
new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_localPath(), Bundle.CommonFilesSearchResultsViewerTable_localPath(), NO_DESCR,
""));
103 sheetSet.put(
new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_valueColLbl(), Bundle.CommonFilesSearchResultsViewerTable_valueColLbl(), NO_DESCR,
""));
109 return visitor.
visit(
this);
115 static class FileInstanceNodeFactory
extends ChildFactory<AbstractCommonAttributeInstance> {
117 private final CommonAttributeValueList descendants;
119 FileInstanceNodeFactory(CommonAttributeValueList descendants) {
120 this.descendants = descendants;
124 protected boolean createKeys(List<AbstractCommonAttributeInstance> list) {
125 for (CommonAttributeValue value : descendants.getDelayedMetadataSet()) {
129 value.getInstances().forEach((acai) -> {
130 acai.getAbstractFile();
133 list.addAll(value.getInstances());
139 protected Node[] createNodesForKey(AbstractCommonAttributeInstance searchResult) {
140 return searchResult.generateNodes();
final CommonAttributeValueList dataSourceToValueList
T visit(DataSourcesNode in)
void displayDelayedMetadata()
final String dataSourceName
static final Logger logger
synchronized static Logger getLogger(String name)
InstanceDataSourceNode(String dataSourceName, CommonAttributeValueList attributeValues)