diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index 5a2ae7a14f..5e359317cd 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -88,7 +88,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel { DataResultFilterNode dataResultFilterNode = new DataResultFilterNode(contentFilesNode, DirectoryTreeTopComponent.findInstance().getExplorerManager()); - TableFilterNode tableFilterNode = new TableFilterNode(dataResultFilterNode, true); + TableFilterNode tableFilterNode = new TableFilterNode(dataResultFilterNode); TopComponent component = DataResultTopComponent.createInstance( title, diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterChildrenWithDescendants.java b/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterChildrenWithDescendants.java new file mode 100644 index 0000000000..022ca9274d --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterChildrenWithDescendants.java @@ -0,0 +1,47 @@ +/* + * + * Autopsy Forensic Browser + * + * Copyright 2018 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.corecomponents; + +import org.openide.nodes.Children; +import org.openide.nodes.Node; + +/** + * Provides TableFilterChildren functionality, and adds support for children + * of rows (plus/minus buttons for each row with children). + */ +class TableFilterChildrenWithDescendants extends TableFilterChildren { + + private TableFilterChildrenWithDescendants(Node wrappedNode) { + super(wrappedNode); + } + + public static Children createInstance(Node wrappedNode, boolean createChildren){ + if(createChildren){ + return new TableFilterChildrenWithDescendants(wrappedNode); + } else { + return Children.LEAF; + } + } + + @Override + protected Node copyNode(Node nodeToCopy){ + return new TableFilterNode(nodeToCopy, true); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterNode.java b/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterNode.java index 2541c11277..88069f33b8 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/TableFilterNode.java @@ -49,6 +49,16 @@ public class TableFilterNode extends FilterNode { super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node)); this.createChildren = createChildren; } + + /** + * Constructs a filter node that generates children using TableFilterChildrenWithDescendants. + * This enables row to have descendants. + * @param node The node to wrap + */ + public TableFilterNode(Node node){ + super(node, TableFilterChildrenWithDescendants.createInstance(node, true), Lookups.proxy(node)); + this.createChildren = true; + } /** * Constructs a filter node that creates at most one layer of child nodes