directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1682971 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
Date Mon, 01 Jun 2015 18:27:58 GMT
Author: elecharny
Date: Mon Jun  1 18:27:58 2015
New Revision: 1682971

URL: http://svn.apache.org/r1682971
Log:
Fixed some corner cases in the TimeLimit value listeners

Modified:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java?rev=1682971&r1=1682970&r2=1682971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
Mon Jun  1 18:27:58 2015
@@ -232,7 +232,14 @@ public class TimeLimitDialog extends Dia
             // The possible values are : 'unlimited' | 'none' | INT | -1
             String softLimitStr = softLimitText.getText();
 
-            if ( UNLIMITED_STR.equalsIgnoreCase( softLimitStr ) || NONE_STR.equalsIgnoreCase(
softLimitStr ) ) 
+            if ( Strings.isEmpty( softLimitStr ) )
+            {
+                // Check the case we don't have anything
+                timeLimitWrapper.setSoftLimit( null );
+                softUnlimitedCheckbox.setSelection( false );
+                softLimitText.setForeground( display.getSystemColor( SWT.COLOR_BLACK ) );
+            }
+            else if ( UNLIMITED_STR.equalsIgnoreCase( softLimitStr ) || NONE_STR.equalsIgnoreCase(
softLimitStr ) ) 
             {
                 timeLimitWrapper.setSoftLimit( TimeLimitWrapper.UNLIMITED );
                 softUnlimitedCheckbox.setSelection( true );
@@ -249,6 +256,7 @@ public class TimeLimitDialog extends Dia
                     {
                         // The value must be either -1 (unlimited) or a positive number
                         softLimitText.setForeground( display.getSystemColor( SWT.COLOR_RED
) );
+                        softUnlimitedCheckbox.setSelection( false );
                     }
                     else if ( value == TimeLimitWrapper.UNLIMITED )
                     {
@@ -267,6 +275,7 @@ public class TimeLimitDialog extends Dia
                 {
                     // The value must be either -1 (unlimited) or a positive number
                     softLimitText.setForeground( display.getSystemColor( SWT.COLOR_RED )
);
+                    softUnlimitedCheckbox.setSelection( false );
                 }
             }
 
@@ -384,6 +393,7 @@ public class TimeLimitDialog extends Dia
             {
                 // Check the case we don't have anything
                 timeLimitWrapper.setGlobalLimit( null );
+                globalUnlimitedCheckbox.setEnabled( false );
                 globalLimitText.setForeground( display.getSystemColor( SWT.COLOR_BLACK )
);
             }
             else if ( UNLIMITED_STR.equalsIgnoreCase( globalLimitStr ) || NONE_STR.equalsIgnoreCase(
globalLimitStr ) ) 
@@ -420,6 +430,7 @@ public class TimeLimitDialog extends Dia
                 catch ( NumberFormatException nfe )
                 {
                     // The value must be either -1 (unlimited) or a positive number
+                    globalUnlimitedCheckbox.setEnabled( false );
                     globalLimitText.setForeground( display.getSystemColor( SWT.COLOR_RED
) );
                 }
             }
@@ -687,7 +698,7 @@ public class TimeLimitDialog extends Dia
      * is invalid.
      * 
      * <pre>
-     * Resulting TimeLimit
+     * Resulting Time Limit
      * .------------------------------------.
      * | Time Limit : <///////////////////> |
      * '------------------------------------'
@@ -697,7 +708,7 @@ public class TimeLimitDialog extends Dia
     private void createTimeLimitShowGroup( Composite parent )
     {
         // TimeLimit Group
-        Group timeLimitGroup = BaseWidgetUtils.createGroup( parent, "Resulting TimeLimit",
1 );
+        Group timeLimitGroup = BaseWidgetUtils.createGroup( parent, "Resulting Time Limit",
1 );
         GridLayout timeLimitGroupGridLayout = new GridLayout( 2, false );
         timeLimitGroup.setLayout( timeLimitGroupGridLayout );
         timeLimitGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );



Mime
View raw message