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) {
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;
}

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.
*/
//TODO rename to CommonFilesSearchNode
final class CommonFilesNode extends AbstractNode {
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.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();

View File

@ -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<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) {
super(fsContent);
}
@Override
protected Sheet createSheet(){
return null; //TODO
}
//ContentTagNode as an example
@Override
public <T> T accept(ContentNodeVisitor<T> 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<AbstractFile> {
}
@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();
}
}