Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java')
-rw-r--r--ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java
index aad91fc64d..bee2428083 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java
@@ -13,6 +13,9 @@ package org.eclipse.pde.internal.ui.editor.plugin;
import org.eclipse.pde.internal.ui.editor.PDEDetails;
import org.eclipse.pde.internal.ui.editor.PDESection;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.actions.ActionFactory;
public abstract class AbstractPluginElementDetails extends PDEDetails {
@@ -26,4 +29,25 @@ public abstract class AbstractPluginElementDetails extends PDEDetails {
return fMasterSection;
}
-}
+ public boolean doGlobalAction(String actionId) {
+ // TODO reveal the keybinding Ctrl+F to the user, ideally by showing the action in the context menu
+ if (actionId.equals(ActionFactory.FIND.getId())) {
+ if (fMasterSection != null && fMasterSection instanceof ExtensionsSection) {
+ final Control focusControl = Display.getCurrent().getFocusControl(); // getPage().getLastFocusControl();
+ String filterText = (focusControl instanceof Text) ? ((Text) focusControl).getText() : (focusControl instanceof CCombo) ? ((CCombo) focusControl).getText() : null;
+ if (filterText != null) {
+ // add value of the currently focused attribute text to the filter
+ ((ExtensionsSection) fMasterSection).addAttributeToFilter(filterText, true);
+ Display.getCurrent().asyncExec(new Runnable() {
+ public void run() {
+ // bugfix: after tree refresh bring focus back to the element details form
+ getPage().updateFormSelection();
+ }
+ });
+ }
+ }
+ }
+ return super.doGlobalAction(actionId);
+ }
+
+} \ No newline at end of file

Back to the top