directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r527101 - /directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
Date Tue, 10 Apr 2007 12:12:16 GMT
Author: pamarcelot
Date: Tue Apr 10 05:12:16 2007
New Revision: 527101

URL: http://svn.apache.org/viewvc?view=rev&rev=527101
Log:
Added VerifyListeners on the fields for the port and the limits.

Modified:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java?view=diff&rev=527101&r1=527100&r2=527101
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
Tue Apr 10 05:12:16 2007
@@ -23,6 +23,8 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -127,6 +129,16 @@
         toolkit.createLabel( client, "Port:" );
         portText = toolkit.createText( client, "" );
         portText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        portText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
 
         // Authentication
         toolkit.createLabel( client, "Authentication:" );
@@ -202,21 +214,61 @@
         toolkit.createLabel( client, "Max. Time Limit:" );
         maxTimeLimitText = toolkit.createText( client, "" );
         maxTimeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        maxTimeLimitText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
 
         // Max. Size Limit
         toolkit.createLabel( client, "Max. Size Limit:" );
         maxSizeLimitText = toolkit.createText( client, "" );
         maxSizeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        maxSizeLimitText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
 
         // Synchronization Period
         toolkit.createLabel( client, "Synchronization Period:" );
         synchPeriodText = toolkit.createText( client, "" );
         synchPeriodText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        synchPeriodText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
 
         // Max. Threads
         toolkit.createLabel( client, "Max. Threads:" );
         synchPeriodText = toolkit.createText( client, "" );
         synchPeriodText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        synchPeriodText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
     }
 
 



Mime
View raw message