summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Çela2012-07-24 04:37:19 (EDT)
committerLars Vogel2012-07-24 04:37:19 (EDT)
commitd13f7f0a39998cf0f534c93c6f8b0810e31e34af (patch)
tree05e0ecb2770b717d9e3475418401d1ff0fc6a372
parentec4c851a21cf834b19c4ef41b0a3aa830d0cdab2 (diff)
downloadorg.eclipse.e4.tools-d13f7f0a39998cf0f534c93c6f8b0810e31e34af.zip
org.eclipse.e4.tools-d13f7f0a39998cf0f534c93c6f8b0810e31e34af.tar.gz
org.eclipse.e4.tools-d13f7f0a39998cf0f534c93c6f8b0810e31e34af.tar.bz2
Bug 385257 - Adding class dialog to application model behaves now
similar to the "Open Type" dialog. This patch will activate camelCase matching in the dialog, and allow the user to select with entry with tab or enter.
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java2
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties2
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java21
3 files changed, 23 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
index 4b3c3de..540d02b 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/PDEClassContributionProvider.java
@@ -145,7 +145,7 @@ public class PDEClassContributionProvider implements IClassContributionProvider
packageName,
SearchPattern.R_PATTERN_MATCH,
typeName,
- SearchPattern.R_PREFIX_MATCH,
+ SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
IJavaSearchConstants.CLASS,
scope,
req,
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
index 609bcdc..8b813e4 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
@@ -271,7 +271,7 @@ AddonsEditor_Tags=Tags
ContributionClassDialog_DialogMessage=Enter the name of the contributing class
ContributionClassDialog_DialogTitle=Find Contribution Class
-ContributionClassDialog_Label_Classname=Classname
+ContributionClassDialog_Label_Classname=Class Name
ContributionClassDialog_ShellTitle=Find Contribution Class
MenuContributionEditor_MenuItems=Menu Items
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java
index 50b4056..d4a02ef 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java
@@ -35,6 +35,8 @@ import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Image;
@@ -151,6 +153,25 @@ public class ContributionClassDialog extends TitleAreaDialog {
currentResultHandler = new ContributionResultHandlerImpl(list);
Filter filter = new Filter(project, t.getText());
collector.findContributions(filter, currentResultHandler);
+ t.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == SWT.ARROW_DOWN) {
+ if (viewer.getTable().getItemCount() > 0) {
+ viewer.getTable().setFocus();
+ viewer.getTable().select(0);
+ }
+ }
+ }
+ });
+ viewer.getTable().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ super.keyPressed(e);
+ if ((e.keyCode == SWT.ARROW_UP) && (viewer.getTable().getSelectionIndex() == 0)) {
+ t.setFocus();
+ }
+ }
+ });
}
});