19 package org.sleuthkit.autopsy.keywordsearch;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collection;
24 import java.util.HashSet;
25 import java.util.List;
26 import javax.swing.Action;
27 import org.openide.nodes.FilterNode;
28 import org.openide.nodes.Node;
29 import org.openide.nodes.Node.Property;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
32 import org.openide.util.Utilities;
33 import org.openide.util.lookup.ProxyLookup;
57 class AdHocSearchFilterNode
extends FilterNode {
64 AdHocSearchFilterNode(Node original) {
65 super(original, null,
new ProxyLookup(original.getLookup()));
69 public Node.PropertySet[] getPropertySets() {
70 Node.PropertySet[] propertySets = super.getPropertySets();
72 for (
int i = 0; i < propertySets.length; i++) {
73 Node.PropertySet ps = propertySets[i];
75 if (ps.getName().equals(Sheet.PROPERTIES)) {
76 Sheet.Set newPs =
new Sheet.Set();
77 newPs.setName(ps.getName());
78 newPs.setDisplayName(ps.getDisplayName());
79 newPs.setShortDescription(ps.getShortDescription());
81 Property<?>[] oldProperties = ps.getProperties();
84 for (Property<?> p : oldProperties) {
88 propertySets[i] = newPs;
104 public Action[] getActions(
boolean popup) {
106 List<Action> actions =
new ArrayList<>();
107 actions.addAll(Arrays.asList(super.getActions(popup)));
108 Content content = this.getOriginal().getLookup().lookup(Content.class);
109 actions.addAll(content.accept(
new GetPopupActionsContentVisitor()));
111 return actions.toArray(
new Action[actions.size()]);
117 public List<Action>
visit(Report r) {
118 List<Action> actionsList =
new ArrayList<>();
119 actionsList.add(
new NewWindowViewAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.viewInNewWinActionLbl"), AdHocSearchFilterNode.this));
131 public List<Action>
visit(DerivedFile f) {
136 public List<Action>
visit(Directory d) {
141 public List<Action>
visit(LayoutFile lf) {
146 public List<Action>
visit(LocalFile lf) {
151 public List<Action>
visit(SlackFile f) {
156 public List<Action>
visit(VirtualDirectory dir) {
161 List<Action> actionsList =
new ArrayList<>();
162 actionsList.add(
new NewWindowViewAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.viewInNewWinActionLbl"), AdHocSearchFilterNode.this));
163 actionsList.add(
new ExternalViewerAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.openExternViewActLbl"), getOriginal()));
164 actionsList.add(null);
166 actionsList.add(null);
169 final Collection<AbstractFile> selectedFilesList
170 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
171 if (selectedFilesList.size() == 1) {
static synchronized DeleteFileContentTagAction getInstance()
static synchronized AddContentTagAction getInstance()