directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r521738 - /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
Date Fri, 23 Mar 2007 14:27:21 GMT
Author: pamarcelot
Date: Fri Mar 23 07:27:20 2007
New Revision: 521738

URL: http://svn.apache.org/viewvc?view=rev&rev=521738
Log:
Added a verify listener on the Syntax Lenght text field to enable only digits.

Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java?view=diff&rev=521738&r1=521737&r2=521738
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
Fri Mar 23 07:27:20 2007
@@ -307,8 +307,8 @@
         }
     };
 
-    /** The listener for the Syntax Length Text Widget */
-    private ModifyListener syntaxLengthTextListener = new ModifyListener()
+    /** The Modify listener for the Syntax Length Text Widget */
+    private ModifyListener syntaxLengthTextModifyListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
@@ -324,6 +324,18 @@
         }
     };
 
+    /** The Verify listener for the Syntax Length Text Widget */
+    private VerifyListener syntaxLengthTextVerifyListener = new VerifyListener()
+    {
+        public void verifyText( VerifyEvent e )
+        {
+            if ( !e.text.matches( "[0-9]*" ) )
+            {
+                e.doit = false;
+            }
+        }
+    };
+
     /** The listener for the Obsolete Checbox Widget */
     private SelectionAdapter obsoleteCheckboxListener = new SelectionAdapter()
     {
@@ -965,7 +977,8 @@
             supCombo.addModifyListener( supComboListener );
             usageCombo.addModifyListener( usageComboListener );
             syntaxCombo.addModifyListener( syntaxComboListener );
-            syntaxLengthText.addModifyListener( syntaxLengthTextListener );
+            syntaxLengthText.addModifyListener( syntaxLengthTextModifyListener );
+            syntaxLengthText.addVerifyListener( syntaxLengthTextVerifyListener );
             obsoleteCheckbox.addSelectionListener( obsoleteCheckboxListener );
             singleValueCheckbox.addSelectionListener( singleValueCheckboxListener );
             collectiveCheckbox.addSelectionListener( collectiveCheckboxListener );
@@ -997,7 +1010,8 @@
         supCombo.removeModifyListener( supComboListener );
         usageCombo.removeModifyListener( usageComboListener );
         syntaxCombo.removeModifyListener( syntaxComboListener );
-        syntaxLengthText.removeModifyListener( syntaxLengthTextListener );
+        syntaxLengthText.removeModifyListener( syntaxLengthTextModifyListener );
+        syntaxLengthText.removeVerifyListener( syntaxLengthTextVerifyListener );
         obsoleteCheckbox.removeSelectionListener( obsoleteCheckboxListener );
         singleValueCheckbox.removeSelectionListener( singleValueCheckboxListener );
         collectiveCheckbox.removeSelectionListener( collectiveCheckboxListener );



Mime
View raw message