Temp excise of persistent column ordering

This commit is contained in:
Richard Cordovano 2016-01-30 17:50:48 -05:00
parent 5695b05871
commit 266e4ef52a
31 changed files with 521 additions and 290 deletions

View File

@ -30,15 +30,10 @@ 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;
@ -53,10 +48,7 @@ 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
@ -101,52 +93,66 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
// don't show the root node // don't show the root node
ov.getOutline().setRootVisible(false); ov.getOutline().setRootVisible(false);
ov.getOutline().setDragEnabled(false); ov.getOutline().setDragEnabled(false);
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) { * TODO (AUT-1849): Correct or remove peristent column reordering code
// change the order of the column in the array/hashset *
List<Node.Property<?>> props = new ArrayList<>(propertiesAcc); * The following lines of code were added for this feature.
Node.Property<?> prop = props.remove(e.getFromIndex()); */
props.add(e.getToIndex(), prop); // ov.getOutline().getColumnModel().addColumnModelListener(new TableColumnModelListener() {
// @Override
propertiesAcc.clear(); // public void columnAdded(TableColumnModelEvent e) {}
for (int j = 0; j < props.size(); ++j) { // @Override
propertiesAcc.add(props.get(j)); // 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));
// }
// }
// });
/** /**
* Add mouse listener to perform action on double-click * Add mouse listener to perform action on double-click A somewhat hacky
* A somewhat hacky way to perform action even if the column clicked * way to perform action even if the column clicked is not the first
* is not the first one. * one.
*/ */
ov.getOutline().addMouseListener(new MouseListener() { ov.getOutline().addMouseListener(new MouseListener() {
@Override @Override
public void mousePressed(MouseEvent e) {} public void mousePressed(MouseEvent e) {
}
@Override @Override
public void mouseReleased(MouseEvent e) {} public void mouseReleased(MouseEvent e) {
}
@Override @Override
public void mouseEntered(MouseEvent e) {} public void mouseEntered(MouseEvent e) {
}
@Override @Override
public void mouseExited(MouseEvent e) {} public void mouseExited(MouseEvent e) {
}
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if(e.getClickCount() == 2) { if (e.getClickCount() == 2) {
Node[] nodes = DataResultViewerTable.this.em.getSelectedNodes(); Node[] nodes = DataResultViewerTable.this.em.getSelectedNodes();
for(Node node : nodes) { for (Node node : nodes) {
Action action = node.getPreferredAction(); Action action = node.getPreferredAction();
if(action != null) if (action != null) {
action.actionPerformed(null); action.actionPerformed(null);
}
} }
} }
} }
@ -354,12 +360,20 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
if (ov == null) { if (ov == null) {
return; return;
} }
storeState(); /*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* The next three lines of code replaced the three lines of code that
* 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();
DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100);
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
@ -423,7 +437,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
ov.getOutline().getColumnModel().getColumn(colIndex).setPreferredWidth(colWidth); ov.getOutline().getColumnModel().getColumn(colIndex).setPreferredWidth(colWidth);
} }
} }
// if there's no content just auto resize all columns // if there's no content just auto resize all columns
if (content.length <= 0) { if (content.length <= 0) {
// turn on the auto resize // turn on the auto resize
@ -431,65 +445,70 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
} }
} }
} }
/*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* 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(getUniqueColName(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(getUniqueColName(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 // * setting the new ordered values. The reason we copy
* we copy propertiesAcc into it first is to give it the currect size so we can set() in any index. // * propertiesAcc into it first is to give it the currect size so
*/ // * we can set() in any index.
orderedProps.set(value, prop); // */
} // orderedProps.set(value, prop);
} // }
propertiesAcc.clear(); // }
for (Property<?> prop : orderedProps) { // propertiesAcc.clear();
propertiesAcc.add(prop); // for (Property<?> prop : orderedProps) {
} // propertiesAcc.add(prop);
return orderedProps; // }
} // return orderedProps;
// }
// Get unique name for node and it's property. //
private String getUniqueColName(Property<?> prop, String type) { // // Get unique name for node and it's property.
return Case.getCurrentCase().getName() + "." + type + "." // private String getUniqueColName(Property<?> prop, String type) {
+ prop.getName().replaceAll("[^a-zA-Z0-9_]", "") + ".columnOrder"; // return Case.getCurrentCase().getName() + "." + type + "."
} // + 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

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

View File

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

View File

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

View File

@ -56,10 +56,15 @@ 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 /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "DataSources"; //NON-NLS *
} * 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,10 +147,15 @@ public class DeletedContent implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "DeletedContent"; //NON-NLS *
} * 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> {
@ -280,11 +285,16 @@ public class DeletedContent implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering
return "DeletedContentChildren"; //NON-NLS * 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 {
@ -347,7 +357,6 @@ public class DeletedContent implements AutopsyVisitableItem {
private final Observer observer = new DeletedContentChildrenObserver(); private final Observer observer = new DeletedContentChildrenObserver();
// Cause refresh of children if there are changes // Cause refresh of children if there are changes
private class DeletedContentChildrenObserver implements Observer { private class DeletedContentChildrenObserver implements Observer {
@Override @Override

View File

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

View File

@ -40,6 +40,11 @@ public abstract class DisplayableItemNode extends AbstractNode {
public abstract boolean isLeafTypeNode(); public abstract boolean isLeafTypeNode();
public abstract <T> T accept(DisplayableItemNodeVisitor<T> v); public abstract <T> T accept(DisplayableItemNodeVisitor<T> v);
public abstract String getItemType(); /*
* TODO (AUT-1849): Correct or remove peristent column reordering code
*
* Added to support this feature.
*/
// public abstract String getItemType();
} }

View File

@ -191,10 +191,15 @@ public class EmailExtracted implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "EmailExtractedRoot"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "EmailExtractedRoot"; //NON-NLS
// }
} }
/** /**
@ -346,10 +351,15 @@ public class EmailExtracted implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "EmailExtractedAccount"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "EmailExtractedAccount"; //NON-NLS
// }
} }
/** /**
@ -437,10 +447,15 @@ public class EmailExtracted implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "EmailExtractedFolder"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "EmailExtractedFolder"; //NON-NLS
// }
} }
/** /**

View File

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

View File

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

View File

@ -144,10 +144,15 @@ public class FileSize implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "FileSizeRoot"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "FileSizeRoot"; //NON-NLS
// }
} }
/* /*
@ -286,11 +291,16 @@ public class FileSize implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering
return "FileSize"; //NON-NLS * code
} *
* 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,10 +82,15 @@ 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
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "FileType"; //NON-NLS *
} * 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 {

View File

@ -104,16 +104,21 @@ public class FileTypesNode extends DisplayableItemNode {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
if(filter == null) *
return "FileTypes"; //NON-NLS * Added to support this feature.
if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER)) */
return "FileTypesDoc"; //NON-NLS // @Override
if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER)) // public String getItemType() {
return "FileTypesExe"; //NON-NLS // if(filter == null)
return "FileTypes"; //NON-NLS // 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
// }
/** /**
* *

View File

@ -169,10 +169,15 @@ public class HashsetHits implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "HashsetRoot"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "HashsetRoot"; //NON-NLS
// }
} }
/** /**
@ -327,10 +332,15 @@ public class HashsetHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "HashsetName"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "HashsetName"; //NON-NLS
// }
} }
/** /**

View File

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

View File

@ -162,10 +162,15 @@ public class InterestingHits implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "InterestingHitsRoot"; //NON-NLS *
} * 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 {
@ -313,10 +318,15 @@ public class InterestingHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "InterestingHitsSetName"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// 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

@ -73,7 +73,6 @@ public class KeywordHits implements AutopsyVisitableItem {
private final class KeywordResults extends Observable { private final class KeywordResults extends Observable {
// Map from listName/Type to Map of keyword to set of artifact Ids // Map from listName/Type to Map of keyword to set of artifact Ids
private final Map<String, Map<String, Set<Long>>> topLevelMap; private final Map<String, Map<String, Set<Long>>> topLevelMap;
KeywordResults() { KeywordResults() {
@ -240,10 +239,15 @@ public class KeywordHits implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "KeywordRoot"; //NON-NLS *
} * 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 {
@ -395,10 +399,15 @@ public class KeywordHits implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "KeywordList"; //NON-NLS *
} * 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 {
@ -493,10 +502,15 @@ public class KeywordHits implements AutopsyVisitableItem {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "KeywordTerm"; //NON-NLS *
} * 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,11 +38,15 @@ import org.sleuthkit.datamodel.TskData;
*/ */
public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> { public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "LayoutFile"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "LayoutFile"; //NON-NLS
// }
public static enum LayoutContentPropertyType { public static enum LayoutContentPropertyType {
PARTS { PARTS {

View File

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

View File

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

View File

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

View File

@ -89,10 +89,15 @@ public final class Reports implements AutopsyVisitableItem {
return visitor.visit(this); return visitor.visit(this);
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "ReportsList"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "ReportsList"; //NON-NLS
// }
} }
/** /**
@ -214,11 +219,15 @@ public final class Reports implements AutopsyVisitableItem {
return new OpenReportAction(); return new OpenReportAction();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "Reports"; //NON-NLS *
} * 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 DeleteReportAction instance; private static DeleteReportAction instance;

View File

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

View File

@ -109,10 +109,15 @@ public class Tags implements AutopsyVisitableItem {
return propertySheet; return propertySheet;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "TagsRoots"; //NON-NLS *
} * 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 {
@ -271,10 +276,15 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "TagsName"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "TagsName"; //NON-NLS
// }
} }
/** /**
@ -371,10 +381,15 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "TagsContentType"; //NON-NLS *
} * 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 {
@ -469,10 +484,15 @@ public class Tags implements AutopsyVisitableItem {
updateDisplayName(); updateDisplayName();
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "TagsBlackboardArtifact"; //NON-NLS *
} * 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,8 +73,13 @@ public class ViewsNode extends DisplayableItemNode {
return s; return s;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "Views"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "Views"; //NON-NLS
// }
} }

View File

@ -149,8 +149,13 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirect
return result; return result;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "VirtualDirectory"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "VirtualDirectory"; //NON-NLS
// }
} }

View File

@ -74,7 +74,7 @@ public class VolumeNode extends AbstractContentNode<Volume> {
// Listen for case events so that we can detect when case is closed // Listen for case events so that we can detect when case is closed
Case.addPropertyChangeListener(pcl); Case.addPropertyChangeListener(pcl);
} }
private void removeListeners() { private void removeListeners() {
IngestManager.getInstance().removeIngestModuleEventListener(pcl); IngestManager.getInstance().removeIngestModuleEventListener(pcl);
Case.removePropertyChangeListener(pcl); Case.removePropertyChangeListener(pcl);
@ -190,8 +190,13 @@ public class VolumeNode extends AbstractContentNode<Volume> {
return v.visit(this); return v.visit(this);
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "Volume"; //NON-NLS *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "Volume"; //NON-NLS
// }
} }

View File

@ -631,11 +631,18 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
//set node, wrap in filter node first to filter out children //set node, wrap in filter node first to filter out children
Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em); Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em);
Node kffn = new KnownFileFilterNode(drfn, KnownFileFilterNode.getSelectionContext(originNode)); Node kffn = new KnownFileFilterNode(drfn, KnownFileFilterNode.getSelectionContext(originNode));
if(originNode instanceof DisplayableItemNode) { /*
dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType())); * TODO (AUT-1849): Correct or remove peristent column
} else { * reordering code
dataResult.setNode(new TableFilterNode(kffn, true)); *
} * The following conditional was added to support this
* feature.
*/
// if(originNode instanceof DisplayableItemNode) {
// dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType()));
// } else {
dataResult.setNode(new TableFilterNode(kffn, true));
// }
String displayName = ""; String displayName = "";
Content content = originNode.getLookup().lookup(Content.class); Content content = originNode.getLookup().lookup(Content.class);
@ -772,7 +779,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
Node imagesNode = imagesNodeOrig.getNode(); Node imagesNode = imagesNodeOrig.getNode();
DataSourcesNode.DataSourcesNodeChildren contentRootChildren = (DataSourcesNode.DataSourcesNodeChildren) imagesNode.getChildren(); DataSourcesNode.DataSourcesNodeChildren contentRootChildren = (DataSourcesNode.DataSourcesNodeChildren) imagesNode.getChildren();
contentRootChildren.refreshContentKeys(); contentRootChildren.refreshContentKeys();
//final TreeView tree = getTree(); //final TreeView tree = getTree();

View File

@ -121,11 +121,15 @@ class EventNode extends DisplayableItemNode {
throw new UnsupportedOperationException("Not supported yet."); // NON-NLS //To change body of generated methods, choose Tools | Templates. throw new UnsupportedOperationException("Not supported yet."); // NON-NLS //To change body of generated methods, choose Tools | Templates.
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "Event"; *
} * 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

@ -70,10 +70,15 @@ public class EventRootNode extends DisplayableItemNode {
return childCount; return childCount;
} }
@Override /*
public String getItemType() { * TODO (AUT-1849): Correct or remove peristent column reordering code
return "EventRoot"; *
} * Added to support this feature.
*/
// @Override
// public String getItemType() {
// return "EventRoot";
// }
/** /**
* The node factories used to make lists of files to send to the result * The node factories used to make lists of files to send to the result