tweaks based on PR comments

This commit is contained in:
Brian Sweeney 2018-03-13 10:53:41 -06:00
parent 636fd51ae3
commit c0a61d69d9
4 changed files with 21 additions and 14 deletions

View File

@ -40,7 +40,7 @@ final class CommonFilesChildren extends Children.Keys<AbstractFile> {
protected Node[] createNodes(AbstractFile t) { protected Node[] createNodes(AbstractFile t) {
Node[] node = new Node[1]; 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()); node[0] = new DataResultFilterNode(new FileNode(t, false), DirectoryTreeTopComponent.findInstance().getExplorerManager());
return node; return node;
} }

View File

@ -26,6 +26,7 @@ import org.sleuthkit.datamodel.AbstractFile;
/** /**
* Encapsulates data used to display common files search results in the top right pane. * Encapsulates data used to display common files search results in the top right pane.
*/ */
//TODO rename to CommonFilesSearchNode
final class CommonFilesNode extends AbstractNode { final class CommonFilesNode extends AbstractNode {
private CommonFilesChildren children; private CommonFilesChildren children;

View File

@ -74,7 +74,8 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
"CommonFilesPanel.search.results.pathText=Common Files Search Results\\:", "CommonFilesPanel.search.results.pathText=Common Files Search Results\\:",
"CommonFilesPanel.search.done.tskCoreException=Unable to run query against DB.", "CommonFilesPanel.search.done.tskCoreException=Unable to run query against DB.",
"CommonFilesPanel.search.done.noCurrentCaseException=Unable to open case file.", "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() { private void search() {
String title = Bundle.CommonFilesPanel_search_results_title(); String title = Bundle.CommonFilesPanel_search_results_title();
@ -116,10 +117,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
LOGGER.log(Level.SEVERE, "Interrupted while loading Common Files", ex); LOGGER.log(Level.SEVERE, "Interrupted while loading Common Files", ex);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), MessageNotifyUtil.Message.error(Bundle.CommonFilesPanel_search_done_interupted());
ex.getCause().getMessage(),
"Some went wrong finding common files.",
JOptionPane.ERROR_MESSAGE);
} catch (ExecutionException ex) { } catch (ExecutionException ex) {
String errorMessage; String errorMessage;
Throwable inner = ex.getCause(); Throwable inner = ex.getCause();

View File

@ -18,17 +18,26 @@
*/ */
package org.sleuthkit.autopsy.datamodel; package org.sleuthkit.autopsy.datamodel;
import org.openide.nodes.Sheet;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
/** /**
* Encapsulates data being pushed to Common Files component in top right pane. * Encapsulates data being pushed to Common Files component in top right pane.
*/ */
public class CommonFileNode extends AbstractFsContentNode<AbstractFile> { //TODO maybe we dont need abstractfscontentnode (just abstractnode) //public class CommonFileNode extends AbstractFsContentNode<AbstractFile> {
public class CommonFileNode extends AbstractNode {
//TODO goto AbstractNode rather than AbstractFsContentNode<T>...
public CommonFileNode(AbstractFile fsContent) { public CommonFileNode(AbstractFile fsContent) {
super(fsContent); super(fsContent);
} }
@Override
protected Sheet createSheet(){
return null; //TODO
}
//ContentTagNode as an example
@Override @Override
public <T> T accept(ContentNodeVisitor<T> v) { public <T> T accept(ContentNodeVisitor<T> v) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
@ -40,13 +49,12 @@ public class CommonFileNode extends AbstractFsContentNode<AbstractFile> {
} }
@Override @Override
public boolean isLeafTypeNode() { public boolean isLeafTypeNode() {//TODO return true
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. return true;
} }
@Override @Override
public String getItemType() { public String getItemType() {//TODO getClass.getCanonicalName
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. return this.getClass().getCanonicalName();
} }
} }