directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r585131 - /directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
Date Tue, 16 Oct 2007 12:20:48 GMT
Author: pamarcelot
Date: Tue Oct 16 05:20:46 2007
New Revision: 585131

URL: http://svn.apache.org/viewvc?rev=585131&view=rev
Log:
Another fix for DIRSTUDIO-221 (Improve Object Class selection in the New Entry Wizard).
Added:
	o KeyAdapter on Down Arrow Key on the Instant Search Field that sets focus on the Object
Classes TableViewer
	o KeyAdapter on Up Arrow Key on the Object Classes TableViewer that sets focus on the Instant
Search Field (if the first item or no item is selected)

Modified:
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java?rev=585131&r1=585130&r2=585131&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
Tue Oct 16 05:20:46 2007
@@ -55,6 +55,9 @@
 import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -348,13 +351,23 @@
             public void modifyText( ModifyEvent e )
             {
                 availableObjectClassesViewer.refresh();
-                if ( availableObjectClassesViewer.getTable().getItemCount() == 1 )
+                if ( availableObjectClassesViewer.getTable().getItemCount() >= 1 )
                 {
                     Object item = availableObjectClassesViewer.getElementAt( 0 );
                     availableObjectClassesViewer.setSelection( new StructuredSelection( item
) );
                 }
             }
         } );
+        availableObjectClassesInstantSearch.addKeyListener( new KeyAdapter()
+        {
+            public void keyPressed( KeyEvent e )
+            {
+                if ( e.keyCode == SWT.ARROW_DOWN )
+                {
+                    availableObjectClassesViewer.getTable().setFocus();
+                }
+            }
+        } );
 
         availableObjectClassesViewer = new TableViewer( availableObjectClassesComposite );
         GridData data = new GridData( GridData.FILL_BOTH );
@@ -371,6 +384,19 @@
             public void doubleClick( DoubleClickEvent event )
             {
                 add( event.getSelection() );
+            }
+        } );
+        availableObjectClassesViewer.getTable().addKeyListener( new KeyAdapter()
+        {
+            public void keyPressed( KeyEvent e )
+            {
+                if ( e.keyCode == SWT.ARROW_UP )
+                {
+                    if ( availableObjectClassesViewer.getTable().getSelectionIndex() <=
0 )
+                    {
+                        availableObjectClassesInstantSearch.setFocus();
+                    }
+                }
             }
         } );
 



Mime
View raw message