directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1686697 - in /directory/studio/trunk/plugins: openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/ openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ openldap....
Date Sun, 21 Jun 2015 09:23:16 GMT
Author: elecharny
Date: Sun Jun 21 09:23:16 2015
New Revision: 1686697

URL: http://svn.apache.org/r1686697
Log:
o Added a toString() method to some of the enum
o Improved the output of some enums
o Fix the update of the require and restrict parameters

Modified:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/RestrictOperationDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
Sun Jun 21 09:23:16 2015
@@ -117,4 +117,13 @@ public enum AllowFeatureEnum
         
         return UNKNOWN;
     }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return name;
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
Sun Jun 21 09:23:16 2015
@@ -142,4 +142,13 @@ public enum PasswordHashEnum
         
         return NO_CHOICE;
     }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return name;
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
Sun Jun 21 09:23:16 2015
@@ -124,4 +124,13 @@ public enum RequireConditionEnum
         
         return UNKNOWN;
     }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return name;
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
Sun Jun 21 09:23:16 2015
@@ -44,33 +44,37 @@ package org.apache.directory.studio.open
  */
 public enum RestrictOperationEnum
 {
-    UNKNOWN( "---" ),
-    ADD( "add" ),
-    ALL( "all" ),
-    BIND( "bind" ),
-    COMPARE( "compare" ),
-    DELETE( "delete" ),
-    EXTENDED( "extended" ),
-    EXTENDED_START_TLS( "extended=1.3.6.1.4.1.1466.20037" ),
-    EXTENDED_MODIFY_PASSWD( "extended=1.3.6.1.4.1.4203.1.11.1" ),
-    EXTENDED_WHOAMI( "extended=1.3.6.1.4.1.4203.1.11.3" ),
-    EXTENDED_CANCEL( "extended=1.3.6.1.1.8" ),
-    MODIFY( "modify" ),
-    MODRDN( "modrdn" ),
-    READ( "read" ),
-    RENAME( "rename" ),
-    SEARCH( "search" ),
-    WRITE( "write" );
+    UNKNOWN( "---", "" ),
+    ADD( "add", "add" ),
+    ALL( "all", "all" ),
+    BIND( "bind", "bind" ),
+    COMPARE( "compare", "compare" ),
+    DELETE( "delete", "delete" ),
+    EXTENDED( "extended", "extended" ),
+    EXTENDED_START_TLS( "extended=1.3.6.1.4.1.1466.20037", "START_TLS" ),
+    EXTENDED_MODIFY_PASSWD( "extended=1.3.6.1.4.1.4203.1.11.1", "MODIFY_PASSWORD" ),
+    EXTENDED_WHOAMI( "extended=1.3.6.1.4.1.4203.1.11.3", "WHOAMI" ),
+    EXTENDED_CANCEL( "extended=1.3.6.1.1.8", "CANCEL" ),
+    MODIFY( "modify", "modify" ),
+    MODRDN( "modrdn", "modrdn" ),
+    READ( "read", "read" ),
+    RENAME( "rename", "rename" ),
+    SEARCH( "search", "search" ),
+    WRITE( "write", "write" );
     
     /** The interned name */
     private String name;
     
+    /** The externalized name */
+    private String externalName;
+    
     /**
      * A private constructor for this enum
      */
-    private RestrictOperationEnum( String name )
+    private RestrictOperationEnum( String name, String externalName )
     {
         this.name = name;
+        this.externalName = externalName;
     }
     
     
@@ -84,6 +88,15 @@ public enum RestrictOperationEnum
     
     
     /**
+     * @return the external name
+     */
+    public String getExternalName()
+    {
+        return externalName;
+    }
+    
+    
+    /**
      * Get the RestrictOperationEnum instance from its number
      * 
      * @param number The number we are looking for
@@ -194,4 +207,13 @@ public enum RestrictOperationEnum
         
         return UNKNOWN;
     }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return externalName;
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/RestrictOperationDialog.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/RestrictOperationDialog.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/RestrictOperationDialog.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/RestrictOperationDialog.java
Sun Jun 21 09:23:16 2015
@@ -67,7 +67,7 @@ import org.apache.directory.studio.openl
  * +--------------------------------------------------------------------+
  * | Restricted Operation                                               |
  * | .----------------------------------------------------------------. |
- * | | add :    []  add :    []  bind :      []  compare :         [] | |
+ * | | add :    []  all :    []  bind :      []  compare :         [] | |
  * | | delete : []  extended []  START_TLS : []  MODIFY_PASSWORD : [] | |
  * | | WHOAMI : []  CANCEL : []  modify :    []  modrdn :          [] | |
  * | | read :   []  rename : []  search :    []  write :           [] | |
@@ -144,7 +144,7 @@ public class RestrictOperationDialog ext
      * +--------------------------------------------------------------------+
      * | Restricted Operation                                               |
      * | .----------------------------------------------------------------. |
-     * | | add :    []  add :    []  bind :      []  compare :         [] | |
+     * | | add :    []  all :    []  bind :      []  compare :         [] | |
      * | | delete : []  extended []  START_TLS : []  MODIFY_PASSWORD : [] | |
      * | | WHOAMI : []  CANCEL : []  modify :    []  modrdn :          [] | |
      * | | read :   []  rename : []  search :    []  write :           [] | |
@@ -176,7 +176,7 @@ public class RestrictOperationDialog ext
      * <pre>
      * Restricted Operation
      * .----------------------------------------------------------------.
-     * | add :    []  add :    []  bind :      []  compare :         [] |
+     * | add :    []  all :    []  bind :      []  compare :         [] |
      * | delete : []  extended []  START_TLS : []  MODIFY_PASSWORD : [] |
      * | WHOAMI : []  CANCEL : []  modify :    []  modrdn :          [] |
      * | read :   []  rename : []  search :    []  write :           [] |
@@ -195,7 +195,7 @@ public class RestrictOperationDialog ext
         // The various buttons
         for ( int i = 1; i < restrictOperationCheckboxes.length; i++ )
         {
-            String restrictOperation = RestrictOperationEnum.getOperation( i ).getName();
+            String restrictOperation = RestrictOperationEnum.getOperation( i ).getExternalName();
             restrictOperationCheckboxes[i] = BaseWidgetUtils.createCheckbox( restrictOperationGroup,
restrictOperation, 1 );
             restrictOperationCheckboxes[i].addSelectionListener( checkboxSelectionListener
);
         }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java?rev=1686697&r1=1686696&r2=1686697&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
Sun Jun 21 09:23:16 2015
@@ -402,6 +402,8 @@ public class OptionsPage extends OpenLDA
     {
         addDirtyListener( allowFeatureTableWidget );
         addDirtyListener( disallowFeatureTableWidget );
+        addDirtyListener( requireConditionTableWidget );
+        addDirtyListener( restrictOperationTableWidget );
     }
 
     
@@ -412,6 +414,8 @@ public class OptionsPage extends OpenLDA
     {
         removeDirtyListener( allowFeatureTableWidget );
         removeDirtyListener( disallowFeatureTableWidget );
+        removeDirtyListener( requireConditionTableWidget );
+        removeDirtyListener( restrictOperationTableWidget );
     }
     
 
@@ -469,6 +473,44 @@ public class OptionsPage extends OpenLDA
                 disallowFeatureTableWidget.setElements( new ArrayList<DisallowFeatureEnum>()
);
             }
 
+            // Require Condition Table Widget
+            List<String> requireConditions = global.getOlcRequires();
+
+            if ( requireConditions != null )
+            {
+                List<RequireConditionEnum> requires = new ArrayList<RequireConditionEnum>();
+                
+                for ( String requireCondition : requireConditions )
+                {
+                    requires.add( RequireConditionEnum.getCondition( requireCondition ) );
+                }
+                
+                requireConditionTableWidget.setElements( requires );
+            }
+            else
+            {
+                requireConditionTableWidget.setElements( new ArrayList<RequireConditionEnum>()
);
+            }
+
+            // Restrict Operation Condition Table Widget
+            List<String> restrictOperations = global.getOlcRestrict();
+
+            if ( restrictOperations != null )
+            {
+                List<RestrictOperationEnum> restricts = new ArrayList<RestrictOperationEnum>();
+                
+                for ( String restrictOperation : restrictOperations )
+                {
+                    restricts.add( RestrictOperationEnum.getOperation( restrictOperation
) );
+                }
+                
+                restrictOperationTableWidget.setElements( restricts );
+            }
+            else
+            {
+                restrictOperationTableWidget.setElements( new ArrayList<RestrictOperationEnum>()
);
+            }
+
             addListeners();
         }
     }



Mime
View raw message