directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1668692 [7/16] - in /directory/studio/trunk: ./ eclipse-target-platform/ features/ features/apacheds.feature/ features/ldapbrowser.feature/ features/ldifeditor.feature/ features/rcp.feature/ features/schemaeditor.feature/ helps/ helps/apac...
Date Mon, 23 Mar 2015 17:59:06 GMT
Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/Messages.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/Messages.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/Messages.java Mon Mar 23 17:59:02 2015
@@ -24,18 +24,23 @@ import java.util.MissingResourceExceptio
 import java.util.ResourceBundle;
 
 
+/**
+ * This class get messages from the resources file.
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class Messages
 {
-    private static final String BUNDLE_NAME = "org.apache.directory.studio.apacheds.configuration.v2.editor.messages"; //$NON-NLS-1$
-
-    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
-
-    private Messages()
-    {
-    }
-
-
+    /** The resource name */
+    private static final ResourceBundle RESOURCE_BUNDLE = 
+        ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
+    
+    /**
+     * Get back a message from the resource file given a key
+     * 
+     * @param key The key associated with the message
+     * @return The found message
+     */
     public static String getString( String key )
     {
         try

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java Mon Mar 23 17:59:02 2015
@@ -53,7 +53,36 @@ import org.eclipse.ui.forms.widgets.Tabl
 
 /**
  * This class represents the General Page of the Server Configuration Editor.
- *
+ * 
+ * The Overview tab exposes 4 panels, in 2 columns :
+ * 
+ * <pre>
+ * +-------------------------------------------------------------------------------+
+ * | +------------------------------------+ +------------------------------------+ |
+ * | | .--------------------------------. | | +--------------------------------+ | |
+ * | | | LDAP/LDAPS Transport           | | | | Kerberos Server                | | |
+ * | | +--------------------------------| | | +--------------------------------+ | |
+ * | | | [X] Enabled LDAP server        | | | | [X] Enable Kerberos Server     | | |
+ * | | |  Port     : [/////////]        | | | |   Port     : [/////]           | | |
+ * | | | [X] Enabled LDAPS server       | | | | [X] Enable Kerberos ChangePwd  | | |
+ * | | |  Port     : [/////////]        | | | |   Port     : [/////]           | | |
+ * | | | <advanced LDAP/LDAPS config>   | | | | <advanced Kerberos config>     | | |
+ * | | +--------------------------------| | | +--------------------------------+ | |
+ * | | .--------------------------------. | | +--------------------------------+ | |
+ * | | | Partitions                     | | | | Options                        | | |
+ * | | +--------------------------------| | | +--------------------------------+ | |
+ * | | | +----------------------------+ | | | | [X] Allow anonymous access     | | |
+ * | | | | Partition 1                | | | | | [X] Enable Access Control      | | |
+ * | | | | Partition 2                | | | | | [X] Password Hidden            | | |
+ * | | | | ...                        | | | | |                                | | |
+ * | | | +----------------------------+ | | | |                                | | |
+ * | | | <advanced partitionsS config>  | | | |                                | | |
+ * | | +--------------------------------+ | | +--------------------------------+ | |
+ * | +------------------------------------+ +------------------------------------+ |
+ * </pre>
+ * 
+ * We just expose the more frequent parameters in this page.
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class OverviewPage extends ServerConfigurationEditorPage
@@ -65,57 +94,109 @@ public class OverviewPage extends Server
     private static final String TITLE = Messages.getString( "OverviewPage.Overview" ); //$NON-NLS-1$
 
     // UI Controls
+    /** LDAP Server controls */
     private Button enableLdapCheckbox;
     private Text ldapPortText;
     private Button enableLdapsCheckbox;
     private Text ldapsPortText;
+    // This link opens the advanced LDAP/LDAPS configuration tab 
     private Hyperlink openLdapConfigurationLink;
+    
+    /** Kerberos Server controls */
     private Button enableKerberosCheckbox;
     private Text kerberosPortText;
     private Button enableChangePasswordCheckbox;
     private Text changePasswordPortText;
+    // This link opens the advanced kerberos configuration tab 
     private Hyperlink openKerberosConfigurationLink;
+    
+    /** The Partitions controls */
     private Label partitionsLabel;
     private TableViewer partitionsTableViewer;
+    // This link open the advanced partitions configuration Tab */
     private Hyperlink openPartitionsConfigurationLink;
+
+    /** The LDAP Options controls */
     private Button allowAnonymousAccessCheckbox;
     private Button enableAccessControlCheckbox;
+    private Button enableHiddenPasswordCheckbox;
 
     // UI Control Listeners
+    /**
+     * The LDAP transport checkbox selection adapter.
+     */
     private SelectionAdapter enableLdapCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
+            boolean enableLdap = enableLdapCheckbox.getSelection();
             LdapLdapsServersPage.getLdapServerTransportBean( getDirectoryServiceBean() ).setEnabled(
-                enableLdapCheckbox.getSelection() );
-            setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
+                enableLdap );
+            setEnabled( ldapPortText, enableLdap );
         }
     };
+
+    
+    /**
+     * The Ldap port modify listener
+     */
     private ModifyListener ldapPortTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
-            LdapLdapsServersPage.getLdapServerTransportBean( getDirectoryServiceBean() ).setSystemPort(
-                Integer.parseInt( ldapPortText.getText() ) );
+            try
+            {
+                int port = Integer.parseInt( ldapPortText.getText() );
+                
+                LdapLdapsServersPage.getLdapServerTransportBean( getDirectoryServiceBean() ).setSystemPort( port );
+            }
+            catch ( NumberFormatException nfe )
+            {
+                System.out.println( "Wrong LDAP TCP Port : it must be an integer" );
+            }
         }
     };
+    
+    
+    /**
+     * The LDAPS transport checkbox selection adapter
+     */
     private SelectionAdapter enableLdapsCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            LdapLdapsServersPage.getLdapsServerTransportBean( getDirectoryServiceBean() ).setEnabled(
-                enableLdapsCheckbox.getSelection() );
-            setEnabled( ldapsPortText, enableLdapsCheckbox.getSelection() );
+            boolean enableLdaps = enableLdapsCheckbox.getSelection();
+            LdapLdapsServersPage.getLdapTransportBean( getDirectoryServiceBean(), LdapLdapsServersPage.TRANSPORT_ID_LDAPS ).setEnabled(
+                enableLdaps );
+            setEnabled( ldapsPortText, enableLdaps );
         }
     };
+
+    
+    /**
+     * The Ldaps port modify listener
+     */
     private ModifyListener ldapsPortTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
-            LdapLdapsServersPage.getLdapsServerTransportBean( getDirectoryServiceBean() ).setSystemPort(
-                Integer.parseInt( ldapsPortText.getText() ) );
+            try
+            {
+                int port = Integer.parseInt( ldapsPortText.getText() );
+                
+                LdapLdapsServersPage.getLdapsServerTransportBean( getDirectoryServiceBean() ).setSystemPort( port );
+            }
+            catch ( NumberFormatException nfe )
+            {
+                System.out.println( "Wrong LDAPS TCP Port : it must be an integer" );
+            }
         }
     };
+
+    
+    /**
+     * The advanced LDAP/LDAPS configuration hyper link adapter
+     */
     private HyperlinkAdapter openLdapConfigurationLinkListener = new HyperlinkAdapter()
     {
         public void linkActivated( HyperlinkEvent e )
@@ -123,42 +204,86 @@ public class OverviewPage extends Server
             getServerConfigurationEditor().showPage( LdapLdapsServersPage.class );
         }
     };
+    
+    
+    /**
+     * The Kerberos server selection adpater
+     */
     private SelectionAdapter enableKerberosCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            KerberosServerPage.enableKerberosServer( getDirectoryServiceBean(), enableKerberosCheckbox.getSelection() );
-            setEnabled( kerberosPortText, enableKerberosCheckbox.getSelection() );
+            boolean enableKerberos = enableKerberosCheckbox.getSelection();
+            KerberosServerPage.enableKerberosServer( getDirectoryServiceBean(), enableKerberos );
+            setEnabled( kerberosPortText, enableKerberos );
         }
     };
+    
+    
+    /**
+     * The Kerberos port listener
+     */
     private ModifyListener kerberosPortTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
-            KdcServerBean kdcServerBean = getConfigBean().getDirectoryServiceBean().getKdcServerBean();
-            kdcServerBean.getTransports()[0].setSystemPort( Integer.parseInt( kerberosPortText.getText() ) );
+            KdcServerBean kdcServerBean = getDirectoryServiceBean().getKdcServerBean();
+
+            try
+            {
+                int port = Integer.parseInt( kerberosPortText.getText() );
+                
+                kdcServerBean.getTransports()[0].setSystemPort( port );
+            }
+            catch ( NumberFormatException nfe )
+            {
+                System.out.println( "Wrong Kerberos TCP/UDP Port : it must be an integer" );
+            }
         }
     };
+    
+    
+    /**
+     * The ChangePassword server selection adapter 
+     */
     private SelectionAdapter enableChangePasswordCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            ChangePasswordServerBean changePasswordServerBean = getConfigBean().getDirectoryServiceBean()
-                .getChangePasswordServerBean();
-            changePasswordServerBean.setEnabled( enableChangePasswordCheckbox.getSelection() );
-            setEnabled( changePasswordPortText, enableChangePasswordCheckbox.getSelection() );
+            ChangePasswordServerBean changePasswordServerBean = getDirectoryServiceBean().getChangePasswordServerBean();
+            boolean enableChangePassword = enableChangePasswordCheckbox.getSelection();
+            changePasswordServerBean.setEnabled( enableChangePassword );
+            setEnabled( changePasswordPortText, enableChangePassword );
         }
     };
+    
+    
+    /**
+     * The ChangePassword server port listener
+     */
     private ModifyListener changePasswordPortTextListener = new ModifyListener()
     {
         public void modifyText( ModifyEvent e )
         {
-            ChangePasswordServerBean changePasswordServerBean = getConfigBean().getDirectoryServiceBean()
-                .getChangePasswordServerBean();
-            changePasswordServerBean.getTransports()[0].setSystemPort( Integer.parseInt( changePasswordPortText
-                .getText() ) );
+            ChangePasswordServerBean changePasswordServerBean = getDirectoryServiceBean().getChangePasswordServerBean();
+
+            try
+            {
+                int port = Integer.parseInt( changePasswordPortText.getText() );
+                
+                changePasswordServerBean.getTransports()[0].setSystemPort( port );
+            }
+            catch ( NumberFormatException nfe )
+            {
+                System.out.println( "Wrong ChnagePassword Port : it must be an integer" );
+            }
         }
     };
+    
+    
+    /**
+     * The advanced Kerberos configuration hyperlink
+     */
     private HyperlinkAdapter openKerberosConfigurationLinkListener = new HyperlinkAdapter()
     {
         public void linkActivated( HyperlinkEvent e )
@@ -166,6 +291,11 @@ public class OverviewPage extends Server
             getServerConfigurationEditor().showPage( KerberosServerPage.class );
         }
     };
+    
+    
+    /**
+     * The advanced Partition configuration hyperlink
+     */
     private HyperlinkAdapter openPartitionsConfigurationLinkListener = new HyperlinkAdapter()
     {
         public void linkActivated( HyperlinkEvent e )
@@ -173,20 +303,40 @@ public class OverviewPage extends Server
             getServerConfigurationEditor().showPage( PartitionsPage.class );
         }
     };
+    
+    
+    /**
+     * The AllowAnonymousAccess checkbox listener
+     */
     private SelectionAdapter allowAnonymousAccessCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            DirectoryServiceBean directoryServiceBean = getConfigBean().getDirectoryServiceBean();
-            directoryServiceBean.setDsAllowAnonymousAccess( allowAnonymousAccessCheckbox.getSelection() );
+            getDirectoryServiceBean().setDsAllowAnonymousAccess( allowAnonymousAccessCheckbox.getSelection() );
         }
     };
+    
+    
+    /**
+     * The AccessControl checkbox listener
+     */
     private SelectionAdapter enableAccessControlCheckboxListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            DirectoryServiceBean directoryServiceBean = getConfigBean().getDirectoryServiceBean();
-            directoryServiceBean.setDsAccessControlEnabled( enableAccessControlCheckbox.getSelection() );
+            getDirectoryServiceBean().setDsAccessControlEnabled( enableAccessControlCheckbox.getSelection() );
+        }
+    };
+    
+    
+    /**
+     * The HiddenPassword checkbox listener
+     */
+    private SelectionAdapter enableHiddenPasswordCheckboxListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            getDirectoryServiceBean().setDsPasswordHidden( enableHiddenPasswordCheckbox.getSelection() );
         }
     };
 
@@ -194,8 +344,7 @@ public class OverviewPage extends Server
     /**
      * Creates a new instance of GeneralPage.
      *
-     * @param editor
-     *      the associated editor
+     * @param editor the associated editor
      */
     public OverviewPage( ServerConfigurationEditor editor )
     {
@@ -204,7 +353,23 @@ public class OverviewPage extends Server
 
 
     /**
-     * {@inheritDoc}
+     * Creates the global Overview Tab. It contains 2 columns, each one of
+     * them having two sections :
+     * 
+     * <pre>
+     * +-----------------------------------+---------------------------------+
+     * |                                   |                                 |
+     * | LDAP/LDAPS configuration section  | Kerberos/ChangePassword section |
+     * |                                   |                                 |
+     * +-----------------------------------+---------------------------------+
+     * |                                   |                                 |
+     * | Partition section                 | Options configuration section   |
+     * |                                   |                                 |
+     * +-----------------------------------+---------------------------------+
+     * </pre>
+     * 
+     * @param parent the parent element
+     * @param toolkit the form toolkit
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
@@ -238,7 +403,22 @@ public class OverviewPage extends Server
 
 
     /**
-     * Creates the LDAP and LDAPS Servers section.
+     * Creates the LDAP and LDAPS Servers section. This section is a grid with 4 columns,
+     * where we configure LDAPa and LDAPS servers.
+     * We can enable or disable those servers, and if they are enabled, we can configure
+     * the port.
+     * 
+     * <pre>
+     * .--------------------------------.
+     * | LDAP/LDAPS Transport           |
+     * +--------------------------------|
+     * | [X] Enabled LDAP server        |
+     * |  Port     : [/////////]        |
+     * | [X] Enabled LDAPS server       |
+     * |  Port     : [/////////]        |
+     * | <advanced LDAP/LDAPS config>   |
+     * +--------------------------------|
+     * </pre>
      *
      * @param toolkit the toolkit
      * @param parent the parent composite
@@ -246,49 +426,53 @@ public class OverviewPage extends Server
     private void createLdapLdapsServersSection( FormToolkit toolkit, Composite parent )
     {
         // Creation of the section
-        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( Messages.getString( "OverviewPage.LdapLdapsServers" ) ); //$NON-NLS-1$
-        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-        Composite composite = toolkit.createComposite( section );
-        toolkit.paintBordersFor( composite );
-        GridLayout gridLayout = new GridLayout( 4, false );
-        gridLayout.marginHeight = gridLayout.marginWidth = 0;
-        composite.setLayout( gridLayout );
-        section.setClient( composite );
+        int nbColumns = 4;
+        Composite composite = createSection( toolkit, parent, "OverviewPage.LdapLdapsServers", nbColumns, Section.TITLE_BAR );
 
         // Enable LDAP Server Checkbox
         enableLdapCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableLdapServer" ), SWT.CHECK ); //$NON-NLS-1$
-        enableLdapCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, gridLayout.numColumns, 1 ) );
+        enableLdapCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, nbColumns, 1 ) );
 
         // LDAP Server Port Text
         toolkit.createLabel( composite, TABULATION );
         toolkit.createLabel( composite, Messages.getString( "OverviewPage.Port" ) ); //$NON-NLS-1$
         ldapPortText = createPortText( toolkit, composite );
-        createDefaultValueLabel( toolkit, composite, "10389" ); //$NON-NLS-1$
+        createDefaultValueLabel( toolkit, composite, Integer.toString( DEFAULT_PORT_LDAP ) ); //$NON-NLS-1$
 
         // Enable LDAPS Server Checkbox
         enableLdapsCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableLdapsServer" ), SWT.CHECK ); //$NON-NLS-1$
-        enableLdapsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, gridLayout.numColumns, 1 ) );
+        enableLdapsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, nbColumns, 1 ) );
 
         // LDAPS Server Port Text
         toolkit.createLabel( composite, TABULATION );
         toolkit.createLabel( composite, Messages.getString( "OverviewPage.Port" ) ); //$NON-NLS-1$
         ldapsPortText = createPortText( toolkit, composite );
-        createDefaultValueLabel( toolkit, composite, "10636" ); //$NON-NLS-1$
+        createDefaultValueLabel( toolkit, composite, Integer.toString( DEFAULT_PORT_LDAPS ) ); //$NON-NLS-1$
 
         // LDAP Configuration Link
         openLdapConfigurationLink = toolkit.createHyperlink( composite,
             Messages.getString( "OverviewPage.AdvancedLdapLdapsConfiguration" ), SWT.NONE ); //$NON-NLS-1$
-        openLdapConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
-            gridLayout.numColumns, 1 ) );
+        openLdapConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, nbColumns, 1 ) );
         openLdapConfigurationLink.addHyperlinkListener( openLdapConfigurationLinkListener );
     }
 
 
     /**
-     * Creates the Kerberos and Change Password Servers section.
+     * Creates the Kerberos and Change Password Servers section. As for the LDAP/LDAPS
+     * server, we can configure the Kerberos and ChangePassword ports if they are enabled.
+     * <pre>
+     * +--------------------------------+
+     * | Kerberos Server                |
+     * +--------------------------------+
+     * | [X] Enable Kerberos Server     |
+     * |   Port     : [/////]           |
+     * | [X] Enable Kerberos ChangePwd  |
+     * |   Port     : [/////]           |
+     * | <advanced Kerberos config>     |
+     * +--------------------------------+
+     * </pre>
      *
      * @param toolkit the toolkit
      * @param parent the parent composite
@@ -296,52 +480,59 @@ public class OverviewPage extends Server
     private void createKerberosChangePasswordServersSection( FormToolkit toolkit, Composite parent )
     {
         // Creation of the section
-        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( Messages.getString( "OverviewPage.KerberosServer" ) ); //$NON-NLS-1$
-        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-        Composite composite = toolkit.createComposite( section );
-        toolkit.paintBordersFor( composite );
-        GridLayout gridLayout = new GridLayout( 4, false );
-        gridLayout.marginHeight = gridLayout.marginWidth = 0;
-        composite.setLayout( gridLayout );
-        section.setClient( composite );
+        int nbColumns = 4;
+        Composite composite = createSection( toolkit, parent, "OverviewPage.KerberosServer", nbColumns, Section.TITLE_BAR );
 
         // Enable Kerberos Server Checkbox
         enableKerberosCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableKerberosServer" ), SWT.CHECK ); //$NON-NLS-1$
         enableKerberosCheckbox
-            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, gridLayout.numColumns, 1 ) );
+            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, nbColumns, 1 ) );
 
         // Kerberos Server Port Text
         toolkit.createLabel( composite, TABULATION );
         toolkit.createLabel( composite, Messages.getString( "OverviewPage.Port" ) ); //$NON-NLS-1$
         kerberosPortText = createPortText( toolkit, composite );
-        createDefaultValueLabel( toolkit, composite, "60088" ); //$NON-NLS-1$
+        createDefaultValueLabel( toolkit, composite, Integer.toString( DEFAULT_PORT_KERBEROS ) ); //$NON-NLS-1$
 
         // Enable Change Password Server Checkbox
         enableChangePasswordCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableKerberosChangePasswordServer" ), //$NON-NLS-1$
             SWT.CHECK );
         enableChangePasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
-            gridLayout.numColumns, 1 ) );
+            nbColumns, 1 ) );
 
         // Change Password Server Port Text
         toolkit.createLabel( composite, TABULATION );
         toolkit.createLabel( composite, Messages.getString( "OverviewPage.Port" ) ); //$NON-NLS-1$
         changePasswordPortText = createPortText( toolkit, composite );
-        createDefaultValueLabel( toolkit, composite, "60464" ); //$NON-NLS-1$
+        createDefaultValueLabel( toolkit, composite, Integer.toString( DEFAULT_PORT_CHANGE_PASSWORD ) ); //$NON-NLS-1$
 
         // Kerberos Configuration Link
         openKerberosConfigurationLink = toolkit.createHyperlink( composite,
             Messages.getString( "OverviewPage.AdvancedKerberosConfiguration" ), SWT.NONE ); //$NON-NLS-1$
         openKerberosConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
-            gridLayout.numColumns, 1 ) );
+            nbColumns, 1 ) );
         openKerberosConfigurationLink.addHyperlinkListener( openKerberosConfigurationLinkListener );
     }
 
 
     /**
-     * Creates the Partitions section.
+     * Creates the Partitions section. This is just an informative section, 
+     * where we list the existing partitions.
+     * 
+     * <pre>
+     * .--------------------------------.
+     * | Partitions                     |
+     * +--------------------------------|
+     * | +----------------------------+ |
+     * | | Partition 1                | |
+     * | | Partition 2                | |
+     * | | ...                        | |
+     * | +----------------------------+ |
+     * | <advanced partitionsS config>  |
+     * +--------------------------------+
+     * </pre>
      *
      * @param toolkit the toolkit
      * @param parent the parent composite
@@ -349,15 +540,8 @@ public class OverviewPage extends Server
     private void createPartitionsSection( FormToolkit toolkit, Composite parent )
     {
         // Creation of the section
-        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( Messages.getString( "OverviewPage.Partitions" ) ); //$NON-NLS-1$
-        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-        Composite composite = toolkit.createComposite( section );
-        toolkit.paintBordersFor( composite );
-        GridLayout gridLayout = new GridLayout( 1, false );
-        gridLayout.marginHeight = gridLayout.marginWidth = 0;
-        composite.setLayout( gridLayout );
-        section.setClient( composite );
+        int nbColumns = 1;
+        Composite composite = createSection( toolkit, parent, "OverviewPage.Partitions", nbColumns, Section.TITLE_BAR );
 
         // Partitions Label
         partitionsLabel = toolkit.createLabel( composite, "" ); //$NON-NLS-1$
@@ -376,14 +560,24 @@ public class OverviewPage extends Server
         // Partitions Configuration Link
         openPartitionsConfigurationLink = toolkit.createHyperlink( composite,
             Messages.getString( "OverviewPage.AdvancedPartitionsConfiguration" ), SWT.NONE ); //$NON-NLS-1$
-        openPartitionsConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
-            gridLayout.numColumns, 1 ) );
+        openPartitionsConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, nbColumns, 1 ) );
         openPartitionsConfigurationLink.addHyperlinkListener( openPartitionsConfigurationLinkListener );
     }
 
 
     /**
-     * Creates the Options section.
+     * Creates the Options section. This section expose a few critical options that are
+     * generally useful (allow anonymous, or enable control access atm).
+     * 
+     * <pre>
+     * +--------------------------------+
+     * | Options                        |
+     * +--------------------------------+
+     * | [X] Allow anonymous access     |
+     * | [X] Enable Access Control      |
+     * |                                |
+     * +--------------------------------+
+     * </pre>
      *
      * @param toolkit the toolkit
      * @param parent the parent composite
@@ -391,15 +585,8 @@ public class OverviewPage extends Server
     private void createOptionsSection( FormToolkit toolkit, Composite parent )
     {
         // Creation of the section
-        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( Messages.getString( "OverviewPage.Options" ) ); //$NON-NLS-1$
-        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-        Composite composite = toolkit.createComposite( section );
-        toolkit.paintBordersFor( composite );
-        GridLayout gridLayout = new GridLayout( 1, false );
-        gridLayout.marginHeight = gridLayout.marginWidth = 0;
-        composite.setLayout( gridLayout );
-        section.setClient( composite );
+        int nbColumns = 1;
+        Composite composite = createSection( toolkit, parent, "OverviewPage.Options", nbColumns, Section.TITLE_BAR );
 
         // Allow Anonymous Access Checkbox
         allowAnonymousAccessCheckbox = toolkit.createButton( composite,
@@ -410,6 +597,11 @@ public class OverviewPage extends Server
         enableAccessControlCheckbox = toolkit.createButton( composite,
             Messages.getString( "OverviewPage.EnableAccessControl" ), SWT.CHECK ); //$NON-NLS-1$
         enableAccessControlCheckbox.setLayoutData( new GridData( SWT.NONE, SWT.NONE, true, false ) );
+
+        // Enable Hidden Password Checkbox
+        enableHiddenPasswordCheckbox = toolkit.createButton( composite,
+            Messages.getString( "OverviewPage.EnableHiddenPassword" ), SWT.CHECK ); //$NON-NLS-1$
+        enableHiddenPasswordCheckbox.setLayoutData( new GridData( SWT.NONE, SWT.NONE, true, false ) );
     }
 
 
@@ -457,6 +649,10 @@ public class OverviewPage extends Server
         // Enable Access Control Checkbox
         addDirtyListener( enableAccessControlCheckbox );
         addSelectionListener( enableAccessControlCheckbox, enableAccessControlCheckboxListener );
+
+        // Enable Hidden Password Checkbox
+        addDirtyListener( enableHiddenPasswordCheckbox );
+        addSelectionListener( enableHiddenPasswordCheckbox, enableHiddenPasswordCheckboxListener );
     }
 
 
@@ -504,6 +700,10 @@ public class OverviewPage extends Server
         // Enable Access Control Checkbox
         removeDirtyListener( enableAccessControlCheckbox );
         removeSelectionListener( enableAccessControlCheckbox, enableAccessControlCheckboxListener );
+
+        // Enable Hidden Password Checkbox
+        removeDirtyListener( enableHiddenPasswordCheckbox );
+        removeSelectionListener( enableHiddenPasswordCheckbox, enableHiddenPasswordCheckboxListener );
     }
 
 
@@ -523,14 +723,14 @@ public class OverviewPage extends Server
                 .getLdapServerTransportBean( directoryServiceBean );
             setSelection( enableLdapCheckbox, ldapServerTransportBean.isEnabled() );
             setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
-            setText( ldapPortText, ldapServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+            setText( ldapPortText, Integer.toString( ldapServerTransportBean.getSystemPort() ) );
 
             // LDAPS Server
             TransportBean ldapsServerTransportBean = LdapLdapsServersPage
                 .getLdapsServerTransportBean( directoryServiceBean );
             setSelection( enableLdapsCheckbox, ldapsServerTransportBean.isEnabled() );
             setEnabled( ldapsPortText, enableLdapsCheckbox.getSelection() );
-            setText( ldapsPortText, ldapsServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+            setText( ldapsPortText, Integer.toString( ldapsServerTransportBean.getSystemPort() ) );
 
             // Kerberos Server
             KdcServerBean kdcServerBean = KerberosServerPage.getKdcServerBean( directoryServiceBean );
@@ -547,6 +747,7 @@ public class OverviewPage extends Server
 
             // Partitions
             List<PartitionBean> partitions = directoryServiceBean.getPartitions();
+            
             if ( partitions.size() == 1 )
             {
                 partitionsLabel.setText( Messages.getString( "OverviewPage.ThereIsOnePartitionDefined" ) ); //$NON-NLS-1$
@@ -556,11 +757,13 @@ public class OverviewPage extends Server
                 partitionsLabel.setText( NLS.bind(
                     Messages.getString( "OverviewPage.ThereAreXPartitionsDefined" ), partitions.size() ) ); //$NON-NLS-1$
             }
+            
             partitionsTableViewer.setInput( partitions.toArray() );
 
             // Options
             allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess() );
             enableAccessControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled() );
+            enableHiddenPasswordCheckbox.setSelection( directoryServiceBean.isDsPasswordHidden() );
 
             addListeners();
         }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java Mon Mar 23 17:59:02 2015
@@ -55,6 +55,59 @@ import org.eclipse.ui.forms.widgets.Sect
 /**
  * This class represents the Password Policies Master/Details Block used in the Password Policies Page.
  *
+ * <pre>
+ * +------------------------------------------------------------------------------------+
+ * | .----------------------------------. .-------------------------------------------. |
+ * | | All password Policies            | | Password Policy Details                   | |
+ * | +----------------------------------+ +-------------------------------------------+ |
+ * | | +---------------------+          | | Set the properties of the password Policy | |
+ * | | | Default (enabled)   | [ Add  ] | |  [X] Enabled                              | |
+ * | | |                     | [Delete] | |  ID :          [//////////]               | |
+ * | | |                     |          | |  Description : [////////////////////////] | |
+ * | | |                     |          | |  Attribute   : [////////////////////////] | |
+ * | | |                     |          | .-------------------------------------------. |
+ * | | |                     |          | | Quality                                   | |
+ * | | |                     |          | +-------------------------------------------+ |
+ * | | |                     |          | | Check quality : [=======================] | |
+ * | | |                     |          | | Validator :     [///////////////////////] | |
+ * | | |                     |          | | [X] Enable Minimum Length                 | |
+ * | | |                     |          | |   Number of chars : [NNN]                 | |
+ * | | |                     |          | | [X] Enable Maximum Length                 | |
+ * | | |                     |          | |   Number of chars : [NNN]                 | |
+ * | | |                     |          | .-------------------------------------------. |
+ * | | |                     |          | | Expiration                                | |
+ * | | |                     |          | +-------------------------------------------+ |
+ * | | |                     |          | | Minimum age (seconds): [NNN]              | |
+ * | | |                     |          | | Maximum age (seconds): [NNN]              | |
+ * | | |                     |          | | [X] Enable Expire Warning                 | |
+ * | | |                     |          | |   Number of seconds  : [NNN]              | |
+ * | | |                     |          | | [X] Enable Grace Authentication Limit     | |
+ * | | |                     |          | |   Number of times    : [NNN]              | |
+ * | | |                     |          | | [X] Enable Grace Expire                   | |
+ * | | |                     |          | |   Interval (seconds) : [NNN]              | |
+ * | | |                     |          | .-------------------------------------------. |
+ * | | |                     |          | | Options                                   | |
+ * | | |                     |          | +-------------------------------------------+ |
+ * | | |                     |          | | [X] Enable Must Change                    | |
+ * | | |                     |          | | [X] Enable Allow User Change              | |
+ * | | |                     |          | | [X] Enable Safe Modify                    | |
+ * | | |                     |          | .-------------------------------------------. |
+ * | | |                     |          | | Lockout                                   | |
+ * | | |                     |          | +-------------------------------------------+ |
+ * | | |                     |          | | [X] Enable Lockout                        | |
+ * | | |                     |          | |   Lockout duration (seconds)   : [NNN]    | |
+ * | | |                     |          | |   Maximum Consecutive Failures : [NNN]    | |
+ * | | |                     |          | |   Failure Count Interval       : [NNN]    | |
+ * | | |                     |          | | [X] Enable Maximum Idle                   | |
+ * | | |                     |          | |   Intervals                    : [NNN]    | |
+ * | | |                     |          | | [X] Enable In History                     | |
+ * | | |                     |          | |   Used passwords stored in Hist: [NNN]    | |
+ * | | |                     |          | | [X] Delay                                 | |
+ * | | |                     |          | |   Minimum delay (seconds)      : [NNN]    | |
+ * | | +---------------------+          | |   Maximum delay (seconds)      : [NNN]    | |
+ * | +----------------------------------+ +-------------------------------------------+ |
+ * +------------------------------------------------------------------------------------+
+ * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class PasswordPoliciesMasterDetailsBlock extends MasterDetailsBlock
@@ -78,8 +131,7 @@ public class PasswordPoliciesMasterDetai
     /**
      * Creates a new instance of PasswordPoliciesMasterDetailsBlock.
      *
-     * @param page
-     *      the associated page
+     * @param page the associated page
      */
     public PasswordPoliciesMasterDetailsBlock( PasswordPoliciesPage page )
     {
@@ -181,6 +233,7 @@ public class PasswordPoliciesMasterDetai
                 return super.getImage( element );
             }
         } );
+        
         viewer.setComparator( new ViewerComparator()
         {
             public int compare( Viewer viewer, Object e1, Object e2 )

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java Mon Mar 23 17:59:02 2015
@@ -20,6 +20,7 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.server.config.beans.AuthenticationInterceptorBean;
 import org.apache.directory.server.config.beans.DirectoryServiceBean;
 import org.apache.directory.server.config.beans.InterceptorBean;
@@ -29,17 +30,25 @@ import org.eclipse.ui.forms.widgets.Form
 
 
 /**
- * This class represents the General Page of the Server Configuration Editor.
+ * This class represents the PasswordPolicy Page of the Server Configuration Editor. It has 
+ * two parts :
+ * <ul>
+ * <li>The list of existing password policies</li>
+ * <li>The detail for each selected password policy</li>
+ * </ul>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class PasswordPoliciesPage extends ServerConfigurationEditorPage
 {
+    /** The authentication interceptor name */
     private static final String AUTHENTICATION_INTERCEPTOR_ID = "authenticationInterceptor";
+    
+    /** Default name for the passwordPolicy */
     private static final String PASSWORD_POLICY_ID_DEFAULT = "default";
-
+    
     /** The Page ID*/
-    public static final String ID = PasswordPoliciesPage.class.getName(); //$NON-NLS-1$
+    public static final String ID = PasswordPoliciesPage.class.getName(); 
 
     /** The Page Title */
     private static final String TITLE = Messages.getString( "PasswordPoliciesPage.PasswordPolicies" ); //$NON-NLS-1$
@@ -51,8 +60,7 @@ public class PasswordPoliciesPage extend
     /**
      * Creates a new instance of GeneralPage.
      *
-     * @param editor
-     *      the associated editor
+     * @param editor the associated editor
      */
     public PasswordPoliciesPage( ServerConfigurationEditor editor )
     {
@@ -177,22 +185,22 @@ public class PasswordPoliciesPage extend
 
             // Configuring the password policy
             passwordPolicy.setPwdId( PASSWORD_POLICY_ID_DEFAULT );
+            passwordPolicy.setPwdAttribute( SchemaConstants.USER_PASSWORD_AT );
+            passwordPolicy.setPwdMinAge( 0 );
             passwordPolicy.setPwdMaxAge( 0 );
-            passwordPolicy.setPwdFailureCountInterval( 30 );
-            passwordPolicy.setPwdAttribute( "userPassword" );
-            passwordPolicy.setPwdMaxFailure( 5 );
-            passwordPolicy.setPwdLockout( true );
-            passwordPolicy.setPwdMustChange( false );
-            passwordPolicy.setPwdLockoutDuration( 0 );
-            passwordPolicy.setPwdMinLength( 5 );
             passwordPolicy.setPwdInHistory( 5 );
-            passwordPolicy.setPwdExpireWarning( 600 );
-            passwordPolicy.setPwdMinAge( 0 );
-            passwordPolicy.setPwdAllowUserChange( true );
-            passwordPolicy.setPwdGraceAuthNLimit( 5 );
             passwordPolicy.setPwdCheckQuality( 1 );
+            passwordPolicy.setPwdMinLength( 5 );
             passwordPolicy.setPwdMaxLength( 0 );
+            passwordPolicy.setPwdExpireWarning( 600 );
+            passwordPolicy.setPwdGraceAuthNLimit( 5 );
             passwordPolicy.setPwdGraceExpire( 0 );
+            passwordPolicy.setPwdLockout( true );
+            passwordPolicy.setPwdLockoutDuration( 0 );
+            passwordPolicy.setPwdMaxFailure( 5 );
+            passwordPolicy.setPwdFailureCountInterval( 30 );
+            passwordPolicy.setPwdMustChange( false );
+            passwordPolicy.setPwdAllowUserChange( true );
             passwordPolicy.setPwdMinDelay( 0 );
             passwordPolicy.setPwdMaxDelay( 0 );
             passwordPolicy.setPwdMaxIdle( 0 );

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyDetailsPage.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyDetailsPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyDetailsPage.java Mon Mar 23 17:59:02 2015
@@ -52,6 +52,58 @@ import org.eclipse.ui.forms.widgets.Tabl
 
 /**
  * This class represents the Details Page of the Server Configuration Editor for the Password Policy type
+ * 
+ * <pre>
+ * .-------------------------------------------.
+ * | Password Policy Details                   |
+ * +-------------------------------------------+
+ * | Set the properties of the password Policy |
+ * |  [X] Enabled                              |
+ * |  ID :          [//////////]               |
+ * |  Description : [////////////////////////] |
+ * |  Attribute   : [////////////////////////] |
+ * .-------------------------------------------.
+ * | Quality                                   |
+ * +-------------------------------------------+
+ * | Check quality : [=======================] |
+ * | Validator :     [///////////////////////] |
+ * | [X] Enable Minimum Length                 |
+ * |   Number of chars : [NNN]                 |
+ * | [X] Enable Maximum Length                 |
+ * |   Number of chars : [NNN]                 |
+ * .-------------------------------------------.
+ * | Expiration                                |
+ * +-------------------------------------------+
+ * | Minimum age (seconds): [NNN]              |
+ * | Maximum age (seconds): [NNN]              |
+ * | [X] Enable Expire Warning                 |
+ * |   Number of seconds  : [NNN]              |
+ * | [X] Enable Grace Authentication Limit     |
+ * |   Number of times    : [NNN]              |
+ * | [X] Enable Grace Expire                   |
+ * |   Interval (seconds) : [NNN]              |
+ * .-------------------------------------------.
+ * | Options                                   |
+ * +-------------------------------------------+
+ * | [X] Enable Must Change                    |
+ * | [X] Enable Allow User Change              |
+ * | [X] Enable Safe Modify                    |
+ * .-------------------------------------------.
+ * | Lockout                                   |
+ * +-------------------------------------------+
+ * | [X] Enable Lockout                        |
+ * |   Lockout duration (seconds)   : [NNN]    |
+ * |   Maximum Consecutive Failures : [NNN]    |
+ * |   Failure Count Interval       : [NNN]    |
+ * | [X] Enable Maximum Idle                   |
+ * |   Intervals                    : [NNN]    |
+ * | [X] Enable In History                     |
+ * |   Used passwords stored in Hist: [NNN]    |
+ * | [X] Delay                                 |
+ * |   Minimum delay (seconds)      : [NNN]    |
+ * |   Maximum delay (seconds)      : [NNN]    |
+ * +-------------------------------------------+
+ * </pre>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -95,6 +147,8 @@ public class PasswordPolicyDetailsPage i
     private Text inHistoryText;
     private Button maxIdleCheckbox;
     private Text maxIdleText;
+    private Text minimumDelayText;
+    private Text maximumDelayText;
 
     // Listeners
     /** The Text Modify Listener */
@@ -269,6 +323,9 @@ public class PasswordPolicyDetailsPage i
         layout.bottomMargin = 2;
         parent.setLayout( layout );
 
+        // Depending on if the PP is enabled or disabled, we will
+        // expose the configuration
+        
         createDetailsSection( toolkit, parent );
         createQualitySection( toolkit, parent );
         createExpirationSection( toolkit, parent );
@@ -297,6 +354,7 @@ public class PasswordPolicyDetailsPage i
         section.setLayoutData( td );
         Composite client = toolkit.createComposite( section );
         toolkit.paintBordersFor( client );
+        
         GridLayout glayout = new GridLayout( 2, false );
         client.setLayout( glayout );
         section.setClient( client );
@@ -522,6 +580,16 @@ public class PasswordPolicyDetailsPage i
             "Used passwords stored in history:" );
         inHistoryText = toolkit.createText( inHistoryRadioIndentComposite, "" );
         inHistoryText.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
+        
+        // Minimum delay (pwdMinDelay)
+        toolkit.createLabel( composite, "Mimimum Delay (seconds):" );
+        minimumDelayText = toolkit.createText( composite, "" );
+        minimumDelayText.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
+
+        // Maximum Delay (pwdMaxDelay)
+        toolkit.createLabel( composite, "Maximum Delay (seconds):" );
+        maximumDelayText = toolkit.createText( composite, "" );
+        maximumDelayText.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
     }
 
 
@@ -600,6 +668,10 @@ public class PasswordPolicyDetailsPage i
         inHistoryCheckbox.addSelectionListener( inHistoryCheckboxSelectionListener );
         inHistoryText.addModifyListener( textModifyListener );
         inHistoryText.addVerifyListener( integerVerifyListener );
+        minimumDelayText.addModifyListener( textModifyListener );
+        minimumDelayText.addVerifyListener( integerVerifyListener );
+        maximumDelayText.addModifyListener( textModifyListener );
+        maximumDelayText.addVerifyListener( integerVerifyListener );
     }
 
 
@@ -656,6 +728,10 @@ public class PasswordPolicyDetailsPage i
         inHistoryCheckbox.removeSelectionListener( inHistoryCheckboxSelectionListener );
         inHistoryText.removeModifyListener( textModifyListener );
         inHistoryText.removeVerifyListener( integerVerifyListener );
+        minimumDelayText.removeModifyListener( textModifyListener );
+        minimumDelayText.removeVerifyListener( integerVerifyListener );
+        maximumDelayText.removeModifyListener( textModifyListener );
+        maximumDelayText.removeVerifyListener( integerVerifyListener );
     }
 
 
@@ -881,6 +957,26 @@ public class PasswordPolicyDetailsPage i
             {
                 passwordPolicy.setPwdInHistory( 0 );
             }
+
+            // Minimum Delay
+            try
+            {
+                passwordPolicy.setPwdMinDelay( Integer.parseInt( minimumDelayText.getText() ) );
+            }
+            catch ( NumberFormatException e )
+            {
+                passwordPolicy.setPwdMinDelay( 0 );
+            }
+
+            // Maximum Delay
+            try
+            {
+                passwordPolicy.setPwdMaxDelay( Integer.parseInt( maximumDelayText.getText() ) );
+            }
+            catch ( NumberFormatException e )
+            {
+                passwordPolicy.setPwdMaxDelay( 0 );
+            }
         }
     }
 
@@ -1051,6 +1147,12 @@ public class PasswordPolicyDetailsPage i
             inHistoryCheckbox.setSelection( inHistory != 0 );
             inHistoryText.setText( "" + inHistory );
             inHistoryText.setEnabled( inHistory != 0 );
+
+            // Minimum Delay
+            minimumDelayText.setText( "" + passwordPolicy.getPwdMinDelay() );
+
+            // Maximum Delay
+            maximumDelayText.setText( "" + passwordPolicy.getPwdMaxDelay() );
         }
 
         addListeners();

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java Mon Mar 23 17:59:02 2015
@@ -21,10 +21,8 @@ package org.apache.directory.studio.apac
 
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.Enumeration;
 
 import org.apache.directory.server.config.ConfigWriter;
-import org.apache.directory.server.config.beans.ConfigBean;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.jobs.LoadConfigurationRunnable;
 import org.apache.directory.studio.apacheds.configuration.v2.jobs.SaveConfigurationRunnable;
@@ -44,7 +42,16 @@ import org.eclipse.ui.forms.editor.FormE
 
 
 /**
- * This class implements the Server Configuration Editor.
+ * This class implements the Server Configuration Editor. This editor expose
+ * 6 pages into a form with 6 tags :
+ * <ul>
+ * <li>Overview : the basic configuration</li>
+ * <li>LDAP/LDAPS : the configuration for the LDAP/S server</li>
+ * <li>Kerberos : the configuration for the Kerberos server</li>
+ * <li>Partitions : The partitions configuration</li>
+ * <li>PasswordPolicy : The password policy configuration</li>
+ * <li>Replication : The replicationconfiguration</li>
+ * </ul> 
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -56,10 +63,10 @@ public class ServerConfigurationEditor e
     /** The flag indicating if the editor is dirty */
     private boolean dirty = false;
 
-    /** The configuration bean */
-    private ConfigBean configBean;
+    /** The configuration including bean and underlying parttiton */
+    private Configuration configuration;
 
-    // The pages
+    /** The pages */
     private LoadingPage loadingPage;
     private OverviewPage overviewPage;
     private LdapLdapsServersPage ldapLdapsServersPage;
@@ -69,6 +76,8 @@ public class ServerConfigurationEditor e
     private ReplicationPage replicationPage;
 
 
+
+
     /**
      * {@inheritDoc}
      */
@@ -142,9 +151,11 @@ public class ServerConfigurationEditor e
     private void showOrHideTabFolder()
     {
         Composite container = getContainer();
+        
         if ( container instanceof CTabFolder )
         {
             CTabFolder folder = ( CTabFolder ) container;
+            
             if ( getPageCount() == 1 )
             {
                 folder.setTabHeight( 0 );
@@ -153,6 +164,7 @@ public class ServerConfigurationEditor e
             {
                 folder.setTabHeight( -1 );
             }
+            
             folder.layout( true, true );
         }
     }
@@ -209,8 +221,7 @@ public class ServerConfigurationEditor e
     /**
      * Performs the "Save as..." action.
      *
-     * @param monitor
-     *      the monitor to use
+     * @param monitor the monitor to use
      * @throws Exception
      */
     public boolean doSaveAs( IProgressMonitor monitor ) throws Exception
@@ -220,10 +231,11 @@ public class ServerConfigurationEditor e
 
         // Saving the configuration as a new file and getting the associated new editor input
         IEditorInput newInput = ServerConfigurationEditorUtils.saveAs( monitor, getSite().getShell(),
-            getEditorInput(), getConfigWriter(), true );
+            getEditorInput(), getConfigWriter(), getConfiguration(), true );
 
         // Checking if the 'save as' is successful 
         boolean success = newInput != null;
+        
         if ( success )
         {
             // Setting the new input to the editor
@@ -281,8 +293,7 @@ public class ServerConfigurationEditor e
     /**
      * Sets the 'dirty' flag.
      *
-     * @param dirty
-     *      the 'dirty' flag
+     * @param dirty the 'dirty' flag
      */
     public void setDirty( boolean dirty )
     {
@@ -299,38 +310,35 @@ public class ServerConfigurationEditor e
 
 
     /**
-     * Gets the configuration bean.
+     * Gets the configuration.
      *
-     * @return
-     *      the configuration bean
+     * @return the configuration
      */
-    public ConfigBean getConfigBean()
+    public Configuration getConfiguration()
     {
-        return configBean;
+        return configuration;
     }
 
 
     /**
      * Sets the configuration.
      *
-     * @param configBean
-     *      the configuration bean
+     * @param configuration the configuration
      */
-    public void setConfiguration( ConfigBean configBean )
+    public void setConfiguration( Configuration configuration )
     {
-        this.configBean = configBean;
+        this.configuration = configuration;
     }
 
 
     /**
      * Resets the configuration and refresh the UI.
      *
-     * @param configBean
-     *      the configuration bean
+     * @param configuration the configuration
      */
-    public void resetConfiguration( ConfigBean configBean )
+    public void resetConfiguration( Configuration configuration )
     {
-        setConfiguration( configBean );
+        setConfiguration( configuration );
 
         setDirty( true );
 
@@ -347,12 +355,11 @@ public class ServerConfigurationEditor e
      * This method is called by the job responsible for loading the 
      * configuration when it has been fully and correctly loaded.
      *
-     * @param configBean
-     *      the loaded configuration bean
+     * @param configuration the configuration
      */
-    public void configurationLoaded( ConfigBean configBean )
+    public void configurationLoaded( Configuration configuration )
     {
-        setConfiguration( configBean );
+        setConfiguration( configuration );
 
         hideLoadingPageAndDisplayConfigPages();
     }
@@ -362,8 +369,7 @@ public class ServerConfigurationEditor e
      * This method is called by the job responsible for loading the
      * configuration when it failed to load it.
      *
-     * @param exception
-     *      the exception
+     * @param exception the exception
      */
     public void configurationLoadFailed( Exception exception )
     {
@@ -442,21 +448,18 @@ public class ServerConfigurationEditor e
     /**
      * Set a particular page as active if it is found in the pages vector.
      *
-     * @param pageClass
-     *      the class of the page
+     * @param pageClass the class of the page
      */
-    @SuppressWarnings("rawtypes")
     public void showPage( Class<?> pageClass )
     {
         if ( pageClass != null )
         {
-            Enumeration enumeration = pages.elements();
-            while ( enumeration.hasMoreElements() )
+            for ( Object page : pages )
             {
-                Object page = enumeration.nextElement();
                 if ( pageClass.isInstance( page ) )
                 {
                     setActivePage( pages.indexOf( page ) );
+                    
                     return;
                 }
             }
@@ -467,12 +470,12 @@ public class ServerConfigurationEditor e
     /**
      * Gets the configuration writer.
      *
-     * @return
-     *      the configuration writer
+     * @return the configuration writer
      * @throws Exception
      */
     public ConfigWriter getConfigWriter() throws Exception
     {
-        return new ConfigWriter( ApacheDS2ConfigurationPlugin.getDefault().getSchemaManager(), configBean );
+        return new ConfigWriter( ApacheDS2ConfigurationPlugin.getDefault().getSchemaManager(),
+            configuration.getConfigBean() );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java?rev=1668692&r1=1668691&r2=1668692&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java Mon Mar 23 17:59:02 2015
@@ -20,6 +20,9 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 import org.apache.directory.server.config.beans.ConfigBean;
 import org.apache.directory.server.config.beans.DirectoryServiceBean;
 import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorExportConfigurationAction;
@@ -43,11 +46,14 @@ import org.eclipse.swt.events.SelectionL
 import org.eclipse.swt.events.VerifyEvent;
 import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
 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.Control;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IEditorInput;
@@ -55,6 +61,7 @@ import org.eclipse.ui.forms.IManagedForm
 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;
 
 
 /**
@@ -64,6 +71,21 @@ import org.eclipse.ui.forms.widgets.Scro
  */
 public abstract class ServerConfigurationEditorPage extends FormPage
 {
+    /** The default LDAP port */
+    protected static final int DEFAULT_PORT_LDAP = 10389;
+    
+    /** The default LDAPS port */
+    protected static final int DEFAULT_PORT_LDAPS = 10636;
+    
+    /** The default Kerberos port */
+    protected static final int DEFAULT_PORT_KERBEROS = 60088;
+    
+    /** The default LDAPS port */
+    protected static final int DEFAULT_PORT_CHANGE_PASSWORD = 60464;
+    
+    /** The default IPV4 address for servers */
+    protected static final String DEFAULT_ADDRESS = "0.0.0.0"; //$NON-NLS-1$
+    
     protected static final Color GRAY_COLOR = new Color( null, 120, 120, 120 );
     protected static final String TABULATION = "      "; //$NON-NLS-1$
     
@@ -78,6 +100,8 @@ public abstract class ServerConfiguratio
             setEditorDirty();
         }
     };
+    
+    
     private SelectionListener dirtySelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
@@ -85,6 +109,8 @@ public abstract class ServerConfiguratio
             setEditorDirty();
         }
     };
+    
+    
     private ISelectionChangedListener dirtySelectionChangedListener = new ISelectionChangedListener()
     {
         public void selectionChanged( SelectionChangedEvent event )
@@ -97,8 +123,9 @@ public abstract class ServerConfiguratio
     /**
      * Creates a new instance of GeneralPage.
      *
-     * @param editor
-     *      the associated editor
+     * @param editor the associated editor
+     * @param id the unique identifier
+     * @param title The page title
      */
     public ServerConfigurationEditorPage( ServerConfigurationEditor editor, String id, String title )
     {
@@ -109,8 +136,7 @@ public abstract class ServerConfiguratio
     /**
      * Gets the ServerConfigurationEditor object associated with the page.
      *
-     * @return
-     *      the ServerConfigurationEditor object associated with the page
+     * @return the ServerConfigurationEditor object associated with the page
      */
     public ServerConfigurationEditor getServerConfigurationEditor()
     {
@@ -130,28 +156,26 @@ public abstract class ServerConfiguratio
     /**
      * Gets the configuration bean associated with the editor.
      *
-     * @return
-     *      the configuration bean associated with the editor
+     * @return the configuration bean associated with the editor
      */
     public ConfigBean getConfigBean()
     {
-        ConfigBean configBean = getServerConfigurationEditor().getConfigBean();
+        Configuration configuration = getServerConfigurationEditor().getConfiguration();
 
-        if ( configBean == null )
+        if ( configuration == null )
         {
-            configBean = new ConfigBean();
-            getServerConfigurationEditor().setConfiguration( configBean );
+            configuration = new Configuration( new ConfigBean(), null );
+            getServerConfigurationEditor().setConfiguration( configuration );
         }
 
-        return configBean;
+        return configuration.getConfigBean();
     }
 
 
     /**
      * Gets the directory service associated with the editor.
      *
-     * @return
-     *      the directory service bean associated with the editor
+     * @return the directory service bean associated with the editor
      */
     public DirectoryServiceBean getDirectoryServiceBean()
     {
@@ -217,10 +241,8 @@ public abstract class ServerConfiguratio
     /**
      * Subclasses must implement this method to create the content of their form.
      *
-     * @param parent
-     *      the parent element
-     * @param toolkit
-     *      the form toolkit
+     * @param parent the parent element
+     * @param toolkit the form toolkit
      */
     protected abstract void createFormContent( Composite parent, FormToolkit toolkit );
 
@@ -230,6 +252,7 @@ public abstract class ServerConfiguratio
      */
     protected abstract void refreshUI();
     
+    
     /**
      * Indicates if the page is initialized.
      *
@@ -245,12 +268,9 @@ public abstract class ServerConfiguratio
     /**
      * Creates a Text that can be used to enter a port number.
      *
-     * @param toolkit
-     *      the toolkit
-     * @param parent
-     *      the parent
-     * @return
-     *      a Text that can be used to enter a port number
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @return a Text that can be used to enter a port number
      */
     protected Text createPortText( FormToolkit toolkit, Composite parent )
     {
@@ -258,16 +278,33 @@ public abstract class ServerConfiguratio
         GridData gd = new GridData( SWT.NONE, SWT.NONE, false, false );
         gd.widthHint = 42;
         portText.setLayoutData( gd );
+        
         portText.addVerifyListener( new VerifyListener()
         {
             public void verifyText( VerifyEvent e )
             {
-                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                // Check that it's a valid port. It should be
+                // any value between 0 and 65535
+                // Skip spaces on both sides
+                char[] port = e.text.trim().toCharArray();
+
+                if ( port.length > 0 )
                 {
-                    e.doit = false;
+                    for ( char c : port )
+                    {
+                        if ( ( c < '0' ) || ( c > '9' ) )
+                        {
+                            // This is an error
+                            e.doit = false;
+                            break;
+                        }
+                    }
                 }
             }
         } );
+        
+        
+        // the port can only have 5 chars max
         portText.setTextLimit( 5 );
 
         return portText;
@@ -275,18 +312,153 @@ public abstract class ServerConfiguratio
 
 
     /**
+     * Creates a Text that can be used to enter an address. If the address is incorrect, 
+     * it will be in red while typing until it gets correct.
+     *
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @return a Text that can be used to enter an address
+     */
+    protected Text createAddressText( FormToolkit toolkit, Composite parent )
+    {
+        final Text addressText = toolkit.createText( parent, "" ); //$NON-NLS-1$
+        GridData gd = new GridData( SWT.NONE, SWT.NONE, false, false );
+        gd.widthHint = 200;
+        addressText.setLayoutData( gd );
+        
+        addressText.addModifyListener( new ModifyListener()
+        {
+            Display display = addressText.getDisplay();
+
+            // Check that the address is valid
+            public void modifyText( ModifyEvent e )
+            {
+                Text addressText = (Text)e.widget;
+                String address = addressText.getText();
+                
+                try
+                {
+                    InetAddress.getAllByName( address );
+                    addressText.setForeground( null );
+                }
+                catch ( UnknownHostException uhe )
+                {
+                    addressText.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
+                }
+            }
+        } );
+        
+        // An address can be fairly long...
+        addressText.setTextLimit( 256 );
+
+        return addressText;
+    }
+
+
+    /**
+     * Creates a Text that can be used to enter the number of threads
+     * (which limit is 999)
+     *
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @return a Text that can be used to enter the number of threads
+     */
+    protected Text createNbThreadsText( FormToolkit toolkit, Composite parent )
+    {
+        Text nbThreadsText = toolkit.createText( parent, "" ); //$NON-NLS-1$
+        GridData gd = new GridData( SWT.NONE, SWT.NONE, false, false );
+        gd.widthHint = 42;
+        nbThreadsText.setLayoutData( gd );
+        
+        nbThreadsText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                // Check that it's a valid number of threads. It should be
+                // any value between 0 and 999
+                // Skip spaces on both sides
+                char[] nbThreads = e.text.trim().toCharArray();
+
+                if ( nbThreads.length > 0 )
+                {
+                    for ( char c : nbThreads )
+                    {
+                        if ( ( c < '0' ) || ( c > '9' ) )
+                        {
+                            // This is an error
+                            e.doit = false;
+                            break;
+                        }
+                    }
+                }
+            }
+        } );
+        
+        
+        // We can't have more than 999 threads
+        nbThreadsText.setTextLimit( 3 );
+
+        return nbThreadsText;
+    }
+
+
+    /**
+     * Creates a Text that can be used to enter the backLog size
+     *
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @return a Text that can be used to enter the backlog size
+     */
+    protected Text createBackLogSizeText( FormToolkit toolkit, Composite parent )
+    {
+        Text backLogSizetText = toolkit.createText( parent, "" ); //$NON-NLS-1$
+        GridData gd = new GridData( SWT.NONE, SWT.NONE, false, false );
+        gd.widthHint = 42;
+        backLogSizetText.setLayoutData( gd );
+        
+        backLogSizetText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                // Check that it's a valid size. It should be
+                // any value between 0 and 99999
+                // Skip spaces on both sides
+                char[] backlogSize = e.text.trim().toCharArray();
+
+                if ( backlogSize.length > 0 )
+                {
+                    for ( char c : backlogSize )
+                    {
+                        if ( ( c < '0' ) || ( c > '9' ) )
+                        {
+                            // This is an error
+                            e.doit = false;
+                            break;
+                        }
+                    }
+                }
+            }
+        } );
+        
+        
+        // the backlog size can only have 5 chars max
+        backLogSizetText.setTextLimit( 5 );
+
+        return backLogSizetText;
+    }
+
+
+    /**
      * Creates a Text that can be used to enter an integer.
      *
-     * @param toolkit
-     *      the toolkit
-     * @param parent
-     *      the parent
-     * @return
-     *      a Text that can be used to enter a port number
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @return a Text that can be used to enter a port number
      */
     protected Text createIntegerText( FormToolkit toolkit, Composite parent )
     {
         Text integerText = toolkit.createText( parent, "" ); //$NON-NLS-1$
+        
         integerText.addVerifyListener( new VerifyListener()
         {
             public void verifyText( VerifyEvent e )
@@ -305,14 +477,10 @@ public abstract class ServerConfiguratio
     /**
      * Creates default value Label.
      *
-     * @param toolkit
-     *      the toolkit
-     * @param parent
-     *      the parent
-     * @param text
-     *      the text string
-     * @return
-     *      a default value Label
+     * @param toolkit the toolkit
+     * @param parent the parent
+     * @param text the text string
+     * @return a default value Label
      */
     protected Label createDefaultValueLabel( FormToolkit toolkit, Composite parent, String text )
     {
@@ -325,12 +493,26 @@ public abstract class ServerConfiguratio
 
 
     /**
+     * Set some Label to Bold
+     *
+     * @param label the Label we want to see as Bold
+     * @return a Label with bold text
+     */
+    protected Label setBold( Label label )
+    {
+        FontData fontData = label.getFont().getFontData()[0];
+        Font font = new Font( label.getDisplay(), new FontData( fontData.getName(), fontData.getHeight(), SWT.BOLD ) );
+        label.setFont( font );
+
+        return label;
+    }
+
+
+    /**
      * Adds a modify listener to the given Text.
      *
-     * @param text
-     *      the Text control
-     * @param listener
-     *      the listener
+     * @param text the Text control
+     * @param listener the listener
      */
     protected void addModifyListener( Text text, ModifyListener listener )
     {
@@ -344,10 +526,8 @@ public abstract class ServerConfiguratio
     /**
      * Adds a selection changed listener to the given Viewer.
      *
-     * @param viewer
-     *      the viewer control
-     * @param listener
-     *      the listener
+     * @param viewer the viewer control
+     * @param listener the listener
      */
     protected void addSelectionChangedListener( Viewer viewer, ISelectionChangedListener listener )
     {
@@ -362,10 +542,8 @@ public abstract class ServerConfiguratio
     /**
      * Adds a double click listener to the given StructuredViewer.
      *
-     * @param viewer
-     *      the viewer control
-     * @param listener
-     *      the listener
+     * @param viewer the viewer control
+     * @param listener the listener
      */
     protected void addDoubleClickListener( StructuredViewer viewer, IDoubleClickListener listener )
     {
@@ -380,10 +558,8 @@ public abstract class ServerConfiguratio
     /**
      * Adds a selection listener to the given Button.
      *
-     * @param button
-     *      the Button control
-     * @param listener
-     *      the listener
+     * @param button the Button control
+     * @param listener the listener
      */
     protected void addSelectionListener( Button button, SelectionListener listener )
     {
@@ -397,10 +573,8 @@ public abstract class ServerConfiguratio
     /**
      * Removes a modify listener to the given Text.
      *
-     * @param text
-     *      the Text control
-     * @param listener
-     *      the listener
+     * @param text the Text control
+     * @param listener the listener
      */
     protected void removeModifyListener( Text text, ModifyListener listener )
     {
@@ -414,10 +588,8 @@ public abstract class ServerConfiguratio
     /**
      * Removes a selection changed listener to the given Viewer.
      *
-     * @param viewer
-     *      the viewer control
-     * @param listener
-     *      the listener
+     * @param viewer the viewer control
+     * @param listener the listener
      */
     protected void removeSelectionChangedListener( Viewer viewer, ISelectionChangedListener listener )
     {
@@ -432,10 +604,8 @@ public abstract class ServerConfiguratio
     /**
      * Removes a selection changed listener to the given Viewer.
      *
-     * @param viewer
-     *      the viewer control
-     * @param listener
-     *      the listener
+     * @param viewer the viewer control
+     * @param listener the listener
      */
     protected void removeDoubleClickListener( StructuredViewer viewer, IDoubleClickListener listener )
     {
@@ -450,10 +620,8 @@ public abstract class ServerConfiguratio
     /**
      * Removes a selection listener to the given Button.
      *
-     * @param button
-     *      the Button control
-     * @param listener
-     *      the listener
+     * @param button the Button control
+     * @param listener the listener
      */
     protected void removeSelectionListener( Button button, SelectionListener listener )
     {
@@ -467,8 +635,7 @@ public abstract class ServerConfiguratio
     /**
      * Adds a 'dirty' listener to the given Text.
      *
-     * @param text
-     *      the Text control
+     * @param text the Text control
      */
     protected void addDirtyListener( Text text )
     {
@@ -479,8 +646,7 @@ public abstract class ServerConfiguratio
     /**
      * Adds a 'dirty' listener to the given Button.
      *
-     * @param button
-     *      the Button control
+     * @param button the Button control
      */
     protected void addDirtyListener( Button button )
     {
@@ -491,8 +657,7 @@ public abstract class ServerConfiguratio
     /**
      * Adds a 'dirty' listener to the given Viewer.
      *
-     * @param viewer
-     *      the viewer control
+     * @param viewer the viewer control
      */
     protected void addDirtyListener( Viewer viewer )
     {
@@ -503,8 +668,7 @@ public abstract class ServerConfiguratio
     /**
      * Removes a 'dirty' listener to the given Text.
      *
-     * @param text
-     *      the Text control
+     * @param text the Text control
      */
     protected void removeDirtyListener( Text text )
     {
@@ -515,8 +679,7 @@ public abstract class ServerConfiguratio
     /**
      * Removes a 'dirty' listener to the given Button.
      *
-     * @param button
-     *      the Button control
+     * @param button the Button control
      */
     protected void removeDirtyListener( Button button )
     {
@@ -527,8 +690,7 @@ public abstract class ServerConfiguratio
     /**
      * Removes a 'dirty' listener to the given Viewer.
      *
-     * @param viewer
-     *      the viewer control
+     * @param viewer the viewer control
      */
     protected void removeDirtyListener( Viewer viewer )
     {
@@ -542,10 +704,8 @@ public abstract class ServerConfiguratio
      * Verifies that the button exists and is not disposed 
      * before applying the new selection state.
      *
-     * @param button
-     *      the button
-     * @param selected
-     *      the new selection state
+     * @param button the button
+     * @param selected the new selection state
      */
     protected void setSelection( Button button, boolean selected )
     {
@@ -562,10 +722,8 @@ public abstract class ServerConfiguratio
      * Verifies that the viewer exists and is not disposed 
      * before applying the new selection.
      *
-     * @param button
-     *      the button
-     * @param selection
-     *      the new selection
+     * @param button the button
+     * @param selection the new selection
      */
     protected void setSelection( Viewer viewer, Object selection )
     {
@@ -582,10 +740,8 @@ public abstract class ServerConfiguratio
      * Verifies that the button exists and is not disposed 
      * before applying the new text.
      *
-     * @param text
-     *      the text
-     * @param string
-     *       the new text
+     * @param text the text
+     * @param string the new text
      */
     protected void setText( Text text, String string )
     {
@@ -642,4 +798,31 @@ public abstract class ServerConfiguratio
         gd.widthHint = 50;
         control.setLayoutData( gd );
     }
+    
+    
+    /**
+     * A shared method used to create a Section, based on a GridLayout.
+     * 
+     * @param toolkit The Form toolkit
+     * @param parent The parent 
+     * @param title The Section title
+     * @param nbColumns The number of columns for the inner grid
+     * 
+     * @return The created Composite
+     */
+    protected Composite createSection( FormToolkit toolkit, Composite parent, String title, int nbColumns, int style )
+    {
+        Section section = toolkit.createSection( parent, style );
+        section.setText( Messages.getString( title ) );
+        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        Composite composite = toolkit.createComposite( section );
+        toolkit.paintBordersFor( composite );
+        GridLayout gridLayout = new GridLayout( nbColumns, false );
+        gridLayout.marginHeight = 0;
+        gridLayout.marginWidth = 0;
+        composite.setLayout( gridLayout );
+        section.setClient( composite );
+
+        return composite;
+    }
 }



Mime
View raw message