Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2014-07-12 10:05:54 -0400
committerFred Bricon2014-07-12 10:05:54 -0400
commit06395bb5c148d041cbf3d8c6fa8c5c1b3665e8c7 (patch)
treedcbc94dccc5420a513047046c5a255be8417b96f
parent2f6257c620e78986bf92864afaa359a571fac554 (diff)
downloadm2e-core-06395bb5c148d041cbf3d8c6fa8c5c1b3665e8c7.tar.gz
m2e-core-06395bb5c148d041cbf3d8c6fa8c5c1b3665e8c7.tar.xz
m2e-core-06395bb5c148d041cbf3d8c6fa8c5c1b3665e8c7.zip
439414 : scan when 'Return' key is pressed
Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
index e6d4bea3..aa619039 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
@@ -67,7 +67,9 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Tree;
@@ -184,13 +186,18 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
}
});
- rootDirectoryCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
-// if (rootDirectoryChanged()) {
-// scanProjects();
-// }
+ rootDirectoryCombo.addListener(SWT.Traverse, new Listener() {
+ public void handleEvent(Event e) {
+ if(e.keyCode == SWT.CR && rootDirectoryChanged()) {
+ //New location entered : don't finish the wizard
+ if(e.detail == SWT.TRAVERSE_RETURN) {
+ e.doit = false;
+ }
+ scanProjects();
+ }
}
});
+
rootDirectoryCombo.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
if(rootDirectoryChanged()) {

Back to the top