Finished implementing getTypeName for instances of DisplayableItemNode

This commit is contained in:
Sophie Mori 2016-09-22 13:38:00 -04:00
parent 7c2e8a91c9
commit db7ab2dd14
32 changed files with 331 additions and 479 deletions

View File

@ -30,10 +30,15 @@ import java.util.ArrayList;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.logging.Level;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.TableColumnModelEvent;
import javax.swing.event.TableColumnModelListener;
import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.DefaultOutlineModel;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView; import org.openide.explorer.view.OutlineView;
@ -48,7 +53,10 @@ import org.openide.nodes.NodeMemberEvent;
import org.openide.nodes.NodeReorderEvent; import org.openide.nodes.NodeReorderEvent;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.NbPreferences;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
* DataResult sortable table viewer * DataResult sortable table viewer
@ -60,6 +68,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
public class DataResultViewerTable extends AbstractDataResultViewer { public class DataResultViewerTable extends AbstractDataResultViewer {
private String firstColumnLabel = NbBundle.getMessage(DataResultViewerTable.class, "DataResultViewerTable.firstColLbl"); private String firstColumnLabel = NbBundle.getMessage(DataResultViewerTable.class, "DataResultViewerTable.firstColLbl");
// This is a set because we add properties of up to 100 child nodes, and we want unique properties
private Set<Property<?>> propertiesAcc = new LinkedHashSet<>(); private Set<Property<?>> propertiesAcc = new LinkedHashSet<>();
private final DummyNodeListener dummyNodeListener = new DummyNodeListener(); private final DummyNodeListener dummyNodeListener = new DummyNodeListener();
private static final String DUMMY_NODE_DISPLAY_NAME = NbBundle.getMessage(DataResultViewerTable.class, "DataResultViewerTable.dummyNodeDisplayName"); private static final String DUMMY_NODE_DISPLAY_NAME = NbBundle.getMessage(DataResultViewerTable.class, "DataResultViewerTable.dummyNodeDisplayName");
@ -99,29 +108,32 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
* *
* The following lines of code were added for this feature. * The following lines of code were added for this feature.
*/ */
// ov.getOutline().getColumnModel().addColumnModelListener(new TableColumnModelListener() { ov.getOutline().getColumnModel().addColumnModelListener(new TableColumnModelListener() {
// @Override @Override
// public void columnAdded(TableColumnModelEvent e) {} public void columnAdded(TableColumnModelEvent e) {}
// @Override @Override
// public void columnRemoved(TableColumnModelEvent e) {} public void columnRemoved(TableColumnModelEvent e) {}
// @Override @Override
// public void columnMarginChanged(ChangeEvent e) {} public void columnMarginChanged(ChangeEvent e) {}
// @Override @Override
// public void columnSelectionChanged(ListSelectionEvent e) {} public void columnSelectionChanged(ListSelectionEvent e) {}
// @Override
// @Override public void columnMoved(TableColumnModelEvent e) {
// public void columnMoved(TableColumnModelEvent e) { if (e.getFromIndex() == 0) {
// // change the order of the column in the array/hashset return;
// List<Node.Property<?>> props = new ArrayList<>(propertiesAcc); }
// Node.Property<?> prop = props.remove(e.getFromIndex()); // change the order of the column in the array/hashset
// props.add(e.getToIndex(), prop); List<Node.Property<?>> props = new ArrayList<>(propertiesAcc);
// Node.Property<?> prop = props.remove(e.getFromIndex());
// propertiesAcc.clear(); props.add(e.getToIndex(), prop);
// for (int j = 0; j < props.size(); ++j) {
// propertiesAcc.add(props.get(j)); propertiesAcc.clear();
// } for (int j = 0; j < props.size(); ++j) {
// } propertiesAcc.add(props.get(j));
// }); }
storeState();
}
});
} }
/** /**
@ -332,13 +344,12 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
* The next three lines of code replaced the three lines of code that * The next three lines of code replaced the three lines of code that
* follow * follow
*/ */
// storeState();
//set the new root as current //set the new root as current
// currentRoot = root; currentRoot = root;
// List<Node.Property<?>> props = loadState(); List<Node.Property<?>> props = loadState();
propertiesAcc.clear(); // propertiesAcc.clear();
DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100); // DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100);
List<Node.Property<?>> props = new ArrayList<>(propertiesAcc); // List<Node.Property<?>> props = new ArrayList<>(propertiesAcc);
/* /*
* OutlineView makes the first column be the result of * OutlineView makes the first column be the result of
@ -417,63 +428,63 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
* The following three methods were added for this feature * The following three methods were added for this feature
*/ */
// Store the state of current root Node. // Store the state of current root Node.
// private void storeState() { private void storeState() {
// if(currentRoot == null || propertiesAcc.isEmpty()) if(currentRoot == null || propertiesAcc.isEmpty())
// return; return;
//
// TableFilterNode tfn; TableFilterNode tfn;
// if(currentRoot instanceof TableFilterNode) if(currentRoot instanceof TableFilterNode)
// tfn = (TableFilterNode) currentRoot; tfn = (TableFilterNode) currentRoot;
// else else
// return; return;
//
// List<Node.Property<?>> props = new ArrayList<>(propertiesAcc); List<Node.Property<?>> props = new ArrayList<>(propertiesAcc);
// for (int i = 0; i < props.size(); i++) { for (int i = 0; i < props.size(); i++) {
// Property<?> prop = props.get(i); Property<?> prop = props.get(i);
// NbPreferences.forModule(this.getClass()).put(getUniqueColName(prop, tfn.getItemType()), String.valueOf(i)); NbPreferences.forModule(this.getClass()).put(getPreferenceKey(prop, tfn.getItemType()), String.valueOf(i));
// } }
// } }
//Load the state of current root Node if exists. //Load the state of current root Node if exists.
// private List<Node.Property<?>> loadState() { private List<Node.Property<?>> loadState() {
// propertiesAcc.clear(); propertiesAcc.clear();
// this.getAllChildPropertyHeadersRec(currentRoot, 100); this.getAllChildPropertyHeadersRec(currentRoot, 100);
// List<Node.Property<?>> props = new ArrayList<>(propertiesAcc); List<Node.Property<?>> props = new ArrayList<>(propertiesAcc);
//
// // If node is not table filter node, use default order for columns // If node is not table filter node, use default order for columns
// TableFilterNode tfn; TableFilterNode tfn;
// if (currentRoot instanceof TableFilterNode) { if (currentRoot instanceof TableFilterNode) {
// tfn = (TableFilterNode) currentRoot; tfn = (TableFilterNode) currentRoot;
// } else { } else {
// Logger.getLogger(DataResultViewerTable.class.getName()).log(Level.INFO, Logger.getLogger(DataResultViewerTable.class.getName()).log(Level.INFO,
// "Node {0} is not TableFilterNode, columns are going to be in default order", currentRoot.getName()); "Node {0} is not TableFilterNode, columns are going to be in default order", currentRoot.getName());
// return props; return props;
// } }
//
// List<Node.Property<?>> orderedProps = new ArrayList<>(propertiesAcc); List<Node.Property<?>> orderedProps = new ArrayList<>(propertiesAcc);
// for (Property<?> prop : props) { for (Property<?> prop : props) {
// Integer value = Integer.valueOf(NbPreferences.forModule(this.getClass()).get(getUniqueColName(prop, tfn.getItemType()), "-1")); Integer value = Integer.valueOf(NbPreferences.forModule(this.getClass()).get(getPreferenceKey(prop, tfn.getItemType()), "-1"));
// if (value >= 0) { if (value >= 0) {
// /** /**
// * The original contents of orderedProps do not matter when * The original contents of orderedProps do not matter when
// * setting the new ordered values. The reason we copy * setting the new ordered values. The reason we copy
// * propertiesAcc into it first is to give it the currect size so * propertiesAcc into it first is to give it the currect size so
// * we can set() in any index. * we can set() in any index.
// */ */
// orderedProps.set(value, prop); orderedProps.set(value, prop);
// } }
// } }
// propertiesAcc.clear(); propertiesAcc.clear();
// for (Property<?> prop : orderedProps) { for (Property<?> prop : orderedProps) {
// propertiesAcc.add(prop); propertiesAcc.add(prop);
// } }
// return orderedProps; return orderedProps;
// } }
//
// // Get unique name for node and it's property. // Get unique name for node and its property.
// private String getUniqueColName(Property<?> prop, String type) { private String getPreferenceKey(Property<?> prop, String type) {
// return Case.getCurrentCase().getName() + "." + type + "." return type.replaceAll("[^a-zA-Z0-9_]", "") + "." +
// + prop.getName().replaceAll("[^a-zA-Z0-9_]", "") + ".columnOrder"; prop.getName().replaceAll("[^a-zA-Z0-9_]", "") + ".columnOrder";
// } }
// Populate a two-dimensional array with rows of property values for up // Populate a two-dimensional array with rows of property values for up
// to maxRows children of the node passed in. // to maxRows children of the node passed in.

View File

@ -29,6 +29,7 @@ import org.openide.util.NbBundle;
public class TableFilterNode extends FilterNode { public class TableFilterNode extends FilterNode {
private final boolean createChildren; private final boolean createChildren;
private String itemType;
/** /**
* Constructs a filter node that creates at most one layer of child nodes * Constructs a filter node that creates at most one layer of child nodes
@ -44,6 +45,12 @@ public class TableFilterNode extends FilterNode {
this.createChildren = createChildren; this.createChildren = createChildren;
} }
public TableFilterNode(Node wrappedNode, boolean createChildren, String itemType) {
super(wrappedNode, TableFilterChildren.createInstance(wrappedNode, createChildren));
this.createChildren = createChildren;
this.itemType = itemType;
}
/** /**
* Returns a display name for the wrapped node, for use in the first column * Returns a display name for the wrapped node, for use in the first column
* of an Autopsy table view. * of an Autopsy table view.
@ -59,4 +66,7 @@ public class TableFilterNode extends FilterNode {
} }
} }
String getItemType() {
return itemType;
}
} }

View File

@ -456,13 +456,8 @@ public class BlackboardArtifactNode extends DisplayableItemNode {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "BlackboardArtifact"; //NON-NLS
// }
} }

View File

@ -145,13 +145,8 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "BlackboardArtifactTag"; //NON-NLS
// }
} }

View File

@ -130,13 +130,8 @@ class ContentTagNode extends DisplayableItemNode {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "ContentTag"; //NON-NLS
// }
} }

View File

@ -56,15 +56,10 @@ public class DataSourcesNode extends DisplayableItemNode {
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); //NON-NLS this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); //NON-NLS
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "DataSources"; //NON-NLS
// }
/* /*
* Custom Keys implementation that listens for new data sources being added. * Custom Keys implementation that listens for new data sources being added.

View File

@ -147,15 +147,10 @@ public class DeletedContent implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "DeletedContent"; //NON-NLS
// }
} }
public static class DeletedContentsChildren extends ChildFactory<DeletedContent.DeletedContentFilter> { public static class DeletedContentsChildren extends ChildFactory<DeletedContent.DeletedContentFilter> {
@ -285,16 +280,6 @@ public class DeletedContent implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/*
* TODO (AUT-1849): Correct or remove peristent column reordering
* code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "DeletedContentChildren"; //NON-NLS
// }
// update the display name when new events are fired // update the display name when new events are fired
private class DeletedContentNodeObserver implements Observer { private class DeletedContentNodeObserver implements Observer {
@ -338,6 +323,15 @@ public class DeletedContent implements AutopsyVisitableItem {
public boolean isLeafTypeNode() { public boolean isLeafTypeNode() {
return true; return true;
} }
@Override
public String getItemType() {
/**
* Return getClass().getName() + filter.getName() if custom
* settings are desired for different filters.
*/
return getClass().getName();
}
} }
static class DeletedContentChildren extends ChildFactory.Detachable<AbstractFile> { static class DeletedContentChildren extends ChildFactory.Detachable<AbstractFile> {

View File

@ -105,13 +105,8 @@ public class DirectoryNode extends AbstractFsContentNode<AbstractFile> {
return false; return false;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Directory"; //NON-NLS
// }
} }

View File

@ -50,7 +50,7 @@ public abstract class DisplayableItemNode extends AbstractNode {
* *
* Added to support this feature. * Added to support this feature.
*/ */
// public abstract String getItemType(); public abstract String getItemType();
/** /**
* this code started as a cut and past of * this code started as a cut and past of
* DataResultFilterNode.GetPopupActionsDisplayableItemNodeVisitor.findLinked(BlackboardArtifactNode * DataResultFilterNode.GetPopupActionsDisplayableItemNodeVisitor.findLinked(BlackboardArtifactNode

View File

@ -204,15 +204,10 @@ public class EmailExtracted implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "EmailExtractedRoot"; //NON-NLS
// }
} }
/** /**
@ -364,15 +359,10 @@ public class EmailExtracted implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "EmailExtractedAccount"; //NON-NLS
// }
} }
/** /**
@ -460,15 +450,10 @@ public class EmailExtracted implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "EmailExtractedFolder"; //NON-NLS
// }
} }
/** /**

View File

@ -183,15 +183,10 @@ public class ExtractedContent implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "ExtractedContentRoot"; //NON-NLS
// }
} }
/** /**
@ -393,15 +388,10 @@ public class ExtractedContent implements AutopsyVisitableItem {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName() + type.getDisplayName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return type.getDisplayName();
// }
} }
/** /**

View File

@ -170,13 +170,8 @@ public class FileNode extends AbstractFsContentNode<AbstractFile> {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "File"; //NON-NLS
// }
} }

View File

@ -144,15 +144,10 @@ public class FileSize implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "FileSizeRoot"; //NON-NLS
// }
} }
/* /*
@ -291,16 +286,11 @@ public class FileSize implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering public String getItemType() {
* code return getClass().getName();
* }
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "FileSize"; //NON-NLS
// }
// update the display name when new events are fired // update the display name when new events are fired
private class FileSizeNodeObserver implements Observer { private class FileSizeNodeObserver implements Observer {

View File

@ -82,16 +82,6 @@ public class FileTypeNode extends DisplayableItemNode {
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-filter-icon.png"); //NON-NLS this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-filter-icon.png"); //NON-NLS
} }
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "FileType"; //NON-NLS
// }
// update the display name when new events are fired // update the display name when new events are fired
private class FileTypeNodeObserver implements Observer { private class FileTypeNodeObserver implements Observer {
@ -142,6 +132,16 @@ public class FileTypeNode extends DisplayableItemNode {
return true; return true;
} }
/**
* Consider allowing different configurations for Images, Videos, etc
* (in which case we'd return getClass().getName() + filter.getName()
* for all filters).
*/
@Override
public String getItemType() {
return getClass().getName();
}
/** /**
* Child node factory for a specific file type - does the database query. * Child node factory for a specific file type - does the database query.
*/ */

View File

@ -104,21 +104,19 @@ public class FileTypesNode extends DisplayableItemNode {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* /**
* Added to support this feature. * Because Documents and Executable are further expandable, their
* column order settings should be stored separately.
*/ */
// @Override if(filter == null)
// public String getItemType() { return getClass().getName();
// if(filter == null) if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER) ||
// return "FileTypes"; //NON-NLS filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER))
// if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER)) return getClass().getName() + filter.getName();
// return "FileTypesDoc"; //NON-NLS return getClass().getName();
// if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER)) }
// return "FileTypesExe"; //NON-NLS
// return "FileTypes"; //NON-NLS
// }
/** /**
* *

View File

@ -178,15 +178,10 @@ public class HashsetHits implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "HashsetRoot"; //NON-NLS
// }
} }
/** /**
@ -341,15 +336,14 @@ public class HashsetHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* /**
* Added to support this feature. * For custom settings for each hash set, return
* getClass().getName() + hashSetName instead.
*/ */
// @Override return getClass().getName();
// public String getItemType() { }
// return "HashsetName"; //NON-NLS
// }
} }
/** /**

View File

@ -195,13 +195,8 @@ public class ImageNode extends AbstractContentNode<Image> {
return v.visit(this); return v.visit(this);
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Image"; //NON-NLS
// }
} }

View File

@ -172,15 +172,10 @@ public class InterestingHits implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "InterestingHitsRoot"; //NON-NLS
// }
} }
private class SetNameFactory extends ChildFactory.Detachable<String> implements Observer { private class SetNameFactory extends ChildFactory.Detachable<String> implements Observer {
@ -328,15 +323,14 @@ public class InterestingHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* /**
* Added to support this feature. * For custom settings for each rule set, return
* getClass().getName() + setName instead.
*/ */
// @Override return getClass().getName();
// public String getItemType() { }
// return "InterestingHitsSetName"; //NON-NLS
// }
} }
private class HitFactory extends ChildFactory<Long> implements Observer { private class HitFactory extends ChildFactory<Long> implements Observer {

View File

@ -248,15 +248,10 @@ public class KeywordHits implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "KeywordRoot"; //NON-NLS
// }
} }
private class ListFactory extends ChildFactory.Detachable<String> implements Observer { private class ListFactory extends ChildFactory.Detachable<String> implements Observer {
@ -408,15 +403,10 @@ public class KeywordHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "KeywordList"; //NON-NLS
// }
} }
private class TermFactory extends ChildFactory.Detachable<String> implements Observer { private class TermFactory extends ChildFactory.Detachable<String> implements Observer {
@ -511,15 +501,10 @@ public class KeywordHits implements AutopsyVisitableItem {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "KeywordTerm"; //NON-NLS
// }
} }
public class HitsFactory extends ChildFactory.Detachable<Long> implements Observer { public class HitsFactory extends ChildFactory.Detachable<Long> implements Observer {

View File

@ -38,15 +38,6 @@ import org.sleuthkit.datamodel.TskData;
*/ */
public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> { public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "LayoutFile"; //NON-NLS
// }
public static enum LayoutContentPropertyType { public static enum LayoutContentPropertyType {
PARTS { PARTS {
@ -135,4 +126,10 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
AbstractAbstractFileNode.fillPropertyMap(map, content); AbstractAbstractFileNode.fillPropertyMap(map, content);
map.put(LayoutContentPropertyType.PARTS.toString(), content.getNumParts()); map.put(LayoutContentPropertyType.PARTS.toString(), content.getNumParts());
} }
@Override
public String getItemType() {
return getClass().getName();
}
} }

View File

@ -119,13 +119,8 @@ public class LocalFileNode extends AbstractAbstractFileNode<AbstractFile> {
return true; //!this.hasContentChildren(); return true; //!this.hasContentChildren();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "LocalFile"; //NON-NLS
// }
} }

View File

@ -83,13 +83,12 @@ public class RecentFilesFilterNode extends DisplayableItemNode {
return true; return true;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* if (filter == null) {
* Added to support this feature. return getClass().getName();
*/ } else {
// @Override return getClass().getName() + filter.getName();
// public String getItemType() { }
// return "RecentFilesFilter"; //NON-NLS }
// }
} }

View File

@ -66,13 +66,8 @@ public class RecentFilesNode extends DisplayableItemNode {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "RecentFiles"; //NON-NLS
// }
} }

View File

@ -90,15 +90,10 @@ public final class Reports implements AutopsyVisitableItem {
return visitor.visit(this); return visitor.visit(this);
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "ReportsList"; //NON-NLS
// }
} }
/** /**
@ -218,15 +213,11 @@ public final class Reports implements AutopsyVisitableItem {
return new OpenReportAction(); return new OpenReportAction();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Reports"; //NON-NLS
// }
private static class DeleteReportAction extends AbstractAction { private static class DeleteReportAction extends AbstractAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -69,13 +69,8 @@ public class ResultsNode extends DisplayableItemNode {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Results"; //NON-NLS
// }
} }

View File

@ -105,19 +105,15 @@ public class Tags implements AutopsyVisitableItem {
properties = Sheet.createPropertiesSet(); properties = Sheet.createPropertiesSet();
propertySheet.put(properties); propertySheet.put(properties);
} }
properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "TagsNode.createSheet.name.name"), NbBundle.getMessage(this.getClass(), "TagsNode.createSheet.name.displayName"), "", getName())); properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "TagsNode.createSheet.name.name"),
NbBundle.getMessage(this.getClass(), "TagsNode.createSheet.name.displayName"), "", getName()));
return propertySheet; return propertySheet;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "TagsRoots"; //NON-NLS
// }
} }
private class TagNameNodeFactory extends ChildFactory.Detachable<TagName> implements Observer { private class TagNameNodeFactory extends ChildFactory.Detachable<TagName> implements Observer {
@ -255,7 +251,8 @@ public class Tags implements AutopsyVisitableItem {
properties = Sheet.createPropertiesSet(); properties = Sheet.createPropertiesSet();
propertySheet.put(properties); propertySheet.put(properties);
} }
properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "TagNameNode.createSheet.name.name"), NbBundle.getMessage(this.getClass(), "TagNameNode.createSheet.name.displayName"), tagName.getDescription(), getName())); properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "TagNameNode.createSheet.name.name"),
NbBundle.getMessage(this.getClass(), "TagNameNode.createSheet.name.displayName"), tagName.getDescription(), getName()));
return propertySheet; return propertySheet;
} }
@ -276,15 +273,10 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "TagsName"; //NON-NLS
// }
} }
/** /**
@ -362,7 +354,8 @@ public class Tags implements AutopsyVisitableItem {
properties = Sheet.createPropertiesSet(); properties = Sheet.createPropertiesSet();
propertySheet.put(properties); propertySheet.put(properties);
} }
properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagTypeNode.createSheet.name.name"), NbBundle.getMessage(this.getClass(), "ContentTagTypeNode.createSheet.name.displayName"), "", getName())); properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagTypeNode.createSheet.name.name"),
NbBundle.getMessage(this.getClass(), "ContentTagTypeNode.createSheet.name.displayName"), "", getName()));
return propertySheet; return propertySheet;
} }
@ -381,15 +374,10 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "TagsContentType"; //NON-NLS
// }
} }
private class ContentTagNodeFactory extends ChildFactory<ContentTag> implements Observer { private class ContentTagNodeFactory extends ChildFactory<ContentTag> implements Observer {
@ -465,7 +453,8 @@ public class Tags implements AutopsyVisitableItem {
properties = Sheet.createPropertiesSet(); properties = Sheet.createPropertiesSet();
propertySheet.put(properties); propertySheet.put(properties);
} }
properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagTypeNode.createSheet.name.name"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagTypeNode.createSheet.name.displayName"), "", getName())); properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagTypeNode.createSheet.name.name"),
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagTypeNode.createSheet.name.displayName"), "", getName()));
return propertySheet; return propertySheet;
} }
@ -484,15 +473,10 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "TagsBlackboardArtifact"; //NON-NLS
// }
} }
private class BlackboardArtifactTagNodeFactory extends ChildFactory<BlackboardArtifactTag> implements Observer { private class BlackboardArtifactTagNodeFactory extends ChildFactory<BlackboardArtifactTag> implements Observer {

View File

@ -73,13 +73,8 @@ public class ViewsNode extends DisplayableItemNode {
return s; return s;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Views"; //NON-NLS
// }
} }

View File

@ -224,13 +224,12 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirect
return result; return result;
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* if (!(this.content.isDataSource())) {
* Added to support this feature. return getClass().getName() + "NotDataSource"; //NON-NLS
*/ } else {
// @Override return getClass().getName() + "DataSource"; //NON-NLS
// public String getItemType() { }
// return "VirtualDirectory"; //NON-NLS }
// }
} }

View File

@ -194,13 +194,8 @@ public class VolumeNode extends AbstractContentNode<Volume> {
return v.visit(this); return v.visit(this);
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Volume"; //NON-NLS
// }
} }

View File

@ -634,11 +634,11 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
* The following conditional was added to support this * The following conditional was added to support this
* feature. * feature.
*/ */
// if(originNode instanceof DisplayableItemNode) { if(originNode instanceof DisplayableItemNode) {
// dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType())); dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType()));
// } else { } else {
dataResult.setNode(new TableFilterNode(kffn, true)); dataResult.setNode(new TableFilterNode(kffn, true));
// } }
String displayName = ""; String displayName = "";
Content content = originNode.getLookup().lookup(Content.class); Content content = originNode.getLookup().lookup(Content.class);

View File

@ -160,15 +160,11 @@ public class EventNode extends DisplayableItemNode {
throw new UnsupportedOperationException("Not supported yet."); // NON-NLS throw new UnsupportedOperationException("Not supported yet."); // NON-NLS
} }
/* @Override
* TODO (AUT-1849): Correct or remove peristent column reordering code public String getItemType() {
* return getClass().getName();
* Added to support this feature. }
*/
// @Override
// public String getItemType() {
// return "Event";
// }
/** /**
* We use TimeProperty instead of a normal NodeProperty to correctly display * We use TimeProperty instead of a normal NodeProperty to correctly display
* the date/time when the user changes the timezone setting. * the date/time when the user changes the timezone setting.

View File

@ -61,16 +61,11 @@ public class EventRootNode extends DisplayableItemNode {
return null; return null;
} }
@Override
public String getItemType() {
return getClass().getName();
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "EventRoot";
// }
/** /**
* ChildFactory for EventNodes. * ChildFactory for EventNodes.
*/ */