|
52 | 52 |
|
53 | 53 | /**
|
54 | 54 | * FilterNode containing properties and actions for keyword search.
|
55 |
| - * |
| 55 | + * |
56 | 56 | * Wraps the generic KeyValue node and customizes the property sheet and lookup
|
57 | 57 | */
|
58 | 58 | class AdHocSearchFilterNode extends FilterNode {
|
59 | 59 |
|
60 | 60 | /**
|
61 | 61 | * Instantiate a KeywordSearchFilterNode.
|
62 |
| - * |
63 |
| - * @param original The original source node. |
| 62 | + * |
| 63 | + * @param original The original source node. |
64 | 64 | */
|
65 | 65 | AdHocSearchFilterNode(Node original) {
|
66 | 66 | super(original, null, new ProxyLookup(original.getLookup()));
|
@@ -160,10 +160,20 @@ public List<Action> visit(VirtualDirectory dir) {
|
160 | 160 |
|
161 | 161 | private List<Action> getFileActions() {
|
162 | 162 | List<Action> actionsList = new ArrayList<>();
|
| 163 | + |
| 164 | + boolean hasAbstractFile = getOriginal().getLookup().lookup(AbstractFile.class) != null; |
| 165 | + |
163 | 166 | actionsList.add(new NewWindowViewAction(NbBundle.getMessage(this.getClass(), "KeywordSearchFilterNode.getFileActions.viewInNewWinActionLbl"), AdHocSearchFilterNode.this));
|
164 |
| - actionsList.add(new ExternalViewerAction(NbBundle.getMessage(this.getClass(), "KeywordSearchFilterNode.getFileActions.openExternViewActLbl"), getOriginal())); |
| 167 | + |
| 168 | + if (hasAbstractFile) { |
| 169 | + actionsList.add(new ExternalViewerAction(NbBundle.getMessage(this.getClass(), "KeywordSearchFilterNode.getFileActions.openExternViewActLbl"), getOriginal())); |
| 170 | + } |
| 171 | + |
165 | 172 | actionsList.add(null);
|
166 |
| - actionsList.add(ExtractAction.getInstance()); |
| 173 | + if (hasAbstractFile) { |
| 174 | + actionsList.add(ExtractAction.getInstance()); |
| 175 | + } |
| 176 | + |
167 | 177 | actionsList.add(ExportCSVAction.getInstance());
|
168 | 178 | actionsList.add(null); // creates a menu separator
|
169 | 179 | actionsList.add(AddContentTagAction.getInstance());
|
|
0 commit comments