directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r656336 [1/11] - in /directory/studio/trunk/apacheds-configuration: ./ resources/icons/ src/main/java/ src/main/java/org/apache/directory/studio/apacheds/configuration/ src/main/java/org/apache/directory/studio/apacheds/configuration/dialog...
Date Wed, 14 May 2008 17:21:48 GMT
Author: pamarcelot
Date: Wed May 14 10:21:46 2008
New Revision: 656336

URL: http://svn.apache.org/viewvc?rev=656336&view=rev
Log:
o Complete code reorganization (Each supported version of ADS, now has its own model and wizard pages)
o Added a wizard page to the new Apache DS Configuration File Wizard which ask for the target version.
o Updated editor to create the needed pages according the version of the server configuration object.

Added:
    directory/studio/trunk/apacheds-configuration/resources/icons/new_server_configuration_file_wizard.gif   (with props)
    directory/studio/trunk/apacheds-configuration/src/main/java/Main.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/SavableFormPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/InterceptorDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/InterceptorsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/InterceptorsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/BinaryAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/IndexedAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/ExtendedOperationDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/ExtendedOperationsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/ExtendedOperationsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/InterceptorDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/InterceptorsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/InterceptorsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/BinaryAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/IndexedAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/ExtendedOperationDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/ExtendedOperationsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/ExtendedOperationsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java
      - copied, changed from r653343, directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/AttributeValueObject.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/BinaryAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/IndexedAttributeDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerConfiguration.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationVersionEnum.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ExtendedOperation.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/IndexedAttribute.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Interceptor.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerConfigurationV150.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ExtendedOperation.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/IndexedAttribute.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Interceptor.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerConfigurationV151.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ExtendedOperation.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/IndexedAttribute.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Interceptor.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerConfigurationV152.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizardPage.java
    directory/studio/trunk/apacheds-configuration/src/main/resources/org/apache/directory/studio/apacheds/configuration/default-server-1.5.0.xml
    directory/studio/trunk/apacheds-configuration/src/main/resources/org/apache/directory/studio/apacheds/configuration/default-server-1.5.1.xml
    directory/studio/trunk/apacheds-configuration/src/main/resources/org/apache/directory/studio/apacheds/configuration/default-server-1.5.2.xml
Removed:
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/dialogs/
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/AttributeValueObject.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ExtendedOperationDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ExtendedOperationsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ExtendedOperationsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/GeneralPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/InterceptorDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/InterceptorsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/InterceptorsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/PartitionDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/PartitionsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ExtendedOperation.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/IndexedAttribute.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/Interceptor.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/Partition.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV150IO.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV151IO.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java
Modified:
    directory/studio/trunk/apacheds-configuration/plugin.xml
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java

Modified: directory/studio/trunk/apacheds-configuration/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/plugin.xml?rev=656336&r1=656335&r2=656336&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/plugin.xml (original)
+++ directory/studio/trunk/apacheds-configuration/plugin.xml Wed May 14 10:21:46 2008
@@ -47,10 +47,10 @@
       <extension
          point="org.eclipse.ui.newWizards">
       <wizard
-            canFinishEarly="true"
+            canFinishEarly="false"
             category="org.apache.directory.studio.apacheds.configuration.newWizards"
             class="org.apache.directory.studio.apacheds.configuration.wizards.NewApacheDSConfigurationFileWizard"
-            hasPages="false"
+            hasPages="true"
             icon="resources/icons/editor_new.gif"
             id="org.apache.directory.studio.apacheds.configuration.NewApacheDSConfigurationFileWizard"
             name="Apache DS Configuration File"

Added: directory/studio/trunk/apacheds-configuration/resources/icons/new_server_configuration_file_wizard.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/resources/icons/new_server_configuration_file_wizard.gif?rev=656336&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/apacheds-configuration/resources/icons/new_server_configuration_file_wizard.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/apacheds-configuration/src/main/java/Main.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/Main.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/Main.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/Main.java Wed May 14 10:21:46 2008
@@ -0,0 +1,28 @@
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException;
+import org.apache.directory.studio.apacheds.configuration.model.v151.ServerXmlIOV151;
+import org.apache.directory.studio.apacheds.configuration.model.v152.ServerXmlIOV152;
+
+
+public class Main
+{
+
+    /**
+     * TODO main.
+     *
+     * @param args
+     * @throws ServerXmlIOException 
+     */
+    public static void main( String[] args ) throws ServerXmlIOException
+    {
+        ServerXmlIOV152 serverXmlV152IO = new ServerXmlIOV152();
+        ServerXmlIOV151 serverXmlIO = new ServerXmlIOV151();
+        ServerConfiguration serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
+            .getResourceAsStream( "default-server.xml" ) );
+        
+        String string = serverXmlV152IO.toXml( serverConfiguration );
+        System.out.println( string );
+    }
+
+}

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java?rev=656336&r1=656335&r2=656336&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java (original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java Wed May 14 10:21:46 2008
@@ -23,7 +23,6 @@
 import java.net.URL;
 
 import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
-import org.apache.directory.studio.apacheds.configuration.model.ServerXmlV152IO;
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.dialogs.Dialog;
@@ -37,8 +36,9 @@
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
-import org.apache.directory.studio.apacheds.configuration.model.ServerXmlV150IO;
-import org.apache.directory.studio.apacheds.configuration.model.ServerXmlV151IO;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ServerXmlIOV150;
+import org.apache.directory.studio.apacheds.configuration.model.v151.ServerXmlIOV151;
+import org.apache.directory.studio.apacheds.configuration.model.v152.ServerXmlIOV152;
 
 
 /**
@@ -56,7 +56,7 @@
     private static ApacheDSConfigurationPlugin plugin;
 
     private ServerXmlIO[] serverXmlIOs = new ServerXmlIO[]
-        { new ServerXmlV152IO(), new ServerXmlV151IO(), new ServerXmlV150IO(), };
+        { new ServerXmlIOV152(), new ServerXmlIOV151(), new ServerXmlIOV150(), };
 
 
     /**

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java?rev=656336&r1=656335&r2=656336&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java (original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java Wed May 14 10:21:46 2008
@@ -29,10 +29,11 @@
 public interface ApacheDSConfigurationPluginConstants
 {
     // Images
-    public static final String IMG_VERTICAL_ORIENTATION = "resources/icons/vertical_orientation.gif";
+    public static final String IMG_EXTENDED_OPERATION = "resources/icons/extended_operation.gif";
     public static final String IMG_HORIZONTAL_ORIENTATION = "resources/icons/horizontal_orientation.gif";
+    public static final String IMG_INTERCEPTOR = "resources/icons/interceptor.gif";
+    public static final String IMG_NEW_SERVER_CONFIGURATION_FILE_WIZARD = "resources/icons/new_server_configuration_file_wizard.gif";
     public static final String IMG_PARTITION = "resources/icons/partition.gif";
     public static final String IMG_PARTITION_SYSTEM = "resources/icons/partition_system.gif";
-    public static final String IMG_INTERCEPTOR = "resources/icons/interceptor.gif";
-    public static final String IMG_EXTENDED_OPERATION = "resources/icons/extended_operation.gif";
+    public static final String IMG_VERTICAL_ORIENTATION = "resources/icons/vertical_orientation.gif";
 }

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java?rev=656336&r1=656335&r2=656336&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java (original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java Wed May 14 10:21:46 2008
@@ -67,7 +67,17 @@
      */
     public String getToolTipText()
     {
-        return "New Apache DS Configuration File";
+        switch ( serverConfiguration.getVersion() )
+        {
+            case VERSION_1_5_2:
+                return "New Apache DS 1.5.2 Configuration File";
+            case VERSION_1_5_1:
+                return "New Apache DS 1.5.1 Configuration File";
+            case VERSION_1_5_0:
+                return "New Apache DS 1.5.0 Configuration File";
+            default:
+                return "New Apache DS Configuration File";
+        }
     }
 
 
@@ -76,7 +86,17 @@
      */
     public String getName()
     {
-        return "Apache DS Configuration";
+        switch ( serverConfiguration.getVersion() )
+        {
+            case VERSION_1_5_2:
+                return "New Apache DS 1.5.2 Configuration File";
+            case VERSION_1_5_1:
+                return "New Apache DS 1.5.1 Configuration File";
+            case VERSION_1_5_0:
+                return "New Apache DS 1.5.0 Configuration File";
+            default:
+                return "New Apache DS Configuration File";
+        }
     }
 
 

Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/SavableFormPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/SavableFormPage.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/SavableFormPage.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/SavableFormPage.java Wed May 14 10:21:46 2008
@@ -0,0 +1,39 @@
+/*
+ *  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.apacheds.configuration.editor;
+
+
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+
+/**
+ * This interface defines a {@link FormPage} that can be saved.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface SavableFormPage extends IFormPage
+{
+    /**
+     * Saves the necessary elements to the input model.
+     */
+    public void save();
+}

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=656336&r1=656335&r2=656336&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java (original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java Wed May 14 10:21:46 2008
@@ -32,6 +32,10 @@
 
 import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginUtils;
+import org.apache.directory.studio.apacheds.configuration.editor.v152.ExtendedOperationsPage;
+import org.apache.directory.studio.apacheds.configuration.editor.v152.GeneralPage;
+import org.apache.directory.studio.apacheds.configuration.editor.v152.InterceptorsPage;
+import org.apache.directory.studio.apacheds.configuration.editor.v152.PartitionsPage;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
 import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
 import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException;
@@ -84,10 +88,10 @@
     private boolean dirty = false;
 
     // The Pages
-    private GeneralPage generalPage;
-    private PartitionsPage partitionsPage;
-    private InterceptorsPage interceptorsPage;
-    private ExtendedOperationsPage extendedOperationsPage;
+    private SavableFormPage generalPage;
+    private SavableFormPage partitionsPage;
+    private SavableFormPage interceptorsPage;
+    private SavableFormPage extendedOperationsPage;
 
 
     /* (non-Javadoc)
@@ -98,42 +102,9 @@
         super.init( site, input );
         setPartName( input.getName() );
 
-        //
-        //        String inputClassName = input.getClass().getName();
         try
         {
             readServerConfiguration( input );
-            //            if ( input instanceof FileEditorInput )
-            //            // The 'FileEditorInput' class is used when the file is opened
-            //            // from a project in the workspace.
-            //            {
-            //                ServerConfigurationParser parser = new ServerConfigurationParser();
-            //                serverConfiguration = parser.parse( ( ( FileEditorInput ) input ).getFile().getContents() );
-            //            }
-            //            else if ( input instanceof IPathEditorInput )
-            //            {
-            //                ServerConfigurationParser parser = new ServerConfigurationParser();
-            //                serverConfiguration = parser.parse( new FileInputStream( new File( ( ( IPathEditorInput ) input )
-            //                    .getPath().toOSString() ) ) );
-            //            }
-            //            else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
-            //                || inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
-            //            // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
-            //            // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
-            //            // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
-            //            // opening a file from the menu File > Open... in Eclipse 3.3.x
-            //            {
-            //                // We use the tooltip to get the full path of the file
-            //                ServerConfigurationParser parser = new ServerConfigurationParser();
-            //                serverConfiguration = parser.parse( new FileInputStream( new File( input.getToolTipText() ) ) );
-            //            }
-            //            else if ( input instanceof NonExistingServerConfigurationInput )
-            //            {
-            //                // The 'ServerConfigurationEditorInput' class is used when a
-            //                // new Server Configuration File is created.
-            //                serverConfiguration = ( ( NonExistingServerConfigurationInput ) input ).getServerConfiguration();
-            //                dirty = true;
-            //            }
         }
         catch ( Exception e )
         {
@@ -230,17 +201,64 @@
     {
         try
         {
-            generalPage = new GeneralPage( this );
-            addPage( generalPage );
-
-            partitionsPage = new PartitionsPage( this );
-            addPage( partitionsPage );
-
-            interceptorsPage = new InterceptorsPage( this );
-            addPage( interceptorsPage );
+            if ( serverConfiguration != null )
+            {
+                switch ( serverConfiguration.getVersion() )
+                {
+                    case VERSION_1_5_2:
+                        generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.GeneralPage(
+                            this );
+                        addPage( generalPage );
+
+                        partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.PartitionsPage(
+                            this );
+                        addPage( partitionsPage );
+
+                        interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.InterceptorsPage(
+                            this );
+                        addPage( interceptorsPage );
+
+                        extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.ExtendedOperationsPage(
+                            this );
+                        addPage( extendedOperationsPage );
+                        break;
+                    case VERSION_1_5_1:
+                        generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.GeneralPage(
+                            this );
+                        addPage( generalPage );
+
+                        partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.PartitionsPage(
+                            this );
+                        addPage( partitionsPage );
+
+                        interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.InterceptorsPage(
+                            this );
+                        addPage( interceptorsPage );
+
+                        extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.ExtendedOperationsPage(
+                            this );
+                        addPage( extendedOperationsPage );
+                        break;
+                    case VERSION_1_5_0:
+                        generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.GeneralPage(
+                            this );
+                        addPage( generalPage );
+
+                        partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.PartitionsPage(
+                            this );
+                        addPage( partitionsPage );
+
+                        interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.InterceptorsPage(
+                            this );
+                        addPage( interceptorsPage );
+
+                        extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.ExtendedOperationsPage(
+                            this );
+                        addPage( extendedOperationsPage );
+                        break;
+                }
+            }
 
-            extendedOperationsPage = new ExtendedOperationsPage( this );
-            addPage( extendedOperationsPage );
         }
         catch ( PartInitException e )
         {

Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationDetailsPage.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationDetailsPage.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationDetailsPage.java Wed May 14 10:21:46 2008
@@ -0,0 +1,250 @@
+/*
+ *  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.apacheds.configuration.editor.v150;
+
+
+import org.apache.directory.studio.apacheds.configuration.model.v150.ExtendedOperation;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+
+/**
+ * This class represents the Details Page of the Server Configuration Editor for the Extended Operation type
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ExtendedOperationDetailsPage implements IDetailsPage
+{
+    /** The associated Master Details Block */
+    private ExtendedOperationsMasterDetailsBlock masterDetailsBlock;
+
+    /** The Managed Form */
+    private IManagedForm mform;
+
+    /** The input Interceptor */
+    private ExtendedOperation input;
+
+    /** The dirty flag */
+    private boolean dirty = false;
+
+    // UI fields
+    private Text classTypeText;
+
+    // Listeners
+    /** The Modify Listener for Text Widgets */
+    private ModifyListener textModifyListener = new ModifyListener()
+    {
+        public void modifyText( ModifyEvent e )
+        {
+            masterDetailsBlock.setEditorDirty();
+            dirty = true;
+        }
+    };
+
+
+    /**
+     * Creates a new instance of ExtendedOperationDetailsPage.
+     *
+     * @param emdb
+     *      the associated Master Details Block
+     */
+    public ExtendedOperationDetailsPage( ExtendedOperationsMasterDetailsBlock emdb )
+    {
+        masterDetailsBlock = emdb;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
+     */
+    public void createContents( Composite parent )
+    {
+        FormToolkit toolkit = mform.getToolkit();
+        TableWrapLayout layout = new TableWrapLayout();
+        layout.topMargin = 5;
+        layout.leftMargin = 5;
+        layout.rightMargin = 2;
+        layout.bottomMargin = 2;
+        parent.setLayout( layout );
+
+        createDetailsSection( parent, toolkit );
+    }
+
+
+    /**
+     * Creates the Details Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createDetailsSection( Composite parent, FormToolkit toolkit )
+    {
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 10;
+        section.setText( "Extended Operation Details" ); //$NON-NLS-1$
+        section.setDescription( "Set the properties of the extended operation." ); //$NON-NLS-1$
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout( 3, false );
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        // Class
+        toolkit.createLabel( client, "Class:" );
+        classTypeText = toolkit.createText( client, "" );
+        classTypeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+        addListeners();
+    }
+
+
+    /**
+     * Adds listeners to UI fields.
+     */
+    private void addListeners()
+    {
+        classTypeText.addModifyListener( textModifyListener );
+    }
+
+
+    /**
+     * Removes listeners to UI fields.
+     */
+    private void removeListeners()
+    {
+        classTypeText.removeModifyListener( textModifyListener );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse.ui.forms.IFormPart, org.eclipse.jface.viewers.ISelection)
+     */
+    public void selectionChanged( IFormPart part, ISelection selection )
+    {
+        IStructuredSelection ssel = ( IStructuredSelection ) selection;
+        if ( ssel.size() == 1 )
+        {
+            input = ( ExtendedOperation ) ssel.getFirstElement();
+        }
+        else
+        {
+            input = null;
+        }
+        refresh();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
+     */
+    public void commit( boolean onSave )
+    {
+        if ( input != null )
+        {
+            input.setClassType( classTypeText.getText() );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#dispose()
+     */
+    public void dispose()
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#initialize(org.eclipse.ui.forms.IManagedForm)
+     */
+    public void initialize( IManagedForm form )
+    {
+        this.mform = form;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#isDirty()
+     */
+    public boolean isDirty()
+    {
+        return dirty;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#isStale()
+     */
+    public boolean isStale()
+    {
+        return false;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#refresh()
+     */
+    public void refresh()
+    {
+        removeListeners();
+
+        classTypeText.setText( input.getClassType() );
+
+        addListeners();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#setFocus()
+     */
+    public void setFocus()
+    {
+        classTypeText.setFocus();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#setFormInput(java.lang.Object)
+     */
+    public boolean setFormInput( Object input )
+    {
+        return false;
+    }
+}

Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsMasterDetailsBlock.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsMasterDetailsBlock.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsMasterDetailsBlock.java Wed May 14 10:21:46 2008
@@ -0,0 +1,309 @@
+/*
+ *  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.apacheds.configuration.editor.v150;
+
+
+import java.util.List;
+
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginConstants;
+import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ExtendedOperation;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ServerConfigurationV150;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.forms.DetailsPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.MasterDetailsBlock;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * This class represents the Extended Operations Master/Details Block used in the Extended Operations Page.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ExtendedOperationsMasterDetailsBlock extends MasterDetailsBlock
+{
+    /** The associated page */
+    private FormPage page;
+
+    /** The input Server Configuration */
+    private ServerConfigurationV150 serverConfiguration;
+
+    /** The Extended Operations List */
+    private List<ExtendedOperation> extendedOperations;
+
+    /** The Details Page */
+    private ExtendedOperationDetailsPage detailsPage;
+
+    private static final String NEW_NAME = "newExtendedOperation";
+
+    // UI Fields
+    private CheckboxTableViewer viewer;
+    private Button addButton;
+    private Button deleteButton;
+
+
+    /**
+     * Creates a new instance of ExtendedOperationsMasterDetailsBlock.
+     *
+     * @param page
+     */
+    public ExtendedOperationsMasterDetailsBlock( FormPage page )
+    {
+        this.page = page;
+        serverConfiguration = ( ServerConfigurationV150 ) ( ( ServerConfigurationEditor ) page.getEditor() ).getServerConfiguration();
+        extendedOperations = serverConfiguration.getExtendedOperations();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
+     */
+    protected void createMasterPart( final IManagedForm managedForm, Composite parent )
+    {
+        FormToolkit toolkit = managedForm.getToolkit();
+
+        // Creating the Section
+        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
+        section.setText( "All Extended Operations" );
+        section.marginWidth = 10;
+        section.marginHeight = 5;
+        Composite client = toolkit.createComposite( section, SWT.WRAP );
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.makeColumnsEqualWidth = false;
+        layout.marginWidth = 2;
+        layout.marginHeight = 2;
+        client.setLayout( layout );
+        toolkit.paintBordersFor( client );
+        section.setClient( client );
+
+        // Creatig the Table and Table Viewer
+        Table table = toolkit.createTable( client, SWT.CHECK );
+        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 2 );
+        gd.heightHint = 20;
+        gd.widthHint = 100;
+        table.setLayoutData( gd );
+        final SectionPart spart = new SectionPart( section );
+        managedForm.addPart( spart );
+        viewer = new CheckboxTableViewer( table );
+        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        {
+            public void selectionChanged( SelectionChangedEvent event )
+            {
+                managedForm.fireSelectionChanged( spart, event.getSelection() );
+            }
+        } );
+        viewer.setContentProvider( new ArrayContentProvider() );
+        viewer.setLabelProvider( new LabelProvider()
+        {
+            public Image getImage( Object element )
+            {
+                return ApacheDSConfigurationPlugin.getDefault().getImage(
+                    ApacheDSConfigurationPluginConstants.IMG_EXTENDED_OPERATION );
+            }
+        } );
+
+        // Creating the button(s)
+        addButton = toolkit.createButton( client, "Add...", SWT.PUSH ); //$NON-NLS-1$
+        addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
+
+        deleteButton = toolkit.createButton( client, "Delete", SWT.PUSH );
+        deleteButton.setEnabled( false );
+        deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
+
+        initFromInput();
+        addListeners();
+    }
+
+
+    /**
+     * Initializes the page with the Editor input.
+     */
+    private void initFromInput()
+    {
+        viewer.setInput( extendedOperations );
+    }
+
+
+    /**
+     * Add listeners to UI fields.
+     */
+    private void addListeners()
+    {
+        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        {
+            public void selectionChanged( SelectionChangedEvent event )
+            {
+                viewer.refresh();
+
+                deleteButton.setEnabled( !event.getSelection().isEmpty() );
+            }
+        } );
+
+        addButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                ExtendedOperation newExtendedOperation = new ExtendedOperation( getNewName() );
+                extendedOperations.add( newExtendedOperation );
+                viewer.refresh();
+                viewer.setSelection( new StructuredSelection( newExtendedOperation ) );
+                setEditorDirty();
+            }
+        } );
+
+        deleteButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
+                if ( !selection.isEmpty() )
+                {
+                    ExtendedOperation extendedOperation = ( ExtendedOperation ) selection.getFirstElement();
+
+                    extendedOperations.remove( extendedOperation );
+                    viewer.refresh();
+                    setEditorDirty();
+                }
+            }
+        } );
+    }
+
+
+    /**
+     * Gets a new Name for a new Extended Operation.
+     *
+     * @return 
+     *      a new Name for a new Extended Operation
+     */
+    private String getNewName()
+    {
+        int counter = 1;
+        String name = NEW_NAME;
+        boolean ok = false;
+
+        while ( !ok )
+        {
+            ok = true;
+            name = NEW_NAME + counter;
+
+            for ( ExtendedOperation extendedOperation : extendedOperations )
+            {
+                if ( extendedOperation.getClassType().equalsIgnoreCase( name ) )
+                {
+                    ok = false;
+                }
+            }
+
+            counter++;
+        }
+
+        return name;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.MasterDetailsBlock#createToolBarActions(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createToolBarActions( IManagedForm managedForm )
+    {
+        final ScrolledForm form = managedForm.getForm();
+
+        // Horizontal layout Action
+        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
+            public void run()
+            {
+                sashForm.setOrientation( SWT.HORIZONTAL );
+                form.reflow( true );
+            }
+        };
+        horizontalAction.setChecked( true );
+        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
+        horizontalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
+            ApacheDSConfigurationPluginConstants.IMG_HORIZONTAL_ORIENTATION ) );
+
+        // Vertical layout Action
+        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
+            public void run()
+            {
+                sashForm.setOrientation( SWT.VERTICAL );
+                form.reflow( true );
+            }
+        };
+        verticalAction.setChecked( false );
+        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
+        verticalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
+            ApacheDSConfigurationPluginConstants.IMG_VERTICAL_ORIENTATION ) );
+
+        form.getToolBarManager().add( horizontalAction );
+        form.getToolBarManager().add( verticalAction );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.MasterDetailsBlock#registerPages(org.eclipse.ui.forms.DetailsPart)
+     */
+    protected void registerPages( DetailsPart detailsPart )
+    {
+        detailsPage = new ExtendedOperationDetailsPage( this );
+        detailsPart.registerPage( ExtendedOperation.class, detailsPage );
+    }
+
+
+    /**
+     * Sets the Editor as dirty.
+     */
+    public void setEditorDirty()
+    {
+        ( ( ServerConfigurationEditor ) page.getEditor() ).setDirty( true );
+    }
+
+
+    /**
+     * Saves the necessary elements to the input model.
+     */
+    public void save()
+    {
+        detailsPage.commit( true );
+        viewer.setInput( extendedOperations );
+    }
+}

Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsPage.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsPage.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ExtendedOperationsPage.java Wed May 14 10:21:46 2008
@@ -0,0 +1,83 @@
+/*
+ *  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.apacheds.configuration.editor.v150;
+
+
+import org.apache.directory.studio.apacheds.configuration.editor.SavableFormPage;
+import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * This class represents the Extended Operations Page of the Server Configuration Editor.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ExtendedOperationsPage extends FormPage implements SavableFormPage
+{
+    /** The Page ID*/
+    public static final String ID = ServerConfigurationEditor.ID + ".V150.ExtendedOperationsPage";
+
+    /** The Page Title */
+    private static final String TITLE = "Extended Operations";
+
+    /** The Master/Details Block */
+    private ExtendedOperationsMasterDetailsBlock masterDetailsBlock;
+
+
+    /**
+     * Creates a new instance of ExtendedOperationsPage.
+     *
+     * @param editor
+     *      the associated editor
+     */
+    public ExtendedOperationsPage( FormEditor editor )
+    {
+        super( editor, ID, TITLE );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createFormContent( IManagedForm managedForm )
+    {
+        final ScrolledForm form = managedForm.getForm();
+        form.setText( "Extended Operations" );
+        masterDetailsBlock = new ExtendedOperationsMasterDetailsBlock( this );
+        masterDetailsBlock.createContent( managedForm );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.configuration.editor.SavableWizardPage#save()
+     */
+    public void save()
+    {
+        if ( masterDetailsBlock != null )
+        {
+            masterDetailsBlock.save();
+        }
+    }
+}

Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/GeneralPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/GeneralPage.java?rev=656336&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/GeneralPage.java (added)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/GeneralPage.java Wed May 14 10:21:46 2008
@@ -0,0 +1,639 @@
+/*
+ *  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.apacheds.configuration.editor.v150;
+
+
+import java.util.List;
+
+import org.apache.directory.studio.apacheds.configuration.editor.SavableFormPage;
+import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
+import org.apache.directory.studio.apacheds.configuration.editor.v150.dialogs.BinaryAttributeDialog;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ServerConfigurationV150;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+
+/**
+ * This class represents the General Page of the Server Configuration Editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class GeneralPage extends FormPage implements SavableFormPage
+{
+    /** The Page ID*/
+    public static final String ID = ServerConfigurationEditor.ID + ".BasicPage";
+
+    /** The Page Title */
+    private static final String TITLE = "General";
+
+    /** The Binary Attribute List */
+    private List<String> binaryAttributes;
+
+    // UI Fields
+    private Text portText;
+    private Combo authenticationCombo;
+    private Text principalText;
+    private Text passwordText;
+    private Button showPasswordCheckbox;
+    private Button allowAnonymousAccessCheckbox;
+    private Text maxTimeLimitText;
+    private Text maxSizeLimitText;
+    private Text synchPeriodText;
+    private Text maxThreadsText;
+    private Button enableAccesControlCheckbox;
+    private Button enableNTPCheckbox;
+    private Button enableKerberosCheckbox;
+    private Button enableChangePasswordCheckbox;
+    private Button denormalizeOpAttrCheckbox;
+    private TableViewer binaryAttributesTableViewer;
+    private Button binaryAttributesAddButton;
+    private Button binaryAttributesEditButton;
+    private Button binaryAttributesDeleteButton;
+
+
+    /**
+     * Creates a new instance of GeneralPage.
+     *
+     * @param editor
+     *      the associated editor
+     */
+    public GeneralPage( FormEditor editor )
+    {
+        super( editor, ID, TITLE );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+     */
+    protected void createFormContent( IManagedForm managedForm )
+    {
+        ScrolledForm form = managedForm.getForm();
+        form.setText( "General" );
+
+        Composite parent = form.getBody();
+        TableWrapLayout twl = new TableWrapLayout();
+        twl.numColumns = 2;
+        parent.setLayout( twl );
+        FormToolkit toolkit = managedForm.getToolkit();
+
+        createSettingsSection( parent, toolkit );
+        createBinaryAttributesSection( parent, toolkit );
+        createLimitsSection( parent, toolkit );
+        createOptionsSection( parent, toolkit );
+
+        initFromInput();
+        addListeners();
+    }
+
+
+    /**
+     * Creates the Settings Section.
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createSettingsSection( Composite parent, FormToolkit toolkit )
+    {
+        // Creation of the section
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 4;
+        section.setText( "Settings" );
+        section.setDescription( "Set the settings of the server." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout( 2, false );
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        // Port
+        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:" );
+        authenticationCombo = new Combo( client, SWT.SIMPLE );
+        authenticationCombo.setItems( new String[]
+            { "Simple" } );
+        authenticationCombo.setText( "Simple" );
+        authenticationCombo.setEnabled( false );
+        authenticationCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Principal
+        toolkit.createLabel( client, "Principal:" );
+        principalText = toolkit.createText( client, "" );
+        principalText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Password
+        toolkit.createLabel( client, "Password:" );
+        passwordText = toolkit.createText( client, "" );
+        passwordText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        passwordText.setEchoChar( '\u2022' );
+
+        // Show Password
+        toolkit.createLabel( client, "" );
+        showPasswordCheckbox = toolkit.createButton( client, "Show password", SWT.CHECK );
+        showPasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        showPasswordCheckbox.setSelection( false );
+        showPasswordCheckbox.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                if ( showPasswordCheckbox.getSelection() )
+                {
+                    passwordText.setEchoChar( '\0' );
+                }
+                else
+                {
+                    passwordText.setEchoChar( '\u2022' );
+                }
+            }
+        } );
+
+        // Allow Anonymous Access
+        allowAnonymousAccessCheckbox = toolkit.createButton( client, "Allow Anonymous Access", SWT.CHECK );
+        allowAnonymousAccessCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+    }
+
+
+    /**
+     * Creates the Limits Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createLimitsSection( Composite parent, FormToolkit toolkit )
+    {
+        // Creation of the section
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 4;
+        section.setText( "Limits" );
+        section.setDescription( "Set the limits of the server." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout( 2, false );
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        // Max. Time Limit
+        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:" );
+        maxThreadsText = toolkit.createText( client, "" );
+        maxThreadsText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        maxThreadsText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+    }
+
+
+    /**
+     * Creates the Options Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createOptionsSection( Composite parent, FormToolkit toolkit )
+    {
+        // Creation of the section
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 4;
+        section.setText( "Options" );
+        section.setDescription( "Set the options of the server." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout();
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        // Enable Access Control
+        enableAccesControlCheckbox = toolkit.createButton( client, "Enable Access Control", SWT.CHECK );
+        enableAccesControlCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Enable NTP
+        enableNTPCheckbox = toolkit.createButton( client, "Enable NTP", SWT.CHECK );
+        enableNTPCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Denormalize Operational Attributes
+        denormalizeOpAttrCheckbox = toolkit.createButton( client, "Denormalize Operational Attributes", SWT.CHECK );
+        denormalizeOpAttrCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Enable Kerberos
+        enableKerberosCheckbox = toolkit.createButton( client, "Enable Kerberos", SWT.CHECK );
+        enableKerberosCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        enableKerberosCheckbox.setEnabled( false );
+
+        // Enable Change Password
+        enableChangePasswordCheckbox = toolkit.createButton( client, "Enable Change Password", SWT.CHECK );
+        enableChangePasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        enableChangePasswordCheckbox.setEnabled( false );
+    }
+
+
+    /**
+     * Creates the Options Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createBinaryAttributesSection( Composite parent, FormToolkit toolkit )
+    {
+        // Creation of the section
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 4;
+        section.setText( "Binary Attributes" );
+        section
+            .setDescription( "Set attribute type names and OID's if you want an them to be handled as binary content." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout( 2, false );
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        Table binaryAttributesTable = toolkit.createTable( client, SWT.NONE );
+        GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
+        gd.heightHint = 103;
+        binaryAttributesTable.setLayoutData( gd );
+        binaryAttributesTableViewer = new TableViewer( binaryAttributesTable );
+        binaryAttributesTableViewer.setContentProvider( new ArrayContentProvider() );
+        binaryAttributesTableViewer.setLabelProvider( new LabelProvider() );
+
+        GridData buttonsGD = new GridData( SWT.FILL, SWT.BEGINNING, false, false );
+        buttonsGD.widthHint = IDialogConstants.BUTTON_WIDTH;
+
+        binaryAttributesAddButton = toolkit.createButton( client, "Add...", SWT.PUSH );
+        binaryAttributesAddButton.setLayoutData( buttonsGD );
+
+        binaryAttributesEditButton = toolkit.createButton( client, "Edit...", SWT.PUSH );
+        binaryAttributesEditButton.setEnabled( false );
+        binaryAttributesEditButton.setLayoutData( buttonsGD );
+
+        binaryAttributesDeleteButton = toolkit.createButton( client, "Delete", SWT.PUSH );
+        binaryAttributesDeleteButton.setEnabled( false );
+        binaryAttributesDeleteButton.setLayoutData( buttonsGD );
+    }
+
+
+    /**
+     * Initializes the page with the Editor input.
+     */
+    private void initFromInput()
+    {
+        ServerConfigurationV150 configuration = ( ServerConfigurationV150 ) ( ( ServerConfigurationEditor ) getEditor() )
+            .getServerConfiguration();
+
+        binaryAttributes = configuration.getBinaryAttributes();
+        binaryAttributesTableViewer.setInput( binaryAttributes );
+
+        // Port
+        portText.setText( "" + configuration.getPort() );
+
+        // Principal
+        String principal = configuration.getPrincipal();
+        if ( principal != null )
+        {
+            principalText.setText( principal );
+        }
+
+        // Password
+        String password = configuration.getPassword();
+        if ( password != null )
+        {
+            passwordText.setText( password );
+        }
+
+        // Allow Anonymous Access
+        allowAnonymousAccessCheckbox.setSelection( configuration.isAllowAnonymousAccess() );
+
+        // Max Time Limit
+        maxTimeLimitText.setText( "" + configuration.getMaxTimeLimit() );
+
+        // Max Size Limit
+        maxSizeLimitText.setText( "" + configuration.getMaxSizeLimit() );
+
+        // Synchronization Period
+        synchPeriodText.setText( "" + configuration.getSynchronizationPeriod() );
+
+        // Max Threads
+        maxThreadsText.setText( "" + configuration.getMaxThreads() );
+
+        // Enable Access Control
+        enableAccesControlCheckbox.setSelection( configuration.isEnableAccessControl() );
+
+        // Enable NTP
+        enableNTPCheckbox.setSelection( configuration.isEnableNTP() );
+
+        // Enable Kerberos
+        enableKerberosCheckbox.setSelection( configuration.isEnableKerberos() );
+
+        // Enable Change Password
+        enableChangePasswordCheckbox.setSelection( configuration.isEnableChangePassword() );
+
+        // Denormalize Op Attr
+        denormalizeOpAttrCheckbox.setSelection( configuration.isDenormalizeOpAttr() );
+    }
+
+
+    /**
+     * Add listeners to UI fields.
+     */
+    private void addListeners()
+    {
+        // The Modify Listener
+        ModifyListener modifyListener = new ModifyListener()
+        {
+            public void modifyText( ModifyEvent e )
+            {
+                setEditorDirty();
+            }
+        };
+
+        //  The Selection Listener
+        SelectionListener selectionListener = new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                setEditorDirty();
+            }
+        };
+
+        // The ISelectionChangedListener for the Binary Attributes Table
+        ISelectionChangedListener binaryAttributesTableViewerListener = new ISelectionChangedListener()
+        {
+            public void selectionChanged( SelectionChangedEvent event )
+            {
+                binaryAttributesEditButton.setEnabled( !event.getSelection().isEmpty() );
+                binaryAttributesDeleteButton.setEnabled( !event.getSelection().isEmpty() );
+            }
+        };
+
+        // The IDoubleClickListener for the Binary Attributes Table
+        IDoubleClickListener binaryAttributesTableViewerDoubleClickListener = new IDoubleClickListener()
+        {
+            public void doubleClick( DoubleClickEvent event )
+            {
+                editSelectedBinaryAttribute();
+            }
+        };
+
+        // The SelectionListener for the Binary Attributes Add Button
+        SelectionListener binaryAttributesAddButtonListener = new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                BinaryAttributeDialog dialog = new BinaryAttributeDialog( "" );
+                if ( Dialog.OK == dialog.open() && dialog.isDirty() )
+                {
+                    String newAttribute = dialog.getAttribute();
+                    if ( newAttribute != null && !"".equals( newAttribute )
+                        && !binaryAttributes.contains( newAttribute ) )
+                    {
+                        binaryAttributes.add( newAttribute );
+
+                        binaryAttributesTableViewer.refresh();
+                        setEditorDirty();
+                    }
+                }
+            }
+        };
+
+        // The SelectionListener for the Binary Attributes Edit Button
+        SelectionListener binaryAttributesEditButtonListener = new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                editSelectedBinaryAttribute();
+            }
+        };
+
+        // The SelectionListener for the Binary Attributes Delete Button
+        SelectionListener binaryAttributesDeleteButtonListener = new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection();
+                if ( !selection.isEmpty() )
+                {
+                    String attribute = ( String ) selection.getFirstElement();
+                    binaryAttributes.remove( attribute );
+
+                    binaryAttributesTableViewer.refresh();
+                    setEditorDirty();
+                }
+            }
+        };
+
+        portText.addModifyListener( modifyListener );
+        authenticationCombo.addModifyListener( modifyListener );
+        principalText.addModifyListener( modifyListener );
+        passwordText.addModifyListener( modifyListener );
+        allowAnonymousAccessCheckbox.addSelectionListener( selectionListener );
+        maxTimeLimitText.addModifyListener( modifyListener );
+        maxSizeLimitText.addModifyListener( modifyListener );
+        synchPeriodText.addModifyListener( modifyListener );
+        maxThreadsText.addModifyListener( modifyListener );
+        enableAccesControlCheckbox.addSelectionListener( selectionListener );
+        enableNTPCheckbox.addSelectionListener( selectionListener );
+        enableKerberosCheckbox.addSelectionListener( selectionListener );
+        enableChangePasswordCheckbox.addSelectionListener( selectionListener );
+        denormalizeOpAttrCheckbox.addSelectionListener( selectionListener );
+        binaryAttributesTableViewer.addSelectionChangedListener( binaryAttributesTableViewerListener );
+        binaryAttributesTableViewer.addDoubleClickListener( binaryAttributesTableViewerDoubleClickListener );
+        binaryAttributesAddButton.addSelectionListener( binaryAttributesAddButtonListener );
+        binaryAttributesEditButton.addSelectionListener( binaryAttributesEditButtonListener );
+        binaryAttributesDeleteButton.addSelectionListener( binaryAttributesDeleteButtonListener );
+    }
+
+
+    /**
+     * Opens a Binary Attribute Dialog with the selected Attribute Value Object in the
+     * Binary Attributes Table Viewer.
+     */
+    private void editSelectedBinaryAttribute()
+    {
+        StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection();
+        if ( !selection.isEmpty() )
+        {
+            String oldAttribute = ( String ) selection.getFirstElement();
+
+            BinaryAttributeDialog dialog = new BinaryAttributeDialog( oldAttribute );
+            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
+            {
+                binaryAttributes.remove( oldAttribute );
+
+                String newAttribute = dialog.getAttribute();
+                if ( newAttribute != null && !"".equals( newAttribute ) && !binaryAttributes.contains( newAttribute ) )
+                {
+                    binaryAttributes.add( newAttribute );
+                }
+
+                binaryAttributesTableViewer.refresh();
+                setEditorDirty();
+            }
+        }
+    }
+
+
+    /**
+     * Sets the Editor as dirty.
+     */
+    private void setEditorDirty()
+    {
+        ( ( ServerConfigurationEditor ) getEditor() ).setDirty( true );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.configuration.editor.SavableWizardPage#save()
+     */
+    public void save()
+    {
+        ServerConfigurationV150 serverConfiguration = ( ServerConfigurationV150 ) ( ( ServerConfigurationEditor ) getEditor() )
+            .getServerConfiguration();
+
+        serverConfiguration.setPort( Integer.parseInt( portText.getText() ) );
+        serverConfiguration.setPrincipal( principalText.getText() );
+        serverConfiguration.setPassword( passwordText.getText() );
+        serverConfiguration.setAllowAnonymousAccess( allowAnonymousAccessCheckbox.getSelection() );
+        serverConfiguration.setMaxTimeLimit( Integer.parseInt( maxTimeLimitText.getText() ) );
+        serverConfiguration.setMaxSizeLimit( Integer.parseInt( maxSizeLimitText.getText() ) );
+        serverConfiguration.setSynchronizationPeriod( Long.parseLong( synchPeriodText.getText() ) );
+        serverConfiguration.setMaxThreads( Integer.parseInt( maxThreadsText.getText() ) );
+        serverConfiguration.setEnableAccessControl( enableAccesControlCheckbox.getSelection() );
+        serverConfiguration.setEnableNTP( enableNTPCheckbox.getSelection() );
+        serverConfiguration.setEnableKerberos( enableKerberosCheckbox.getSelection() );
+        serverConfiguration.setEnableChangePassword( enableChangePasswordCheckbox.getSelection() );
+        serverConfiguration.setDenormalizeOpAttr( denormalizeOpAttrCheckbox.getSelection() );
+    }
+
+}



Mime
View raw message