implement filenode to enable bottom right pane

This commit is contained in:
Brian Sweeney 2018-03-15 12:28:55 -06:00
parent 3b698f10cf
commit d934805234

View File

@ -21,8 +21,6 @@ package org.sleuthkit.autopsy.datamodel;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
@ -30,16 +28,14 @@ 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 AbstractNode { //TODO FileNode public class CommonFileNode extends FileNode {
private final AbstractFile content;
private final int commonFileCount; private final int commonFileCount;
private final String dataSources; private final String dataSources;
public CommonFileNode(AbstractFile fsContent, int commonFileCount, String dataSources) { public CommonFileNode(AbstractFile fsContent, int commonFileCount, String dataSources) {
super(Children.LEAF); super(fsContent);
this.content = fsContent; this.content = fsContent;
this.commonFileCount = commonFileCount; this.commonFileCount = commonFileCount;
this.dataSources = dataSources; this.dataSources = dataSources;
@ -50,7 +46,8 @@ public class CommonFileNode extends AbstractNode { //TODO FileNode
return this.commonFileCount; return this.commonFileCount;
} }
AbstractFile getContent(){ @Override
public AbstractFile getContent(){
return this.content; return this.content;
} }
@ -60,7 +57,7 @@ public class CommonFileNode extends AbstractNode { //TODO FileNode
@Override @Override
protected Sheet createSheet() { protected Sheet createSheet() {
Sheet s = super.createSheet(); Sheet s = new Sheet();
Sheet.Set ss = s.get(Sheet.PROPERTIES); Sheet.Set ss = s.get(Sheet.PROPERTIES);
if (ss == null) { if (ss == null) {
ss = Sheet.createPropertiesSet(); ss = Sheet.createPropertiesSet();
@ -86,7 +83,7 @@ public class CommonFileNode extends AbstractNode { //TODO FileNode
* are put * are put
* @param node The item to get properties for. * @param node The item to get properties for.
*/ */
static public void fillPropertyMap(Map<String, Object> map, CommonFileNode node) { static private void fillPropertyMap(Map<String, Object> map, CommonFileNode node) {
map.put(CommonFilePropertyType.Name.toString(), node.getContent().getName()); map.put(CommonFilePropertyType.Name.toString(), node.getContent().getName());
map.put(CommonFilePropertyType.Id.toString(), node.getContent().getId()); map.put(CommonFilePropertyType.Id.toString(), node.getContent().getId());
map.put(CommonFilePropertyType.InstanceCount.toString(), node.getCommonFileCount()); map.put(CommonFilePropertyType.InstanceCount.toString(), node.getCommonFileCount());