directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r559827 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java
Date Thu, 26 Jul 2007 14:24:15 GMT
Author: pamarcelot
Date: Thu Jul 26 07:24:15 2007
New Revision: 559827

URL: http://svn.apache.org/viewvc?view=rev&rev=559827
Log:
Improved EditAliasesDialog (Better handling of the return key).

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java?view=diff&rev=559827&r1=559826&r2=559827
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/dialogs/EditAliasesDialog.java
Thu Jul 26 07:24:15 2007
@@ -30,8 +30,8 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 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;
@@ -198,7 +198,7 @@
      */
     private void initListeners()
     {
-        aliasesTable.addKeyListener( new KeyListener()
+        aliasesTable.addKeyListener( new KeyAdapter()
         {
             public void keyPressed( KeyEvent e )
             {
@@ -209,11 +209,6 @@
                     removeAliases();
                 }
             }
-
-
-            public void keyReleased( KeyEvent e )
-            {
-            }
         } );
 
         // Aliases Table's Popup Menu
@@ -240,7 +235,11 @@
                 {
                     String text = newAliasText.getText();
 
-                    if ( ( !"".equals( text ) ) && ( !aliasesLowerCased.contains(
text.toLowerCase() ) ) //$NON-NLS-1$
+                    if ( "".equals( text ) ) //$NON-NLS-1$
+                    {
+                        close();
+                    }
+                    else if ( ( !aliasesLowerCased.contains( text.toLowerCase() ) ) //$NON-NLS-1$
                         && ( !Activator.getDefault().getSchemaHandler().isAliasOrOidAlreadyTaken(
text ) ) )
                     {
                         addANewAlias();
@@ -248,7 +247,6 @@
                 }
             }
         } );
-
         newAliasText.addModifyListener( new ModifyListener()
         {
             public void modifyText( ModifyEvent e )
@@ -260,6 +258,7 @@
                 if ( "".equals( text ) ) //$NON-NLS-1$
                 {
                     newAliasAddButton.setEnabled( false );
+                    return;
                 }
                 else if ( aliasesLowerCased.contains( text.toLowerCase() ) )
                 {



Mime
View raw message