mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Revert "make DataResultFilterChildren into a ChildFactory"
This reverts commit cee2cb8b1f22d82d9a0915fc6790fdce04e30f7e.
This commit is contained in:
parent
b12b061f9f
commit
6fd7c1a9d0
@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.directorytree;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.beans.PropertyVetoException;
|
import java.beans.PropertyVetoException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.prefs.PreferenceChangeEvent;
|
import java.util.prefs.PreferenceChangeEvent;
|
||||||
@ -30,7 +29,6 @@ import javax.swing.AbstractAction;
|
|||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import org.openide.explorer.ExplorerManager;
|
import org.openide.explorer.ExplorerManager;
|
||||||
import org.openide.nodes.AbstractNode;
|
import org.openide.nodes.AbstractNode;
|
||||||
import org.openide.nodes.ChildFactory;
|
|
||||||
import org.openide.nodes.FilterNode;
|
import org.openide.nodes.FilterNode;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
@ -111,7 +109,7 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
* @param em ExplorerManager for component that is creating the node
|
* @param em ExplorerManager for component that is creating the node
|
||||||
*/
|
*/
|
||||||
public DataResultFilterNode(Node node, ExplorerManager em) {
|
public DataResultFilterNode(Node node, ExplorerManager em) {
|
||||||
super(node, Children.create(new DataResultFilterChildren(node, em), true));
|
super(node, new DataResultFilterChildren(node, em));
|
||||||
this.sourceEm = em;
|
this.sourceEm = em;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -121,8 +119,8 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
* @param node Root node to be passed to DataResult viewers
|
* @param node Root node to be passed to DataResult viewers
|
||||||
* @param em ExplorerManager for component that is creating the node
|
* @param em ExplorerManager for component that is creating the node
|
||||||
*/
|
*/
|
||||||
private DataResultFilterNode(Node node, ExplorerManager em, boolean filterKnown, boolean filterSlack) {
|
private DataResultFilterNode(Node node, ExplorerManager em, boolean filterKnown, boolean filterSlack) {
|
||||||
super(node, Children.create(new DataResultFilterChildren(node, em, filterKnown, filterSlack), true));
|
super(node, new DataResultFilterChildren(node, em, filterKnown, filterSlack));
|
||||||
this.sourceEm = em;
|
this.sourceEm = em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,20 +194,18 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
* DataResultFilterNode that created in the DataResultFilterNode.java.
|
* DataResultFilterNode that created in the DataResultFilterNode.java.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static class DataResultFilterChildren extends ChildFactory<Node> {
|
private static class DataResultFilterChildren extends FilterNode.Children {
|
||||||
|
|
||||||
private final ExplorerManager sourceEm;
|
private final ExplorerManager sourceEm;
|
||||||
|
|
||||||
private boolean filterKnown;
|
private boolean filterKnown;
|
||||||
private boolean filterSlack;
|
private boolean filterSlack;
|
||||||
private final Node parent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*/
|
*/
|
||||||
private DataResultFilterChildren(Node arg, ExplorerManager sourceEm) {
|
private DataResultFilterChildren(Node arg, ExplorerManager sourceEm) {
|
||||||
super();
|
super(arg);
|
||||||
this.parent = arg;
|
|
||||||
switch (SelectionContext.getSelectionContext(arg)) {
|
switch (SelectionContext.getSelectionContext(arg)) {
|
||||||
case DATA_SOURCES:
|
case DATA_SOURCES:
|
||||||
filterSlack = filterSlackFromDataSources;
|
filterSlack = filterSlackFromDataSources;
|
||||||
@ -227,33 +223,24 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
this.sourceEm = sourceEm;
|
this.sourceEm = sourceEm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataResultFilterChildren(Node arg, ExplorerManager sourceEm, boolean filterKnown, boolean filterSlack) {
|
private DataResultFilterChildren(Node arg, ExplorerManager sourceEm, boolean filterKnown, boolean filterSlack) {
|
||||||
super();
|
super(arg);
|
||||||
this.parent = arg;
|
|
||||||
this.filterKnown = filterKnown;
|
this.filterKnown = filterKnown;
|
||||||
this.filterSlack = filterSlack;
|
this.filterSlack = filterSlack;
|
||||||
this.sourceEm = sourceEm;
|
this.sourceEm = sourceEm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean createKeys(List<Node> list) {
|
protected Node[] createNodes(Node key) {
|
||||||
list.addAll(Arrays.asList(parent.getChildren().getNodes()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Node[] createNodesForKey(Node key) {
|
|
||||||
AbstractFile file = key.getLookup().lookup(AbstractFile.class);
|
AbstractFile file = key.getLookup().lookup(AbstractFile.class);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
if (filterKnown && (file.getKnown() == TskData.FileKnown.KNOWN)) {
|
if (filterKnown && (file.getKnown() == TskData.FileKnown.KNOWN)) {
|
||||||
// Filter out child nodes that represent known files
|
// Filter out child nodes that represent known files
|
||||||
return null;
|
return new Node[]{};
|
||||||
}
|
}
|
||||||
if (filterSlack && file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)) {
|
if (filterSlack && file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)) {
|
||||||
// Filter out child nodes that represent slack files
|
// Filter out child nodes that represent slack files
|
||||||
return null;
|
return new Node[]{};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Node[]{new DataResultFilterNode(key, sourceEm, filterKnown, filterSlack)};
|
return new Node[]{new DataResultFilterNode(key, sourceEm, filterKnown, filterSlack)};
|
||||||
@ -352,6 +339,7 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
return defaultVisit(fileTypes);
|
return defaultVisit(fileTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Action> defaultVisit(DisplayableItemNode ditem) {
|
protected List<Action> defaultVisit(DisplayableItemNode ditem) {
|
||||||
//preserve the default node's actions
|
//preserve the default node's actions
|
||||||
@ -449,6 +437,8 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
return openChild(fileTypes);
|
return openChild(fileTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell the originating ExplorerManager to display the given
|
* Tell the originating ExplorerManager to display the given
|
||||||
* dataModelNode.
|
* dataModelNode.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user