From c0a61d69d918bb0af24c856d39ebd77e055cd052 Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Tue, 13 Mar 2018 10:53:41 -0600 Subject: [PATCH] tweaks based on PR comments --- .../commonfilesearch/CommonFilesChildren.java | 2 +- .../commonfilesearch/CommonFilesNode.java | 1 + .../commonfilesearch/CommonFilesPanel.java | 8 +++---- .../autopsy/datamodel/CommonFileNode.java | 24 ++++++++++++------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesChildren.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesChildren.java index e18f9b917d..8a1ceff39c 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesChildren.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesChildren.java @@ -40,7 +40,7 @@ final class CommonFilesChildren extends Children.Keys { protected Node[] createNodes(AbstractFile t) { Node[] node = new Node[1]; - //TODO replace FileNode with our own subclass of its base type or similar + //TODO replace FileNode with our own subclass of its base type or similar (use CommonFileNode once its finished) node[0] = new DataResultFilterNode(new FileNode(t, false), DirectoryTreeTopComponent.findInstance().getExplorerManager()); return node; } diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesNode.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesNode.java index d12358a287..87fa192771 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesNode.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesNode.java @@ -26,6 +26,7 @@ import org.sleuthkit.datamodel.AbstractFile; /** * Encapsulates data used to display common files search results in the top right pane. */ +//TODO rename to CommonFilesSearchNode final class CommonFilesNode extends AbstractNode { private CommonFilesChildren children; diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index 9c0c01e8f2..28986f69da 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -74,7 +74,8 @@ public final class CommonFilesPanel extends javax.swing.JPanel { "CommonFilesPanel.search.results.pathText=Common Files Search Results\\:", "CommonFilesPanel.search.done.tskCoreException=Unable to run query against DB.", "CommonFilesPanel.search.done.noCurrentCaseException=Unable to open case file.", - "CommonFilesPanel.search.done.exception=Unexpected exception running Common Files Search."}) + "CommonFilesPanel.search.done.exception=Unexpected exception running Common Files Search.", + "CommonFilesPanel.search.done.interupted=Something went wrong finding common files."}) private void search() { String title = Bundle.CommonFilesPanel_search_results_title(); @@ -116,10 +117,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel { } catch (InterruptedException ex) { LOGGER.log(Level.SEVERE, "Interrupted while loading Common Files", ex); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), - ex.getCause().getMessage(), - "Some went wrong finding common files.", - JOptionPane.ERROR_MESSAGE); + MessageNotifyUtil.Message.error(Bundle.CommonFilesPanel_search_done_interupted()); } catch (ExecutionException ex) { String errorMessage; Throwable inner = ex.getCause(); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/CommonFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/CommonFileNode.java index 1fc3d8722a..bb7966ef0e 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/CommonFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/CommonFileNode.java @@ -18,17 +18,26 @@ */ package org.sleuthkit.autopsy.datamodel; +import org.openide.nodes.Sheet; import org.sleuthkit.datamodel.AbstractFile; /** * Encapsulates data being pushed to Common Files component in top right pane. */ -public class CommonFileNode extends AbstractFsContentNode { //TODO maybe we dont need abstractfscontentnode (just abstractnode) - +//public class CommonFileNode extends AbstractFsContentNode { +public class CommonFileNode extends AbstractNode { + //TODO goto AbstractNode rather than AbstractFsContentNode... + public CommonFileNode(AbstractFile fsContent) { super(fsContent); } + @Override + protected Sheet createSheet(){ + return null; //TODO + } + + //ContentTagNode as an example @Override public T accept(ContentNodeVisitor v) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. @@ -40,13 +49,12 @@ public class CommonFileNode extends AbstractFsContentNode { } @Override - public boolean isLeafTypeNode() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + public boolean isLeafTypeNode() {//TODO return true + return true; } @Override - public String getItemType() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - + public String getItemType() {//TODO getClass.getCanonicalName + return this.getClass().getCanonicalName(); + } }