19 package org.sleuthkit.autopsy.keywordsearch;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.Action;
24 import org.openide.nodes.FilterNode;
25 import org.openide.nodes.Node;
26 import org.openide.nodes.Node.Property;
27 import org.openide.nodes.PropertySupport;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
30 import org.openide.util.lookup.Lookups;
31 import org.openide.util.lookup.ProxyLookup;
46 class KeywordSearchFilterNode
extends FilterNode {
48 KeywordSearchFilterNode(HighlightedText highlights, Node original) {
49 super(original, null,
new ProxyLookup(Lookups.singleton(highlights), original.getLookup()));
53 public Node.PropertySet[] getPropertySets() {
54 Node.PropertySet[] propertySets = super.getPropertySets();
56 for (
int i = 0; i < propertySets.length; i++) {
57 Node.PropertySet ps = propertySets[i];
59 if (ps.getName().equals(Sheet.PROPERTIES)) {
60 Sheet.Set newPs =
new Sheet.Set();
61 newPs.setName(ps.getName());
62 newPs.setDisplayName(ps.getDisplayName());
63 newPs.setShortDescription(ps.getShortDescription());
65 Property<?>[] oldProperties = ps.getProperties();
68 for (Property<?> p : oldProperties) {
72 propertySets[i] = newPs;
88 public Action[] getActions(
boolean popup) {
90 List<Action> actions =
new ArrayList<>();
92 Content content = this.getOriginal().getLookup().lookup(Content.class);
93 actions.addAll(content.accept(
new GetPopupActionsContentVisitor()));
95 return actions.toArray(
new Action[actions.size()]);
106 public List<Action>
visit(DerivedFile f) {
111 List<Action> actions =
new ArrayList<>();
112 actions.add(
new NewWindowViewAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.viewInNewWinActionLbl"), KeywordSearchFilterNode.this));
113 actions.add(
new ExternalViewerAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.openExternViewActLbl"), getOriginal()));
116 actions.add(
new HashSearchAction(NbBundle.getMessage(
this.getClass(),
"KeywordSearchFilterNode.getFileActions.searchSameMd5"), getOriginal()));
125 return new ArrayList<>();
static synchronized AddContentTagAction getInstance()