directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1686693 - in /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor: dialogs/ pages/ wrappers/
Date Sun, 21 Jun 2015 08:49:38 GMT
Author: elecharny
Date: Sun Jun 21 08:49:38 2015
New Revision: 1686693

URL: http://svn.apache.org/r1686693
Log:
o Added support for the olcRequires and olcRestrict parameters
o Renamed the DisAllowFeatureDialog class

Added:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisallowFeatureDialog.java
      - copied, changed from r1686688, directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisAllowFeatureDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
Removed:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisAllowFeatureDialog.java
Modified:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties

Copied: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisallowFeatureDialog.java
(from r1686688, directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisAllowFeatureDialog.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/DisallowFeatureDialog.java?p2=directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisallowFeatureDialog.java&p1=directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisAllowFeatureDialog.java&r1=1686688&r2=1686693&rev=1686693&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisAllowFeatureDialog.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DisallowFeatureDialog.java
Sun Jun 21 08:49:38 2015
@@ -71,7 +71,7 @@ import org.apache.directory.studio.openl
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DisAllowFeatureDialog extends AddEditDialog<DisallowFeatureEnum>
+public class DisallowFeatureDialog extends AddEditDialog<DisallowFeatureEnum>
 {
     /** The array of buttons */
     private Button[] disallowFeatureCheckboxes = new Button[6];
@@ -84,7 +84,7 @@ public class DisAllowFeatureDialog exten
      * 
      * @param parentShell The parent Shell
      */
-    public DisAllowFeatureDialog( Shell parentShell )
+    public DisallowFeatureDialog( Shell parentShell )
     {
         super( parentShell );
         super.setShellStyle( super.getShellStyle() | SWT.RESIZE );

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=1686693&r1=1686692&r2=1686693&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 08:49:38 2015
@@ -35,6 +35,8 @@ import org.apache.directory.studio.openl
 import org.apache.directory.studio.openldap.config.editor.wrappers.AuthIdRewriteWrapper;
 import org.apache.directory.studio.openldap.config.editor.wrappers.AuthzRegexpWrapper;
 import org.apache.directory.studio.openldap.config.editor.wrappers.DisallowFeatureDecorator;
+import org.apache.directory.studio.openldap.config.editor.wrappers.RequireConditionDecorator;
+import org.apache.directory.studio.openldap.config.editor.wrappers.RestrictOperationDecorator;
 import org.apache.directory.studio.openldap.config.model.OlcGlobal;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -222,7 +224,46 @@ public class OptionsPage extends OpenLDA
             getConfiguration().getGlobal().setOlcDisallows( disallowFeatures );
         }
     };
+    
+    
+    /**
+     * The olcRequires listener
+     */
+    private WidgetModifyListener requireConditionListener = new WidgetModifyListener()
+    {
+        public void widgetModified( WidgetModifyEvent e )
+        {
+            List<String> requires = new ArrayList<String>();
+            
+            for ( RequireConditionEnum requireCondition : requireConditionTableWidget.getElements()
)
+            {
+                requires.add( requireCondition.getName() );
+            }
+            
+            getConfiguration().getGlobal().setOlcRequires( requires );
+        }
+    };
+    
+    
+    /**
+     * The olcRestrict listener
+     */
+    private WidgetModifyListener restrictOperationListener = new WidgetModifyListener()
+    {
+        public void widgetModified( WidgetModifyEvent e )
+        {
+            List<String> restricts = new ArrayList<String>();
+            
+            for ( RestrictOperationEnum restrictOperation : restrictOperationTableWidget.getElements()
)
+            {
+                restricts.add( restrictOperation.getName() );
+            }
+            
+            getConfiguration().getGlobal().setOlcRestrict( restricts );
+        }
+    };
 
+    
     /**
      * Creates a new instance of OptionsPage.
      *
@@ -298,10 +339,29 @@ public class OptionsPage extends OpenLDA
         disallowFeatureTableWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE,
true, false, 2, 1 ) );
         addModifyListener( disallowFeatureTableWidget, disallowFeatureListener );
 
-        // Plugin Log File Text
-        toolkit.createLabel( composite, "Plugin Log File:" );
-        pluginLogFileText = toolkit.createText( composite, "" );
-        pluginLogFileText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false )
);
+        // The olcRequires parameter label
+        Label requireConditionLabel = toolkit.createLabel( composite, 
+            Messages.getString( "OpenLDAPOptionsPage.RequireCondition" ) ); //$NON-NLS-1$
+        requireConditionLabel.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false,
2, 1 ) );
+
+        // The olcRestrict parameter label
+        Label restrictOperationLabel = toolkit.createLabel( composite,
+            Messages.getString( "OpenLDAPOptionsPage.RestrictOperation" ) ); //$NON-NLS-1$
+        restrictOperationLabel.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false,
2, 1 ) );
+
+        // The olcRequires parameter table
+        requireConditionTableWidget = new TableWidget<RequireConditionEnum>( new RequireConditionDecorator(
composite.getShell() ) );
+
+        requireConditionTableWidget.createWidgetNoEdit( composite, toolkit );
+        requireConditionTableWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE,
true, false, 2, 1 ) );
+        addModifyListener( requireConditionTableWidget, requireConditionListener );
+
+        // The olcRestrict parameter table
+        restrictOperationTableWidget = new TableWidget<RestrictOperationEnum>( new
RestrictOperationDecorator( composite.getShell() ) );
+
+        restrictOperationTableWidget.createWidgetNoEdit( composite, toolkit );
+        restrictOperationTableWidget.getControl().setLayoutData( new GridData( SWT.FILL,
SWT.NONE, true, false, 2, 1 ) );
+        addModifyListener( restrictOperationTableWidget, restrictOperationListener );
     }
 
 

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties?rev=1686693&r1=1686692&r2=1686693&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties
Sun Jun 21 08:49:38 2015
@@ -146,7 +146,8 @@ OpenLDAPOptionsPage.Title=Options
 OpenLDAPOptionsPage.FeaturesAndOperationsSection=Features & Operations
 OpenLDAPOptionsPage.AllowFeature=Allowed :
 OpenLDAPOptionsPage.DisallowFeature=Disallowed :
-
+OpenLDAPOptionsPage.RequireCondition=Required :
+OpenLDAPOptionsPage.RestrictOperation=Restrictions :
 
 #---------------------------------------------------------------------------------------
 # The Database page

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties?rev=1686693&r1=1686692&r2=1686693&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties
Sun Jun 21 08:49:38 2015
@@ -146,6 +146,8 @@ OpenLDAPOptionsPage.Title=Options
 OpenLDAPOptionsPage.FeaturesAndOperationsSection=Features & Operations
 OpenLDAPOptionsPage.AllowFeature=Allowed :
 OpenLDAPOptionsPage.DisallowFeature=Disallowed :
+OpenLDAPOptionsPage.RequireCondition=Required :
+OpenLDAPOptionsPage.RestrictOperation=Restrictions :
 
 #---------------------------------------------------------------------------------------
 # The Database page

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties?rev=1686693&r1=1686692&r2=1686693&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties
Sun Jun 21 08:49:38 2015
@@ -144,8 +144,10 @@ OpenLDAPSecurityPage.EditLogLevels=Editi
 OpenLDAPOptionsPage.Title=Options
 
 OpenLDAPOptionsPage.FeaturesAndOperationsSection=Fonctions & Operations
-OpenLDAPOptionsPage.AllowFeature=Autoris\u0E9 :
-OpenLDAPOptionsPage.DisallowFeature=D\u0E9sactif :
+OpenLDAPOptionsPage.AllowFeature=Autoris\u0E9es :
+OpenLDAPOptionsPage.DisallowFeature=D\u0E9sactifs :
+OpenLDAPOptionsPage.RequireCondition=Requises :
+OpenLDAPOptionsPage.RestrictOperation=Restrictions :
 
 #---------------------------------------------------------------------------------------
 # The Database page

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java?rev=1686693&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
(added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
Sun Jun 21 08:49:38 2015
@@ -0,0 +1,99 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.openldap.config.editor.wrappers;
+
+import org.apache.directory.studio.common.ui.TableDecorator;
+import org.apache.directory.studio.openldap.common.ui.model.RequireConditionEnum;
+import org.apache.directory.studio.openldap.config.editor.dialogs.RequireConditionDialog;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A decorator for the RequireCondition table.
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class RequireConditionDecorator extends TableDecorator<RequireConditionEnum>
+{
+    /**
+     * Create a new instance of RequireConditionDecorator
+     * @param parentShell The parent Shell
+     */
+    public RequireConditionDecorator( Shell parentShell )
+    {
+        setDialog( new RequireConditionDialog( parentShell ) );
+    }
+
+    /**
+     * Construct the label for an RequireCondition.
+     * 
+     */
+    public String getText( Object element )
+    {
+        if ( element instanceof RequireConditionEnum )
+        {
+            String requireCondition = ( ( RequireConditionEnum ) element ).toString();
+
+            return requireCondition;
+        }
+
+        return super.getText( element );
+    };
+
+
+    /**
+     * Get the image. We have none
+     */
+    public Image getImage( Object element )
+    {
+        return null;
+    };
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int compare( RequireConditionEnum e1, RequireConditionEnum e2 )
+    {
+        if ( e1 != null )
+        {
+            if ( e2 == null )
+            {
+                return 1;
+            }
+            else
+            {
+                return e1.getName().compareTo( e2.getName() );
+            }
+        }
+        else
+        {
+            if ( e2 == null )
+            {
+                return 0;
+            }
+            else
+            {
+                return 1;
+            }
+        }
+    }
+}

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java?rev=1686693&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
(added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
Sun Jun 21 08:49:38 2015
@@ -0,0 +1,99 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.openldap.config.editor.wrappers;
+
+import org.apache.directory.studio.common.ui.TableDecorator;
+import org.apache.directory.studio.openldap.common.ui.model.RestrictOperationEnum;
+import org.apache.directory.studio.openldap.config.editor.dialogs.RestrictOperationDialog;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A decorator for the RestrictOperation table.
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class RestrictOperationDecorator extends TableDecorator<RestrictOperationEnum>
+{
+    /**
+     * Create a new instance of RestrictOperationDecorator
+     * @param parentShell The parent Shell
+     */
+    public RestrictOperationDecorator( Shell parentShell )
+    {
+        setDialog( new RestrictOperationDialog( parentShell ) );
+    }
+
+    /**
+     * Construct the label for an RestrictOperation.
+     * 
+     */
+    public String getText( Object element )
+    {
+        if ( element instanceof RestrictOperationEnum )
+        {
+            String restrictOperation = ( ( RestrictOperationEnum ) element ).toString();
+
+            return restrictOperation;
+        }
+
+        return super.getText( element );
+    };
+
+
+    /**
+     * Get the image. We have none
+     */
+    public Image getImage( Object element )
+    {
+        return null;
+    };
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int compare( RestrictOperationEnum e1, RestrictOperationEnum e2 )
+    {
+        if ( e1 != null )
+        {
+            if ( e2 == null )
+            {
+                return 1;
+            }
+            else
+            {
+                return e1.getName().compareTo( e2.getName() );
+            }
+        }
+        else
+        {
+            if ( e2 == null )
+            {
+                return 0;
+            }
+            else
+            {
+                return 1;
+            }
+        }
+    }
+}



Mime
View raw message