tablefilternode pulled into an interface

This commit is contained in:
Brian Sweeney 2018-06-16 17:15:13 -06:00
parent 16dfbcf434
commit 416d4d3242
18 changed files with 132 additions and 69 deletions

View File

@ -34,7 +34,7 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable; import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.directorytree.DataResultFilterNode; import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
@ -245,7 +245,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
DataResultFilterNode dataResultFilterNode = new DataResultFilterNode(commonFilesNode, ExplorerManager.find(CommonFilesPanel.this)); DataResultFilterNode dataResultFilterNode = new DataResultFilterNode(commonFilesNode, ExplorerManager.find(CommonFilesPanel.this));
//TODO this will be something else that acts similarly to tablefilternode //TODO this will be something else that acts similarly to tablefilternode
SinlgeLayerTableFilterNode tableFilterWithDescendantsNode = new SinlgeLayerTableFilterNode(dataResultFilterNode); SingleLayerTableFilterNode tableFilterWithDescendantsNode = new SingleLayerTableFilterNode(dataResultFilterNode);
DataResultViewerTable table = new DataResultViewerTable(); DataResultViewerTable table = new DataResultViewerTable();

View File

@ -33,7 +33,7 @@ import org.openide.util.Lookup;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.corecomponents.DataResultPanel; import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable; import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.directorytree.DataResultFilterNode; import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
/** /**
@ -142,7 +142,7 @@ public final class MessageBrowser extends JPanel implements ExplorerManager.Prov
rootNode = selectedNode; rootNode = selectedNode;
} }
messagesResultPanel.setPath(rootNode.getDisplayName()); messagesResultPanel.setPath(rootNode.getDisplayName());
messagesResultPanel.setNode(new SinlgeLayerTableFilterNode(new DataResultFilterNode(rootNode, gacExplorerManager), true)); messagesResultPanel.setNode(new SingleLayerTableFilterNode(new DataResultFilterNode(rootNode, gacExplorerManager), true));
} }
} }
} }

View File

@ -38,7 +38,7 @@ import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
import org.sleuthkit.autopsy.corecomponents.DataResultPanel; import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.FileNode; import org.sleuthkit.autopsy.datamodel.FileNode;
import org.sleuthkit.autopsy.datamodel.NodeProperty; import org.sleuthkit.autopsy.datamodel.NodeProperty;
@ -99,7 +99,7 @@ public class MessageContentViewer extends javax.swing.JPanel implements DataCont
@NbBundle.Messages("MessageContentViewer.AtrachmentsPanel.title=Attachments") @NbBundle.Messages("MessageContentViewer.AtrachmentsPanel.title=Attachments")
public MessageContentViewer() { public MessageContentViewer() {
initComponents(); initComponents();
drp = DataResultPanel.createInstanceUninitialized(Bundle.MessageContentViewer_AtrachmentsPanel_title(), "", new SinlgeLayerTableFilterNode(Node.EMPTY, false), 0, null); drp = DataResultPanel.createInstanceUninitialized(Bundle.MessageContentViewer_AtrachmentsPanel_title(), "", new SingleLayerTableFilterNode(Node.EMPTY, false), 0, null);
attachmentsScrollPane.setViewportView(drp); attachmentsScrollPane.setViewportView(drp);
msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, true); msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, true);
@ -596,7 +596,7 @@ public class MessageContentViewer extends javax.swing.JPanel implements DataCont
msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, numberOfAttachments > 0); msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, numberOfAttachments > 0);
msgbodyTabbedPane.setTitleAt(ATTM_TAB_INDEX, "Attachments (" + numberOfAttachments + ")"); msgbodyTabbedPane.setTitleAt(ATTM_TAB_INDEX, "Attachments (" + numberOfAttachments + ")");
drp.setNode(new SinlgeLayerTableFilterNode(new DataResultFilterNode(new AbstractNode( drp.setNode(new SingleLayerTableFilterNode(new DataResultFilterNode(new AbstractNode(
new AttachmentsChildren(attachments)), null), true)); new AttachmentsChildren(attachments)), null), true));
} }

View File

@ -443,8 +443,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C
* found. * found.
*/ */
int tabToSelect = NO_TAB_SELECTED; int tabToSelect = NO_TAB_SELECTED;
if (selectedNode instanceof SinlgeLayerTableFilterNode) { if (selectedNode instanceof SingleLayerTableFilterNode) {
NodeSelectionInfo selectedChildInfo = ((SinlgeLayerTableFilterNode) selectedNode).getChildNodeSelectionInfo(); NodeSelectionInfo selectedChildInfo = ((TableFilterNode) selectedNode).getChildNodeSelectionInfo();
if (null != selectedChildInfo) { if (null != selectedChildInfo) {
for (int i = 0; i < resultViewers.size(); ++i) { for (int i = 0; i < resultViewers.size(); ++i) {
if (resultViewers.get(i) instanceof DataResultViewerTable && resultViewerTabs.isEnabledAt(i)) { if (resultViewers.get(i) instanceof DataResultViewerTable && resultViewerTabs.isEnabledAt(i)) {

View File

@ -315,8 +315,8 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
* it. * it.
*/ */
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof TableFilterNode) {
NodeSelectionInfo selectedChildInfo = ((SinlgeLayerTableFilterNode) rootNode).getChildNodeSelectionInfo(); NodeSelectionInfo selectedChildInfo = ((TableFilterNode) rootNode).getChildNodeSelectionInfo();
if (null != selectedChildInfo) { if (null != selectedChildInfo) {
Node[] childNodes = rootNode.getChildren().getNodes(true); Node[] childNodes = rootNode.getChildren().getNodes(true);
for (int i = 0; i < childNodes.length; ++i) { for (int i = 0; i < childNodes.length; ++i) {
@ -330,7 +330,7 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
break; break;
} }
} }
((SinlgeLayerTableFilterNode) rootNode).setChildNodeSelectionInfo(null); ((TableFilterNode) rootNode).setChildNodeSelectionInfo(null);
} }
} }
}); });
@ -430,8 +430,8 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
if (rootNode == null || propertiesMap.isEmpty()) { if (rootNode == null || propertiesMap.isEmpty()) {
return; return;
} }
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof TableFilterNode) {
SinlgeLayerTableFilterNode tfn = (SinlgeLayerTableFilterNode) rootNode; TableFilterNode tfn = (TableFilterNode) rootNode;
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
final ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel(); final ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel();
for (Map.Entry<String, ETableColumn> entry : columnMap.entrySet()) { for (Map.Entry<String, ETableColumn> entry : columnMap.entrySet()) {
@ -456,8 +456,8 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
if (rootNode == null || propertiesMap.isEmpty()) { if (rootNode == null || propertiesMap.isEmpty()) {
return; return;
} }
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof TableFilterNode) {
SinlgeLayerTableFilterNode tfn = (SinlgeLayerTableFilterNode) rootNode; TableFilterNode tfn = (TableFilterNode) rootNode;
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
// Store the current order of the columns into settings // Store the current order of the columns into settings
for (Map.Entry<Integer, Property<?>> entry : propertiesMap.entrySet()) { for (Map.Entry<Integer, Property<?>> entry : propertiesMap.entrySet()) {
@ -473,8 +473,8 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
if (rootNode == null || propertiesMap.isEmpty()) { if (rootNode == null || propertiesMap.isEmpty()) {
return; return;
} }
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof TableFilterNode) {
final SinlgeLayerTableFilterNode tfn = ((SinlgeLayerTableFilterNode) rootNode); final TableFilterNode tfn = ((TableFilterNode) rootNode);
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel(); ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel();
for (Map.Entry<String, ETableColumn> entry : columnMap.entrySet()) { for (Map.Entry<String, ETableColumn> entry : columnMap.entrySet()) {
@ -505,8 +505,8 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
if (rootNode == null || propertiesMap.isEmpty()) { if (rootNode == null || propertiesMap.isEmpty()) {
return; return;
} }
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof TableFilterNode) {
final SinlgeLayerTableFilterNode tfn = (SinlgeLayerTableFilterNode) rootNode; final TableFilterNode tfn = (TableFilterNode) rootNode;
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
//organize property sorting information, sorted by rank //organize property sorting information, sorted by rank
TreeSet<ColumnSortInfo> sortInfos = new TreeSet<>(Comparator.comparing(ColumnSortInfo::getRank)); TreeSet<ColumnSortInfo> sortInfos = new TreeSet<>(Comparator.comparing(ColumnSortInfo::getRank));
@ -531,9 +531,9 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
if (rootNode == null || propertiesMap.isEmpty()) { if (rootNode == null || propertiesMap.isEmpty()) {
return; return;
} }
if (rootNode instanceof SinlgeLayerTableFilterNode) { if (rootNode instanceof SingleLayerTableFilterNode) {
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
final SinlgeLayerTableFilterNode tfn = ((SinlgeLayerTableFilterNode) rootNode); final TableFilterNode tfn = ((TableFilterNode) rootNode);
ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel(); ETableColumnModel columnModel = (ETableColumnModel) outline.getColumnModel();
for (Map.Entry<Integer, Property<?>> entry : propertiesMap.entrySet()) { for (Map.Entry<Integer, Property<?>> entry : propertiesMap.entrySet()) {
final String propName = entry.getValue().getName(); final String propName = entry.getValue().getName();
@ -557,11 +557,11 @@ public final class DataResultViewerTable extends AbstractDataResultViewer {
List<Property<?>> props = ResultViewerPersistence.getAllChildProperties(rootNode, 100); List<Property<?>> props = ResultViewerPersistence.getAllChildProperties(rootNode, 100);
// If node is not table filter node, use default order for columns // If node is not table filter node, use default order for columns
if (!(rootNode instanceof SinlgeLayerTableFilterNode)) { if (!(rootNode instanceof TableFilterNode)) {
return props; return props;
} }
final SinlgeLayerTableFilterNode tfn = ((SinlgeLayerTableFilterNode) rootNode); final TableFilterNode tfn = ((TableFilterNode) rootNode);
propertiesMap.clear(); propertiesMap.clear();
/* /*

View File

@ -77,7 +77,7 @@ public final class DataResultViewerThumbnail extends AbstractDataResultViewer {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(DataResultViewerThumbnail.class.getName()); private static final Logger logger = Logger.getLogger(DataResultViewerThumbnail.class.getName());
private final PageUpdater pageUpdater = new PageUpdater(); private final PageUpdater pageUpdater = new PageUpdater();
private SinlgeLayerTableFilterNode rootNode; private SingleLayerTableFilterNode rootNode;
private ThumbnailViewChildren rootNodeChildren; private ThumbnailViewChildren rootNodeChildren;
private NodeSelectionListener selectionListener; private NodeSelectionListener selectionListener;
private int currentPage; private int currentPage;
@ -387,7 +387,7 @@ public final class DataResultViewerThumbnail extends AbstractDataResultViewer {
} }
try { try {
if (givenNode != null) { if (givenNode != null) {
rootNode = (SinlgeLayerTableFilterNode) givenNode; rootNode = (SingleLayerTableFilterNode) givenNode;
/* /*
* Wrap the given node in a ThumbnailViewChildren that will * Wrap the given node in a ThumbnailViewChildren that will
* produce ThumbnailPageNodes with ThumbnailViewNode children * produce ThumbnailPageNodes with ThumbnailViewNode children

View File

@ -43,7 +43,7 @@ final class ResultViewerPersistence {
* *
* @return A generated key for the preference file * @return A generated key for the preference file
*/ */
static String getColumnPositionKey(SinlgeLayerTableFilterNode node, String propName) { static String getColumnPositionKey(TableFilterNode node, String propName) {
return getColumnKeyBase(node, propName) + ".column"; return getColumnKeyBase(node, propName) + ".column";
} }
@ -56,7 +56,7 @@ final class ResultViewerPersistence {
* *
* @return A generated key for the preference file * @return A generated key for the preference file
*/ */
static String getColumnSortOrderKey(SinlgeLayerTableFilterNode node, String propName) { static String getColumnSortOrderKey(TableFilterNode node, String propName) {
return getColumnKeyBase(node, propName) + ".sortOrder"; return getColumnKeyBase(node, propName) + ".sortOrder";
} }
@ -69,7 +69,7 @@ final class ResultViewerPersistence {
* *
* @return A generated key for the preference file * @return A generated key for the preference file
*/ */
static String getColumnSortRankKey(SinlgeLayerTableFilterNode node, String propName) { static String getColumnSortRankKey(TableFilterNode node, String propName) {
return getColumnKeyBase(node, propName) + ".sortRank"; return getColumnKeyBase(node, propName) + ".sortRank";
} }
@ -82,11 +82,11 @@ final class ResultViewerPersistence {
* *
* @return A generated key for the preference file * @return A generated key for the preference file
*/ */
static String getColumnHiddenKey(SinlgeLayerTableFilterNode node, String propName) { static String getColumnHiddenKey(TableFilterNode node, String propName) {
return getColumnKeyBase(node, propName) + ".hidden"; return getColumnKeyBase(node, propName) + ".hidden";
} }
private static String getColumnKeyBase(SinlgeLayerTableFilterNode node, String propName) { private static String getColumnKeyBase(TableFilterNode node, String propName) {
return stripNonAlphanumeric(node.getColumnOrderKey()) + "." + stripNonAlphanumeric(propName); return stripNonAlphanumeric(node.getColumnOrderKey()) + "." + stripNonAlphanumeric(propName);
} }
@ -152,7 +152,7 @@ final class ResultViewerPersistence {
* @return A map from sort rank to sort criterion, where rank 1 means that * @return A map from sort rank to sort criterion, where rank 1 means that
* this is the most important sort criteria, 2 means second etc. * this is the most important sort criteria, 2 means second etc.
*/ */
static List< SortCriterion> loadSortCriteria(SinlgeLayerTableFilterNode node) { static List< SortCriterion> loadSortCriteria(SingleLayerTableFilterNode node) {
List<Node.Property<?>> availableProperties = ResultViewerPersistence.getAllChildProperties(node, 100); List<Node.Property<?>> availableProperties = ResultViewerPersistence.getAllChildProperties(node, 100);
final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class); final Preferences preferences = NbPreferences.forModule(DataResultViewerTable.class);
java.util.SortedMap<Integer, SortCriterion> criteriaMap = new TreeMap<>(); java.util.SortedMap<Integer, SortCriterion> criteriaMap = new TreeMap<>();

View File

@ -30,7 +30,7 @@ import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
* wraps. It is designed to be used in the results view to ensure the individual * wraps. It is designed to be used in the results view to ensure the individual
* viewers display only the first layer of child nodes. * viewers display only the first layer of child nodes.
*/ */
public class SinlgeLayerTableFilterNode extends FilterNode { public class SingleLayerTableFilterNode extends FilterNode implements TableFilterNode {
private final boolean createChildren; private final boolean createChildren;
private boolean forceUseWrappedDisplayName = false; private boolean forceUseWrappedDisplayName = false;
@ -46,7 +46,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
* @param createChildren True if a Children object should be created for the * @param createChildren True if a Children object should be created for the
* wrapped node. * wrapped node.
*/ */
public SinlgeLayerTableFilterNode(Node node, boolean createChildren) { public SingleLayerTableFilterNode(Node node, boolean createChildren) {
super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node)); super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node));
this.createChildren = createChildren; this.createChildren = createChildren;
} }
@ -59,7 +59,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
* *
* @param node The node to wrap * @param node The node to wrap
*/ */
public SinlgeLayerTableFilterNode(Node node) { public SingleLayerTableFilterNode(Node node) {
super(node, TableFilterChildrenWithDescendants.createInstance(node, true), Lookups.proxy(node)); super(node, TableFilterChildrenWithDescendants.createInstance(node, true), Lookups.proxy(node));
this.createChildren = true; this.createChildren = true;
this.forceUseWrappedDisplayName = false; this.forceUseWrappedDisplayName = false;
@ -72,7 +72,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
* @param createChildren node has children? * @param createChildren node has children?
* @param forceUseWrappedDisplayName allow use of custom <code>getDisplayName()</code> . * @param forceUseWrappedDisplayName allow use of custom <code>getDisplayName()</code> .
*/ */
SinlgeLayerTableFilterNode(Node node, boolean createChildren, boolean forceUseWrappedDisplayName) { SingleLayerTableFilterNode(Node node, boolean createChildren, boolean forceUseWrappedDisplayName) {
super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node)); super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node));
this.createChildren = createChildren; this.createChildren = createChildren;
this.forceUseWrappedDisplayName = forceUseWrappedDisplayName; this.forceUseWrappedDisplayName = forceUseWrappedDisplayName;
@ -90,7 +90,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
* @param columnOrderKey A key that represents the type of the original * @param columnOrderKey A key that represents the type of the original
* wrapped node and what is being displayed under that node. * wrapped node and what is being displayed under that node.
*/ */
public SinlgeLayerTableFilterNode(Node node, boolean createChildren, String columnOrderKey) { public SingleLayerTableFilterNode(Node node, boolean createChildren, String columnOrderKey) {
super(node, TableFilterChildren.createInstance(node, createChildren)); super(node, TableFilterChildren.createInstance(node, createChildren));
this.createChildren = createChildren; this.createChildren = createChildren;
this.columnOrderKey = columnOrderKey; this.columnOrderKey = columnOrderKey;
@ -113,7 +113,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
} }
} }
protected String getParentDisplayName() { public String getParentDisplayName() {
return super.getDisplayName(); return super.getDisplayName();
} }
@ -159,8 +159,7 @@ public class SinlgeLayerTableFilterNode extends FilterNode {
* DataResultViewerTable. The key should represent what kinds of items the * DataResultViewerTable. The key should represent what kinds of items the
* table is showing. * table is showing.
*/ */
String getColumnOrderKey() { public String getColumnOrderKey() {
return columnOrderKey; return columnOrderKey;
} }
} }

View File

@ -23,7 +23,7 @@ import org.openide.nodes.FilterNode;
import org.openide.nodes.Node; import org.openide.nodes.Node;
/** /**
* A Children implementation for a SinlgeLayerTableFilterNode. A SinlgeLayerTableFilterNode creates at * A Children implementation for a SingleLayerTableFilterNode. A SingleLayerTableFilterNode creates at
most one layer of child nodes for the node it wraps. It is designed to be most one layer of child nodes for the node it wraps. It is designed to be
used in the results view to ensure the individual viewers display only the used in the results view to ensure the individual viewers display only the
first layer of child nodes. first layer of child nodes.
@ -31,18 +31,18 @@ import org.openide.nodes.Node;
class TableFilterChildren extends FilterNode.Children { class TableFilterChildren extends FilterNode.Children {
/** /**
* Creates a Children object for a SinlgeLayerTableFilterNode. A SinlgeLayerTableFilterNode * Creates a Children object for a SingleLayerTableFilterNode. A SingleLayerTableFilterNode
creates at most one layer of child nodes for the node it wraps. It is creates at most one layer of child nodes for the node it wraps. It is
designed to be used in the results view to ensure the individual viewers designed to be used in the results view to ensure the individual viewers
display only the first layer of child nodes. display only the first layer of child nodes.
* *
* *
* @param wrappedNode The node wrapped by the SinlgeLayerTableFilterNode. * @param wrappedNode The node wrapped by the SingleLayerTableFilterNode.
* @param createChildren True if a children (child factory) object should be * @param createChildren True if a children (child factory) object should be
* created for the wrapped node. * created for the wrapped node.
* *
* @return A children (child factory) object for a node wrapped by a * @return A children (child factory) object for a node wrapped by a
SinlgeLayerTableFilterNode. SingleLayerTableFilterNode.
*/ */
public static Children createInstance(Node wrappedNode, boolean createChildren) { public static Children createInstance(Node wrappedNode, boolean createChildren) {
@ -57,27 +57,27 @@ class TableFilterChildren extends FilterNode.Children {
/** /**
* Constructs a children (child factory) implementation for a * Constructs a children (child factory) implementation for a
SinlgeLayerTableFilterNode. A SinlgeLayerTableFilterNode creates at most one layer of child SingleLayerTableFilterNode. A SingleLayerTableFilterNode creates at most one layer of child
nodes for the node it wraps. It is designed to be used for nodes nodes for the node it wraps. It is designed to be used for nodes
displayed in Autopsy table views. displayed in Autopsy table views.
* *
* @param wrappedNode The node wrapped by the SinlgeLayerTableFilterNode. * @param wrappedNode The node wrapped by the SingleLayerTableFilterNode.
*/ */
TableFilterChildren(Node wrappedNode) { TableFilterChildren(Node wrappedNode) {
super(wrappedNode); super(wrappedNode);
} }
/** /**
* Copies a SinlgeLayerTableFilterNode, with the create children (child factory) flag * Copies a SingleLayerTableFilterNode, with the create children (child factory) flag
set to false. set to false.
* *
* @param nodeToCopy The SinlgeLayerTableFilterNode to copy. * @param nodeToCopy The SingleLayerTableFilterNode to copy.
* *
* @return A copy of a SinlgeLayerTableFilterNode. * @return A copy of a SingleLayerTableFilterNode.
*/ */
@Override @Override
protected Node copyNode(Node nodeToCopy) { protected Node copyNode(Node nodeToCopy) {
return new SinlgeLayerTableFilterNode(nodeToCopy, false); return new SingleLayerTableFilterNode(nodeToCopy, false);
} }
/** /**

View File

@ -42,6 +42,6 @@ final class TableFilterChildrenWithDescendants extends TableFilterChildren {
@Override @Override
protected Node copyNode(Node nodeToCopy){ protected Node copyNode(Node nodeToCopy){
return new SinlgeLayerTableFilterNode(nodeToCopy, true, true); return new SingleLayerTableFilterNode(nodeToCopy, true, true);
} }
} }

View File

@ -0,0 +1,64 @@
/*
*
* Autopsy Forensic Browser
*
* Copyright 2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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.sleuthkit.autopsy.datamodel.NodeSelectionInfo;
/**
* Specifies behavior of nodes which are displayed in the DataResultTopComponent.
*/
public interface TableFilterNode {
/**
* Gets information about which child node of this node, if any, should be
* selected.
*
* @return The child node selection information, or null if no child should
* be selected.
*/
public NodeSelectionInfo getChildNodeSelectionInfo();
/**
* @return the column order key, which allows custom column ordering to be
* written into a properties file and be reloaded for future use in a table
* with the same root node or for different cases. This is done by
* DataResultViewerTable. The key should represent what kinds of items the
* table is showing.
*/
public String getColumnOrderKey();
/**
* Gets the display name for the wrapped node, for use in the first column
* of an Autopsy table view.
*
* @return The display name.
*/
public String getDisplayName();
public String getParentDisplayName();
/**
* Adds information about which child node of this node, if any, should be
* selected. Can be null.
*
* @param selectedChildNodeInfo The child node selection information.
*/
public void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo);
}

View File

@ -133,10 +133,10 @@ class ThumbnailViewChildren extends Children.Keys<Integer> {
private synchronized Comparator<Node> getComparator() { private synchronized Comparator<Node> getComparator() {
Comparator<Node> comp = (node1, node2) -> 0; //eveything is equal. Comparator<Node> comp = (node1, node2) -> 0; //eveything is equal.
if (!(parent instanceof SinlgeLayerTableFilterNode)) { if (!(parent instanceof SingleLayerTableFilterNode)) {
return comp; return comp;
} else { } else {
List<SortCriterion> sortCriteria = loadSortCriteria((SinlgeLayerTableFilterNode) parent); List<SortCriterion> sortCriteria = loadSortCriteria((SingleLayerTableFilterNode) parent);
/** /**
* Make a comparator that will sort the nodes. * Make a comparator that will sort the nodes.

View File

@ -59,7 +59,7 @@ import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.corecomponentinterfaces.CoreComponentControl; import org.sleuthkit.autopsy.corecomponentinterfaces.CoreComponentControl;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.ArtifactNodeSelectionInfo; import org.sleuthkit.autopsy.datamodel.ArtifactNodeSelectionInfo;
import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode; import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
@ -669,16 +669,16 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
Node originNode = ((DirectoryTreeFilterNode) treeNode).getOriginal(); Node originNode = ((DirectoryTreeFilterNode) treeNode).getOriginal();
//set node, wrap in filter node first to filter out children //set node, wrap in filter node first to filter out children
Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em); Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em);
// Create a SinlgeLayerTableFilterNode with knowledge of the node's type to allow for column order settings // Create a SingleLayerTableFilterNode with knowledge of the node's type to allow for column order settings
if (FileTypesByMimeType.isEmptyMimeTypeNode(originNode)) { if (FileTypesByMimeType.isEmptyMimeTypeNode(originNode)) {
//Special case for when File Type Identification has not yet been run and //Special case for when File Type Identification has not yet been run and
//there are no mime types to populate Files by Mime Type Tree //there are no mime types to populate Files by Mime Type Tree
EmptyNode emptyNode = new EmptyNode(Bundle.DirectoryTreeTopComponent_emptyMimeNode_text()); EmptyNode emptyNode = new EmptyNode(Bundle.DirectoryTreeTopComponent_emptyMimeNode_text());
dataResult.setNode(new SinlgeLayerTableFilterNode(emptyNode, true, "This Node Is Empty")); //NON-NLS dataResult.setNode(new SingleLayerTableFilterNode(emptyNode, true, "This Node Is Empty")); //NON-NLS
} else if (originNode instanceof DisplayableItemNode) { } else if (originNode instanceof DisplayableItemNode) {
dataResult.setNode(new SinlgeLayerTableFilterNode(drfn, true, ((DisplayableItemNode) originNode).getItemType())); dataResult.setNode(new SingleLayerTableFilterNode(drfn, true, ((DisplayableItemNode) originNode).getItemType()));
} else { } else {
dataResult.setNode(new SinlgeLayerTableFilterNode(drfn, true)); dataResult.setNode(new SingleLayerTableFilterNode(drfn, true));
} }
String displayName = ""; String displayName = "";
Content content = originNode.getLookup().lookup(Content.class); Content content = originNode.getLookup().lookup(Content.class);

View File

@ -40,7 +40,7 @@ import org.openide.windows.TopComponent;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.filesearch.FileSearchFilter.FilterValidationException; import org.sleuthkit.autopsy.filesearch.FileSearchFilter.FilterValidationException;
@ -193,7 +193,7 @@ class FileSearchPanel extends javax.swing.JPanel {
SearchNode sn = new SearchNode(contentList); SearchNode sn = new SearchNode(contentList);
final TopComponent searchResultWin = DataResultTopComponent.createInstance(title, pathText, final TopComponent searchResultWin = DataResultTopComponent.createInstance(title, pathText,
new SinlgeLayerTableFilterNode(sn, true, sn.getName()), contentList.size()); new SingleLayerTableFilterNode(sn, true, sn.getName()), contentList.size());
searchResultWin.requestActive(); // make it the active top component searchResultWin.requestActive(); // make it the active top component

View File

@ -62,7 +62,7 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent;
import org.sleuthkit.autopsy.corecomponents.DataContentPanel; import org.sleuthkit.autopsy.corecomponents.DataContentPanel;
import org.sleuthkit.autopsy.corecomponents.DataResultPanel; import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.coreutils.ThreadConfined;
import org.sleuthkit.autopsy.timeline.actions.Back; import org.sleuthkit.autopsy.timeline.actions.Back;
@ -209,7 +209,7 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer
case DETAIL: case DETAIL:
//make a root node with nodes for the selected events as children and push it to the result viewer. //make a root node with nodes for the selected events as children and push it to the result viewer.
EventRootNode rootNode = new EventRootNode(selectedEventIDs, controller.getEventsModel()); EventRootNode rootNode = new EventRootNode(selectedEventIDs, controller.getEventsModel());
SinlgeLayerTableFilterNode tableFilterNode = new SinlgeLayerTableFilterNode(rootNode, true, "Event"); SingleLayerTableFilterNode tableFilterNode = new SingleLayerTableFilterNode(rootNode, true, "Event");
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
dataResultPanel.setPath(getResultViewerSummaryString()); dataResultPanel.setPath(getResultViewerSummaryString());
dataResultPanel.setNode(tableFilterNode); dataResultPanel.setNode(tableFilterNode);

View File

@ -30,7 +30,7 @@ import org.openide.nodes.Children;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.corecomponents.SinlgeLayerTableFilterNode; import org.sleuthkit.autopsy.corecomponents.SingleLayerTableFilterNode;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
@ -104,7 +104,7 @@ class AdHocSearchDelegator {
final String pathText = NbBundle.getMessage(this.getClass(), "KeywordSearchQueryManager.pathText.text"); final String pathText = NbBundle.getMessage(this.getClass(), "KeywordSearchQueryManager.pathText.text");
DataResultTopComponent.initInstance(pathText, new SinlgeLayerTableFilterNode(rootNode, true, KeywordSearch.class.getName()), DataResultTopComponent.initInstance(pathText, new SingleLayerTableFilterNode(rootNode, true, KeywordSearch.class.getName()),
queryRequests.size(), searchResultWin); queryRequests.size(), searchResultWin);
searchResultWin.requestActive(); searchResultWin.requestActive();

View File

@ -1,5 +1,5 @@
#Updated by build script #Updated by build script
#Mon, 19 Mar 2018 11:17:11 -0700 #Fri, 15 Jun 2018 12:30:02 -0600
LBL_splash_window_title=Starting Autopsy LBL_splash_window_title=Starting Autopsy
SPLASH_HEIGHT=314 SPLASH_HEIGHT=314
SPLASH_WIDTH=538 SPLASH_WIDTH=538
@ -8,4 +8,4 @@ SplashRunningTextBounds=0,289,538,18
SplashRunningTextColor=0x0 SplashRunningTextColor=0x0
SplashRunningTextFontSize=19 SplashRunningTextFontSize=19
currentVersion=Autopsy 4.6.0 currentVersion=Autopsy 4.7.0

View File

@ -1,4 +1,4 @@
#Updated by build script #Updated by build script
#Fri, 09 Mar 2018 13:03:41 -0700 #Fri, 15 Jun 2018 12:30:02 -0600
CTL_MainWindow_Title=Autopsy 4.6.0 CTL_MainWindow_Title=Autopsy 4.7.0
CTL_MainWindow_Title_No_Project=Autopsy 4.6.0 CTL_MainWindow_Title_No_Project=Autopsy 4.7.0