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

View File

@ -27,9 +27,10 @@ import org.openide.util.NbBundle;
* wraps. It is designed to be used for nodes displayed in Autopsy table views.
*/
public class TableFilterNode extends FilterNode {
private final boolean createChildren;
private String itemType;
/**
* Constructs a filter node that creates at most one layer of child nodes
* for the node it wraps. It is designed to be used for nodes displayed in
@ -43,7 +44,13 @@ public class TableFilterNode extends FilterNode {
super(wrappedNode, TableFilterChildren.createInstance(wrappedNode, 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
* of an Autopsy table view.
@ -58,5 +65,8 @@ public class TableFilterNode extends FilterNode {
return super.getDisplayName();
}
}
String getItemType() {
return itemType;
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -147,15 +147,10 @@ public class DeletedContent implements AutopsyVisitableItem {
return s;
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "DeletedContent"; //NON-NLS
// }
@Override
public String getItemType() {
return getClass().getName();
}
}
public static class DeletedContentsChildren extends ChildFactory<DeletedContent.DeletedContentFilter> {
@ -285,16 +280,6 @@ public class DeletedContent implements AutopsyVisitableItem {
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
private class DeletedContentNodeObserver implements Observer {
@ -338,8 +323,17 @@ public class DeletedContent implements AutopsyVisitableItem {
public boolean isLeafTypeNode() {
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> {
private final SleuthkitCase skCase;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -248,15 +248,10 @@ public class KeywordHits implements AutopsyVisitableItem {
return s;
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "KeywordRoot"; //NON-NLS
// }
@Override
public String getItemType() {
return getClass().getName();
}
}
private class ListFactory extends ChildFactory.Detachable<String> implements Observer {
@ -408,15 +403,10 @@ public class KeywordHits implements AutopsyVisitableItem {
updateDisplayName();
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "KeywordList"; //NON-NLS
// }
@Override
public String getItemType() {
return getClass().getName();
}
}
private class TermFactory extends ChildFactory.Detachable<String> implements Observer {
@ -511,15 +501,10 @@ public class KeywordHits implements AutopsyVisitableItem {
return s;
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "KeywordTerm"; //NON-NLS
// }
@Override
public String getItemType() {
return getClass().getName();
}
}
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> {
/*
* 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 {
PARTS {
@ -135,4 +126,10 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
AbstractAbstractFileNode.fillPropertyMap(map, content);
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();
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "LocalFile"; //NON-NLS
// }
@Override
public String getItemType() {
return getClass().getName();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -634,11 +634,11 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
* The following conditional was added to support this
* feature.
*/
// if(originNode instanceof DisplayableItemNode) {
// dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType()));
// } else {
if(originNode instanceof DisplayableItemNode) {
dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType()));
} else {
dataResult.setNode(new TableFilterNode(kffn, true));
// }
}
String displayName = "";
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
}
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "Event";
// }
@Override
public String getItemType() {
return getClass().getName();
}
/**
* We use TimeProperty instead of a normal NodeProperty to correctly display
* the date/time when the user changes the timezone setting.

View File

@ -61,16 +61,11 @@ public class EventRootNode extends DisplayableItemNode {
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.
*/