directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r742703 - /directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java
Date Mon, 09 Feb 2009 19:44:58 GMT
Author: seelmann
Date: Mon Feb  9 19:44:58 2009
New Revision: 742703

URL: http://svn.apache.org/viewvc?rev=742703&view=rev
Log:
Don't invoke Finish' or 'OK' button when pressing 'Enter' in wizard or dialog

Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java?rev=742703&r1=742702&r2=742703&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java
Mon Feb  9 19:44:58 2009
@@ -40,12 +40,15 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
 
 
 /**
@@ -157,6 +160,18 @@
         viewer.getTree().addSelectionListener( viewerSelectionListener );
         viewer.getTree().addMouseListener( viewerMouseListener );
         EventRegistry.addEntryUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner()
);
+
+        // Don't invoke Finish' or 'OK' button when pressing 'Enter' in wizard or dialog
+        viewer.getTree().addTraverseListener( new TraverseListener()
+        {
+            public void keyTraversed( TraverseEvent e )
+            {
+                if ( e.detail == SWT.TRAVERSE_RETURN )
+                {
+                    e.doit = false;
+                }
+            }
+        } );
     }
 
 



Mime
View raw message