directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1177322 - in /directory/studio/trunk/plugins/ldapservers: ./ resources/ src/main/java/org/apache/directory/studio/ldapservers/ src/main/java/org/apache/directory/studio/ldapservers/model/ src/main/java/org/apache/directory/studio/ldapserve...
Date Thu, 29 Sep 2011 14:33:01 GMT
Author: pamarcelot
Date: Thu Sep 29 14:33:00 2011
New Revision: 1177322

URL: http://svn.apache.org/viewvc?rev=1177322&view=rev
Log:
Added the possibility to include a configuration page for each LDAP Server Adapter.
This configuration page adds a new Configuration wizard page and a new Configuration property page.
Configuration parameters are saved in the LDAP Server (which is saved on the disk).

Added:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/AbstractLdapServerAdapterConfigurationPage.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPage.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPageModifyListener.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyConfigurationPage.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardConfigurationPage.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardSelectionPage.java
      - copied, changed from r1176428, directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java
Removed:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java
Modified:
    directory/studio/trunk/plugins/ldapservers/plugin.xml
    directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersManagerIO.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServer.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerActionFilterAdapter.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java

Modified: directory/studio/trunk/plugins/ldapservers/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/plugin.xml?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/plugin.xml (original)
+++ directory/studio/trunk/plugins/ldapservers/plugin.xml Thu Sep 29 14:33:00 2011
@@ -68,6 +68,18 @@
             </instanceof>
          </enabledWhen>
       </page>
+      <page
+            class="org.apache.directory.studio.ldapservers.properties.ServerPropertyConfigurationPage"
+            id="org.apache.directory.studio.ldapservers.properties.ServerPropertyConfigurationPage"
+            category="org.apache.directory.studio.ldapservers.properties.ServerPropertyPage"
+            name="Configuration">
+         <enabledWhen>
+            <instanceof
+                  value="org.apache.directory.studio.ldapservers.model.LdapServer">
+            </instanceof>
+         </enabledWhen>
+            <filter name="hasConfigurationPage" value="true"/> 
+      </page>
    </extension>
    
    <extension

Modified: directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd (original)
+++ directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd Thu Sep 29 14:33:00 2011
@@ -1,28 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
+<?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
 <schema targetNamespace="org.apache.directory.studio.ldapservers" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
-      <appinfo>
+      <appInfo>
          <meta.schema plugin="org.apache.directory.studio.ldapservers" id="ldapServerAdapters" name="LDAP Server Adapters"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          This extension point defines a way to add LDAP Server Adapters to the LDAP Servers plugin of Apache Directory Studio.
       </documentation>
@@ -30,9 +12,9 @@
 
    <element name="extension">
       <annotation>
-         <appinfo>
+         <appInfo>
             <meta.element />
-         </appinfo>
+         </appInfo>
       </annotation>
       <complexType>
          <sequence>
@@ -57,9 +39,9 @@
                <documentation>
                   
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute translatable="true"/>
-               </appinfo>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
@@ -107,9 +89,9 @@
                <documentation>
                   The icon of the LDAP Server Adapter
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute kind="resource"/>
-               </appinfo>
+               </appInfo>
             </annotation>
          </attribute>
          <attribute name="class" type="string" use="required">
@@ -117,45 +99,55 @@
                <documentation>
                   The class of the LDAP Server Adapter
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute kind="java" basedOn=":org.apache.directory.studio.ldapservers.LdapServerAdapter"/>
-               </appinfo>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="configurationPage" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPage"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
    </element>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="since"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          2.0.0
       </documentation>
    </annotation>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="examples"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          [Enter extension point usage example here.]
       </documentation>
    </annotation>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="apiinfo"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          [Enter API information here.]
       </documentation>
    </annotation>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="implementation"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          [Enter information about supplied implementation of this extension point.]
       </documentation>

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java Thu Sep 29 14:33:00 2011
@@ -44,13 +44,14 @@ import org.eclipse.ui.plugin.AbstractUIP
 public class LdapServerAdapterExtensionsManager
 {
     // Attributes names used in 'plugin.xml' file
-    private static final String ID_ATTR = "id"; //$NON-NLS-1$
-    private static final String NAME_ATTR = "name"; //$NON-NLS-1$
-    private static final String VERSION_ATTR = "version"; //$NON-NLS-1$
-    private static final String VENDOR_ATTR = "vendor"; //$NON-NLS-1$
-    private static final String CLASS_ATTR = "class"; //$NON-NLS-1$
-    private static final String DESCRIPTION_ATTR = "description"; //$NON-NLS-1$
-    private static final String ICON_ATTR = "icon"; //$NON-NLS-1$
+    public static final String ID_ATTR = "id"; //$NON-NLS-1$
+    public static final String NAME_ATTR = "name"; //$NON-NLS-1$
+    public static final String VERSION_ATTR = "version"; //$NON-NLS-1$
+    public static final String VENDOR_ATTR = "vendor"; //$NON-NLS-1$
+    public static final String CLASS_ATTR = "class"; //$NON-NLS-1$
+    public static final String DESCRIPTION_ATTR = "description"; //$NON-NLS-1$
+    public static final String ICON_ATTR = "icon"; //$NON-NLS-1$
+    public static final String CONFIGURATION_PAGE_ATTR = "configurationPage"; //$NON-NLS-1$
 
     /** The default instance */
     private static LdapServerAdapterExtensionsManager instance;
@@ -94,6 +95,7 @@ public class LdapServerAdapterExtensions
             String extendingPluginId = member.getDeclaringExtension().getNamespaceIdentifier();
 
             // Setting each parameter to the LDAP Server Adapter Extension
+            ldapServerAdapterExtension.setExtensionPointConfiguration( member );
             ldapServerAdapterExtension.setId( member.getAttribute( ID_ATTR ) );
             ldapServerAdapterExtension.setName( member.getAttribute( NAME_ATTR ) );
             ldapServerAdapterExtension.setVersion( member.getAttribute( VERSION_ATTR ) );
@@ -119,6 +121,7 @@ public class LdapServerAdapterExtensions
                 }
                 ldapServerAdapterExtension.setIcon( icon );
             }
+            ldapServerAdapterExtension.setConfigurationPageClassName( member.getAttribute( CONFIGURATION_PAGE_ATTR ) );
 
             ldapServerAdapterExtensionsList.add( ldapServerAdapterExtension );
             ldapServerAdapterExtensionsByIdMap.put( ldapServerAdapterExtension.getId(), ldapServerAdapterExtension );

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersManagerIO.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersManagerIO.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersManagerIO.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersManagerIO.java Thu Sep 29 14:33:00 2011
@@ -26,6 +26,9 @@ import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
 
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapterExtension;
@@ -56,6 +59,11 @@ public class LdapServersManagerIO
     private static final String ADAPTER_NAME_ATTRIBUTE = "adapterName"; //$NON-NLS-1$
     private static final String ADAPTER_VENDOR_ATTRIBUTE = "adapterVendor"; //$NON-NLS-1$
     private static final String ADAPTER_VERSION_ATTRIBUTE = "adapterVersion"; //$NON-NLS-1$
+    private static final String CONFIGURATION_PARAMETERS_TAG = "configurationParameters"; //$NON-NLS-1$
+    private static final String ENTRY_TAG = "entry"; //$NON-NLS-1$
+    private static final String KEY_ATTRIBUTE = "key"; //$NON-NLS-1$
+    private static final String TYPE_ATTRIBUTE = "type"; //$NON-NLS-1$
+    private static final String VALUE_ATTRIBUTE = "value"; //$NON-NLS-1$
 
 
     /**
@@ -180,11 +188,71 @@ public class LdapServersManagerIO
             // TODO No Adapter ID, throw an error ?
         }
 
+        // Configuration Parameters
+        Element configurationParametersElement = element.element( CONFIGURATION_PARAMETERS_TAG );
+        if ( configurationParametersElement != null )
+        {
+            for ( Iterator<?> i = configurationParametersElement.elementIterator( ENTRY_TAG ); i.hasNext(); )
+            {
+                readConfigurationParameter( server, ( Element ) i.next() );
+            }
+        }
+
         return server;
     }
 
 
     /**
+     * Reads a configuration parameter.
+     *
+     * @param server the server
+     * @param element the element
+     */
+    private static void readConfigurationParameter( LdapServer server, Element element )
+    {
+        // Key
+        Attribute keyAttribute = element.attribute( KEY_ATTRIBUTE );
+        String key = null;
+        if ( keyAttribute != null )
+        {
+            key = keyAttribute.getValue();
+
+            // Value
+            Attribute valueAttribute = element.attribute( VALUE_ATTRIBUTE );
+            String value = null;
+            if ( valueAttribute != null )
+            {
+                value = valueAttribute.getValue();
+            }
+
+            // Type
+            Attribute typeAttribute = element.attribute( TYPE_ATTRIBUTE );
+            String type = null;
+            if ( typeAttribute != null )
+            {
+                type = typeAttribute.getValue();
+            }
+
+            // Integer value
+            if ( ( type != null ) && ( type.equalsIgnoreCase( Integer.class.getCanonicalName() ) ) )
+            {
+                server.putConfigurationParameter( key, Integer.parseInt( value ) );
+            }
+            // Boolean value
+            else if ( ( type != null ) && ( type.equalsIgnoreCase( Boolean.class.getCanonicalName() ) ) )
+            {
+                server.putConfigurationParameter( key, Boolean.parseBoolean( value ) );
+            }
+            // String value (default type)
+            else
+            {
+                server.putConfigurationParameter( key, value );
+            }
+        }
+    }
+
+
+    /**
      * Writes the list of servers to the given stream.
      *
      * @param servers
@@ -249,5 +317,47 @@ public class LdapServersManagerIO
 
         // Adapter Version
         serverElement.addAttribute( ADAPTER_VERSION_ATTRIBUTE, server.getLdapServerAdapterExtension().getVersion() );
+
+        // Configuration Parameters
+        Map<String, Object> configurationParametersMap = server.getConfigurationParameters();
+        if ( ( configurationParametersMap != null ) && ( configurationParametersMap.size() > 0 ) )
+        {
+            addConfigurationParameters( configurationParametersMap, serverElement );
+        }
+    }
+
+
+    /**
+     * Adds the XML representation of the configuration elements to the given parent. 
+     *
+     * @param map the configuration elements map
+     * @param element the parent element
+     */
+    private static void addConfigurationParameters( Map<String, Object> map, Element parent )
+    {
+        // Configuration Parameters element
+        Element configurationParametersElement = parent.addElement( CONFIGURATION_PARAMETERS_TAG );
+
+        // Get the keys of the map
+        Set<Entry<String, Object>> entriesSet = map.entrySet();
+
+        for ( Entry<String, Object> entry : entriesSet )
+        {
+            // Entry element
+            Element entryElement = configurationParametersElement.addElement( ENTRY_TAG );
+
+            // Key
+            entryElement.addAttribute( KEY_ATTRIBUTE, entry.getKey() );
+
+            // Value
+            Object value = entry.getValue();
+            entryElement.addAttribute( VALUE_ATTRIBUTE, value.toString() );
+
+            // Type
+            if ( value.getClass() != String.class )
+            {
+                entryElement.addAttribute( TYPE_ATTRIBUTE, value.getClass().getCanonicalName() );
+            }
+        }
     }
 }

Added: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/AbstractLdapServerAdapterConfigurationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/AbstractLdapServerAdapterConfigurationPage.java?rev=1177322&view=auto
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/AbstractLdapServerAdapterConfigurationPage.java (added)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/AbstractLdapServerAdapterConfigurationPage.java Thu Sep 29 14:33:00 2011
@@ -0,0 +1,205 @@
+/*
+ *  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.ldapservers.model;
+
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+
+/**
+ * This interface defines a configuration page for an {@link LdapServerAdapter}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public abstract class AbstractLdapServerAdapterConfigurationPage implements LdapServerAdapterConfigurationPage
+{
+    /** The id */
+    protected String id;
+
+    /** The title */
+    protected String title;
+
+    /** The description */
+    protected String description;
+
+    /** The image descriptor */
+    protected ImageDescriptor imageDescriptor;
+
+    /** The error message */
+    protected String errorMessage;
+
+    /** The flag for page completion */
+    protected boolean pageComplete = true;
+
+    /** The modify listener */
+    protected LdapServerAdapterConfigurationPageModifyListener modifyListener;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDescription()
+    {
+        return description;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getErrorMessage()
+    {
+        return errorMessage;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return imageDescriptor;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getTitle()
+    {
+        return title;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isPageComplete()
+    {
+        return pageComplete;
+    }
+
+
+    /**
+     * Sets the description.
+     * 
+     * @param description the description to set
+     */
+    public void setDescription( String description )
+    {
+        this.description = description;
+    }
+
+
+    /**
+     * Sets the error message.
+     * 
+     * @param errorMessage the errorMessage to set
+     */
+    public void setErrorMessage( String errorMessage )
+    {
+        this.errorMessage = errorMessage;
+        setPageComplete(  errorMessage == null );
+    }
+
+
+    /**
+     * Sets the id.
+     * 
+     * @param id the id to set
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+
+    /**
+     * Sets the {@link ImageDescriptor}.
+     * 
+     * @param imageDescriptor the imageDescriptor to set
+     */
+    public void setImageDescriptor( ImageDescriptor imageDescriptor )
+    {
+        this.imageDescriptor = imageDescriptor;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setModifyListener( LdapServerAdapterConfigurationPageModifyListener modifyListener )
+    {
+        this.modifyListener = modifyListener;
+    }
+
+
+    /**
+     * Sets the page completion flag.
+     * 
+     * @param pageComplete the pageComplete to set
+     */
+    public void setPageComplete( boolean pageComplete )
+    {
+        this.pageComplete = pageComplete;
+    }
+
+
+    /**
+     * Sets the title.
+     * 
+     * @param title the title to set
+     */
+    public void setTitle( String title )
+    {
+        this.title = title;
+    }
+
+
+    /**
+     * Called when an input field is modified.
+     */
+    protected final void configurationPageModified()
+    {
+        validate();
+        fireConfigurationPageModified();
+    }
+
+
+    /**
+     * Fires a configuration page modified event when the page was modified.
+     */
+    protected void fireConfigurationPageModified()
+    {
+        if ( modifyListener != null )
+        {
+            modifyListener.configurationPageModified();
+        }
+    }
+}

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServer.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServer.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServer.java Thu Sep 29 14:33:00 2011
@@ -57,6 +57,9 @@ public class LdapServer implements IAdap
     /** The Map for custom objects */
     private Map<String, Object> customObjectsMap = new HashMap<String, Object>();
 
+    /** The Map for configuration parameters  */
+    private Map<String, Object> configurationParameters = new HashMap<String, Object>();
+
 
     /**
      * Creates a new instance of LDAP Server.
@@ -128,6 +131,33 @@ public class LdapServer implements IAdap
 
 
     /**
+     * Returns the value to which the specified key is mapped, 
+     * or null if no mapping for the key is found.
+     *
+     * @param key
+     *      the key
+     * @return
+     *      the value to which the specified key is mapped, 
+     *      or null if no mapping for the key is found.
+     */
+    public Object getConfigurationParameter( String key )
+    {
+        return configurationParameters.get( key );
+    }
+
+
+    /**
+     * Gets the configuration parameters.
+     * 
+     * @return the configuration parameters
+     */
+    public Map<String, Object> getConfigurationParameters()
+    {
+        return configurationParameters;
+    }
+
+
+    /**
      * Gets the id of the server.
      *
      * @return
@@ -190,6 +220,20 @@ public class LdapServer implements IAdap
 
 
     /**
+     * Associates the specified value with the specified key.
+     *
+     * @param key
+     *      the key
+     * @param value
+     *      the value
+     */
+    public void putConfigurationParameter( String key, Object value )
+    {
+        configurationParameters.put( key, value );
+    }
+
+
+    /**
      * Removes the value to which the specified key is mapped.
      * <p>
      * Returns the value previously associated the key,
@@ -205,6 +249,21 @@ public class LdapServer implements IAdap
 
 
     /**
+     * Removes the value to which the specified key is mapped.
+     * <p>
+     * Returns the value previously associated the key,
+     * or null if there was no mapping for the key.
+     *
+     * @param key
+     * @return
+     */
+    public Object removeConfigurationParameter( String key )
+    {
+        return configurationParameters.remove( key );
+    }
+
+
+    /**
      * Removes the {@link LdapServerListener} from the server.
      *
      * @param listener
@@ -311,5 +370,4 @@ public class LdapServer implements IAdap
 
         return null;
     }
-
 }

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerActionFilterAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerActionFilterAdapter.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerActionFilterAdapter.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerActionFilterAdapter.java Thu Sep 29 14:33:00 2011
@@ -44,6 +44,7 @@ public class LdapServerActionFilterAdapt
     private static final Object EXTENSION_NAME = "extensionName";
     private static final Object EXTENSION_VERSION = "extensionVersion";
     private static final Object EXTENSION_VENDOR = "extensionVendor";
+    private static final Object HAS_CONFIGURATION_PAGE = "hasConfigurationPage";
 
     /** The class instance */
     private static LdapServerActionFilterAdapter INSTANCE = new LdapServerActionFilterAdapter();
@@ -138,6 +139,17 @@ public class LdapServerActionFilterAdapt
                     return value.equals( server.getLdapServerAdapterExtension().getVendor() );
                 }
             }
+            // HAS CONFIGURATION PAGE
+            else if ( HAS_CONFIGURATION_PAGE.equals( name ) )
+            {
+                String configurationPageClassName = server.getLdapServerAdapterExtension()
+                    .getConfigurationPageClassName();
+
+                boolean hasConfigurationPage = ( ( configurationPageClassName != null ) && ( !""
+                    .equals( configurationPageClassName ) ) );
+
+                return value.equalsIgnoreCase( hasConfigurationPage ? "true" : "false" );
+            }
         }
 
         return false;

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java Thu Sep 29 14:33:00 2011
@@ -21,7 +21,11 @@
 package org.apache.directory.studio.ldapservers.model;
 
 
+import java.util.List;
+
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
 
 
 /**

Added: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPage.java?rev=1177322&view=auto
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPage.java (added)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPage.java Thu Sep 29 14:33:00 2011
@@ -0,0 +1,121 @@
+/*
+ *  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.ldapservers.model;
+
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+/**
+ * This interface defines a configuration page for an {@link LdapServerAdapter}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface LdapServerAdapterConfigurationPage
+{
+    /**
+     * Creates the control for the configuration page.
+     *
+     * @param parent the parent control
+     * @return the created control
+     */
+    public Control createControl( Composite parent );
+
+
+    /**
+     * Gets the description.
+     *
+     * @return the description
+     */
+    public String getDescription();
+
+
+    /**
+     * Gets the error message.
+     *
+     * @return the error message
+     */
+    public String getErrorMessage();
+
+
+    /**
+     * Gets the ID.
+     *
+     * @return the ID
+     */
+    public String getId();
+
+
+    /**
+     * Gets the {@link ImageDescriptor}.
+     *
+     * @return the {@link ImageDescriptor}
+     */
+    public ImageDescriptor getImageDescriptor();
+
+
+    /**
+     * Gets the title.
+     *
+     * @return the title
+     */
+    public String getTitle();
+
+
+    /**
+     * Indicates if the page is complete.
+     *
+     * @return <code>true</code> if the page is complete,
+     *         <code>false</code> if not.
+     */
+    public boolean isPageComplete();
+
+
+    /**
+     * Loads configuration information from the given LDAP server.
+     *
+     * @param ldapServer the LDAP server
+     */
+    public void loadConfiguration( LdapServer ldapServer );
+
+
+    /**
+     * Saves the configuration information to the given LDAP server.
+     *
+     * @param ldapServer the LDAP server
+     */
+    public void saveConfiguration( LdapServer ldapServer );
+
+
+    /**
+     * Sets a modify listener.
+     *
+     * @param modifyListener the modify listener
+     */
+    public void setModifyListener( LdapServerAdapterConfigurationPageModifyListener modifyListener );
+
+
+    /**
+     * Validates the configuration page
+     */
+    public void validate();
+}

Added: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPageModifyListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPageModifyListener.java?rev=1177322&view=auto
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPageModifyListener.java (added)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterConfigurationPageModifyListener.java Thu Sep 29 14:33:00 2011
@@ -0,0 +1,14 @@
+package org.apache.directory.studio.ldapservers.model;
+
+
+/**
+ * A {@link LdapServerAdapterConfigurationPageModifyListener} listens for modifications of the 
+ * {@link LdapServerAdapterConfigurationPage}.
+ */
+public interface LdapServerAdapterConfigurationPageModifyListener
+{
+    /**
+     * Indicates that the configuration page was modified.
+     */
+    public void configurationPageModified();
+}
\ No newline at end of file

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java Thu Sep 29 14:33:00 2011
@@ -21,6 +21,9 @@
 package org.apache.directory.studio.ldapservers.model;
 
 
+import org.apache.directory.studio.ldapservers.LdapServerAdapterExtensionsManager;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.jface.resource.ImageDescriptor;
 
 
@@ -32,6 +35,9 @@ import org.eclipse.jface.resource.ImageD
  */
 public class LdapServerAdapterExtension
 {
+    /** The extension point configuration */
+    private IConfigurationElement extensionPointConfiguration;
+
     /** The ID */
     private String id;
 
@@ -56,6 +62,9 @@ public class LdapServerAdapterExtension
     /** The icon */
     private ImageDescriptor icon;
 
+    /** The configuration page class name */
+    private String configurationPageClassName;
+
 
     /**
      * Gets the class name.
@@ -70,6 +79,38 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Gets the configuration page class name.
+     *
+     * @return
+     *      the configuration page class name
+     */
+    public String getConfigurationPageClassName()
+    {
+        return configurationPageClassName;
+    }
+
+
+    /**
+     * Gets a new configuration page instance.
+     *
+     * @return
+     *      a new configuration page instance
+     */
+    public LdapServerAdapterConfigurationPage getNewConfigurationPageInstance()
+    {
+        try
+        {
+            return ( LdapServerAdapterConfigurationPage ) extensionPointConfiguration
+                .createExecutableExtension( LdapServerAdapterExtensionsManager.CONFIGURATION_PAGE_ATTR );
+        }
+        catch ( CoreException e )
+        {
+            return null;
+        }
+    }
+
+
+    /**
      * Gets the description.
      *
      * @return
@@ -82,6 +123,18 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Gets the extension point configuration.
+     *
+     * @return
+     *      the extension point configuration
+     */
+    public IConfigurationElement getExtensionPointConfiguration()
+    {
+        return extensionPointConfiguration;
+    }
+
+
+    /**
      * Gets the icon.
      *
      * @return
@@ -166,6 +219,18 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Sets the configuration page class name.
+     *
+     * @param configurationPageClassName
+     *      the configuration page class name
+     */
+    public void setConfigurationPageClassName( String configurationPageClassName )
+    {
+        this.configurationPageClassName = configurationPageClassName;
+    }
+
+
+    /**
      * Sets the description.
      *
      * @param description
@@ -178,6 +243,18 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Sets the extension point configuration.
+     *
+     * @param IConfigurationElement
+     *      the extension point configuration
+     */
+    public void setExtensionPointConfiguration( IConfigurationElement extensionPointConfiguration )
+    {
+        this.extensionPointConfiguration = extensionPointConfiguration;
+    }
+
+
+    /**
      * Sets the icon.
      *
      * @param icon

Added: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyConfigurationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyConfigurationPage.java?rev=1177322&view=auto
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyConfigurationPage.java (added)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyConfigurationPage.java Thu Sep 29 14:33:00 2011
@@ -0,0 +1,112 @@
+/*
+ *  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.ldapservers.properties;
+
+
+import org.apache.directory.studio.ldapservers.LdapServersManager;
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPage;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPageModifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPropertyPage;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+
+/**
+ * This class implements the Configuration property page for an LDAP server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ServerPropertyConfigurationPage extends PropertyPage implements IWorkbenchPropertyPage,
+    LdapServerAdapterConfigurationPageModifyListener
+{
+    /** The LDAP server*/
+    private LdapServer ldapServer;
+
+    /** The configuration page */
+    private LdapServerAdapterConfigurationPage configurationPage;
+
+
+    /**
+     * Creates a new instance of ServerPropertyPage.
+     */
+    public ServerPropertyConfigurationPage()
+    {
+        super();
+        super.noDefaultAndApplyButton();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected Control createContents( Composite parent )
+    {
+        // Getting the server
+        ldapServer = ( LdapServer ) getElement();
+
+        if ( ldapServer != null )
+        {
+            configurationPage = ldapServer.getLdapServerAdapterExtension()
+                .getNewConfigurationPageInstance();
+            configurationPage.setModifyListener( this );
+
+            Control control = configurationPage.createControl( parent );
+            configurationPage.loadConfiguration( ldapServer );
+
+            return control;
+        }
+
+        return parent;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void configurationPageModified()
+    {
+        if ( ldapServer != null )
+        {
+            setErrorMessage( configurationPage.getErrorMessage() );
+            setValid( configurationPage.isPageComplete() );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean performOk()
+    {
+        if ( ldapServer != null )
+        {
+            // Saving the configuration
+            configurationPage.saveConfiguration( ldapServer );
+
+            // Saving the server to the file store.
+            LdapServersManager.getDefault().saveServersToStore();
+
+        }
+
+        return super.performOk();
+    }
+}

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java?rev=1177322&r1=1177321&r2=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java Thu Sep 29 14:33:00 2011
@@ -20,13 +20,20 @@
 package org.apache.directory.studio.ldapservers.wizards;
 
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.ldapservers.LdapServerAdapterExtensionsManager;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPage;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapterExtension;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
@@ -40,7 +47,9 @@ import org.eclipse.ui.IWorkbench;
 public class NewServerWizard extends Wizard implements INewWizard
 {
     /** The wizard page */
-    private NewServerWizardPage page;
+    private NewServerWizardSelectionPage adapterSelectionPage;
+
+    private Map<String, NewServerWizardConfigurationPage> configurationPages = new HashMap<String, NewServerWizardConfigurationPage>();
 
 
     /**
@@ -48,8 +57,31 @@ public class NewServerWizard extends Wiz
      */
     public void addPages()
     {
-        page = new NewServerWizardPage();
-        addPage( page );
+        adapterSelectionPage = new NewServerWizardSelectionPage();
+        addPage( adapterSelectionPage );
+
+        List<LdapServerAdapterExtension> ldapServerAdapterExtensions = LdapServerAdapterExtensionsManager.getDefault()
+            .getLdapServerAdapterExtensions();
+        for ( LdapServerAdapterExtension ldapServerAdapterExtension : ldapServerAdapterExtensions )
+        {
+            String configurationPageClassName = ldapServerAdapterExtension.getConfigurationPageClassName();
+            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) )
+            {
+                try
+                {
+                    LdapServerAdapterConfigurationPage configurationPage = ldapServerAdapterExtension
+                        .getNewConfigurationPageInstance();
+                    NewServerWizardConfigurationPage configurationWizardPage = new NewServerWizardConfigurationPage(
+                        configurationPage );
+                    configurationPages.put( ldapServerAdapterExtension.getId(), configurationWizardPage );
+                    addPage( configurationWizardPage );
+                }
+                catch ( Exception e )
+                {
+                    e.printStackTrace();
+                }
+            }
+        }
     }
 
 
@@ -59,9 +91,23 @@ public class NewServerWizard extends Wiz
     public boolean performFinish()
     {
         // Getting server name and adapter extension
-        final String serverName = page.getServerName();
-        final LdapServerAdapterExtension adapterExtension = page.getLdapServerAdapterExtension();
+        final String serverName = adapterSelectionPage.getServerName();
+        final LdapServerAdapterExtension adapterExtension = adapterSelectionPage.getLdapServerAdapterExtension();
 
+        // Getting the configuration page (in any
+        NewServerWizardConfigurationPage configurationPage = getConfigurationPage();
+        
+        // Creating the new server
+        final LdapServer server = new LdapServer();
+        server.setName( serverName );
+        server.setLdapServerAdapterExtension( adapterExtension );
+        
+        // Saving the configuration page (is any)
+        if ( configurationPage != null )
+        {
+            configurationPage.saveConfiguration( server );
+        }
+        
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()
@@ -75,11 +121,6 @@ public class NewServerWizard extends Wiz
                     spm.beginTask( "Creating LDAP Server: ", IProgressMonitor.UNKNOWN );
                     spm.subTask( "creating server folder" );
 
-                    // Creating the new server
-                    LdapServer server = new LdapServer();
-                    server.setName( serverName );
-                    server.setLdapServerAdapterExtension( adapterExtension );
-
                     // Adding the new server to the servers handler
                     LdapServersManager.getDefault().addServer( server );
 
@@ -118,4 +159,69 @@ public class NewServerWizard extends Wiz
     {
         setNeedsProgressMonitor( true );
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public IWizardPage getNextPage( IWizardPage page )
+    {
+        IWizardPage configurationPage = getConfigurationPage();
+
+        if ( adapterSelectionPage.equals( page ) )
+        {
+            return configurationPage;
+        }
+
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean canFinish()
+    {
+        if ( adapterSelectionPage.isPageComplete() )
+        {
+            IWizardPage configurationPage = getConfigurationPage();
+
+            if ( configurationPage != null )
+            {
+                return configurationPage.isPageComplete();
+            }
+            else
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Gets the configuration page corresponding to the currently
+     * selected LDAP Server Adapter Extension.
+     *
+     * @return the configuration page corresponding to the currently
+     * selected LDAP Server Adapter Extension.
+     */
+    private NewServerWizardConfigurationPage getConfigurationPage()
+    {
+        LdapServerAdapterExtension ldapServerAdapterExtension = adapterSelectionPage
+            .getLdapServerAdapterExtension();
+
+        if ( ldapServerAdapterExtension != null )
+        {
+            String configurationPageClassName = ldapServerAdapterExtension.getConfigurationPageClassName();
+
+            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) )
+            {
+                return configurationPages.get( ldapServerAdapterExtension.getId() );
+            }
+        }
+
+        return null;
+    }
 }

Added: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardConfigurationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardConfigurationPage.java?rev=1177322&view=auto
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardConfigurationPage.java (added)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardConfigurationPage.java Thu Sep 29 14:33:00 2011
@@ -0,0 +1,92 @@
+/*
+ *  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.ldapservers.wizards;
+
+
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPage;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPageModifyListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+/**
+ * This class implements the wizard page for the new server wizard configuration page.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class NewServerWizardConfigurationPage extends WizardPage implements
+    LdapServerAdapterConfigurationPageModifyListener
+{
+    /** The configuration page */
+    private LdapServerAdapterConfigurationPage configurationPage;
+
+
+    /**
+     * Creates a new instance of NewServerWizardConfigurationPage.
+     */
+    public NewServerWizardConfigurationPage( LdapServerAdapterConfigurationPage configurationPage )
+    {
+        super( configurationPage.getId() );
+        setTitle( configurationPage.getTitle() );
+        setDescription( configurationPage.getDescription() );
+        setImageDescriptor( configurationPage.getImageDescriptor() );
+        setPageComplete( configurationPage.isPageComplete() );
+
+        this.configurationPage = configurationPage;
+        configurationPage.setModifyListener( this );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void createControl( Composite parent )
+    {
+        // Creating the control for the configuration page
+        Control control = configurationPage.createControl( parent );
+
+        // Setting the control and the focus
+        setControl( control );
+        control.setFocus();
+    }
+
+
+    /**
+     * Saves the configuration information to the given LDAP server.
+     *
+     * @param ldapServer the LDAP server
+     */
+    public void saveConfiguration( LdapServer ldapServer )
+    {
+        configurationPage.saveConfiguration( ldapServer );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void configurationPageModified()
+    {
+        setErrorMessage( configurationPage.getErrorMessage() );
+        setPageComplete( configurationPage.isPageComplete() );
+    }
+}

Copied: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardSelectionPage.java (from r1176428, directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardSelectionPage.java?p2=directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardSelectionPage.java&p1=directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java&r1=1176428&r2=1177322&rev=1177322&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardSelectionPage.java Thu Sep 29 14:33:00 2011
@@ -46,11 +46,11 @@ import org.eclipse.swt.widgets.Tree;
 
 
 /**
- * This class implements the wizard page for the new server wizard.
+ * This class implements the wizard page for the new server wizard selection page.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NewServerWizardPage extends WizardPage
+public class NewServerWizardSelectionPage extends WizardPage
 {
     /** The servers handler */
     private LdapServersManager ldapServersManager;
@@ -69,11 +69,11 @@ public class NewServerWizardPage extends
 
 
     /**
-     * Creates a new instance of NewServerWizardPage.
+     * Creates a new instance of NewServerWizardSelectionPage.
      */
-    public NewServerWizardPage()
+    public NewServerWizardSelectionPage()
     {
-        super( NewServerWizardPage.class.getCanonicalName() );
+        super( NewServerWizardSelectionPage.class.getCanonicalName() );
         setTitle( "Create an LDAP Server" );
         setDescription( "Please choose the type of server and specify a name to create a new server." );
         setImageDescriptor( LdapServersPlugin.getDefault().getImageDescriptor(
@@ -104,7 +104,7 @@ public class NewServerWizardPage extends
         // LDAP Server Adapters Tree Viewer
         ldapServerAdaptersTreeViewer = new TreeViewer( new Tree( composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL
             | SWT.BORDER ) );
-        GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 );
+        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 2, 1 );
         gd.heightHint = 90;
         ldapServerAdaptersTreeViewer.getTree().setLayoutData( gd );
         contentProvider = new LdapServerAdapterExtensionsContentProvider();
@@ -197,6 +197,8 @@ public class NewServerWizardPage extends
                 // Assigning an automatic name to the LDAP Server based on the selected LDAP Server Adapter Extension
                 serverNameText.setText( getServerName( ( StructuredSelection ) ldapServerAdaptersTreeViewer
                     .getSelection() ) );
+                
+//                getContainer().updateButtons();
 
                 validate();
             }



Mime
View raw message