directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1180974 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/
Date Mon, 10 Oct 2011 13:59:46 GMT
Author: pamarcelot
Date: Mon Oct 10 13:59:46 2011
New Revision: 1180974

URL: http://svn.apache.org/viewvc?rev=1180974&view=rev
Log:
Added support for adding/editing/deleting partitions.
Added a placeholder label to the Replication page.
Reorganized UI in the Kerboros and LDAP/LDAPS servers pages.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionDetailsPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.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/KerberosServerPage.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java Mon Oct 10 13:59:46 2011
@@ -232,8 +232,8 @@ public class KerberosServerPage extends 
         rightComposite.setLayoutData( rightCompositeTableWrapData );
 
         createKerberosServerSection( toolkit, leftComposite );
-        createKerberosSettingsSection( toolkit, rightComposite );
-        createTicketSettingsSection( toolkit, leftComposite );
+        createKerberosSettingsSection( toolkit, leftComposite );
+        createTicketSettingsSection( toolkit, rightComposite );
 
         refreshUI();
     }
@@ -293,14 +293,14 @@ public class KerberosServerPage extends 
         // KDC Principal
         toolkit.createLabel( composite, "KDC Principal:" );
         kdcPrincipalText = toolkit.createText( composite, "" );
-        kdcPrincipalText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( kdcPrincipalText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslHostLabel = createDefaultValueLabel( toolkit, composite, "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
         defaultSaslHostLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
 
         // SASL Principal
         toolkit.createLabel( composite, "Primary KDC Realm:" );
         primaryKdcRealmText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        primaryKdcRealmText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( primaryKdcRealmText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslPrincipalLabel = createDefaultValueLabel( toolkit, composite,
             "EXAMPLE.COM" );
         defaultSaslPrincipalLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
@@ -308,15 +308,15 @@ public class KerberosServerPage extends 
         // Search Base Dn
         toolkit.createLabel( composite, "Search Base Dn:" );
         kdcSearchBaseDnText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        kdcSearchBaseDnText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( kdcSearchBaseDnText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslSearchBaseDnLabel = createDefaultValueLabel( toolkit, composite, "ou=users,dc=example,dc=com" );
         defaultSaslSearchBaseDnLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
 
         // Encryption Types
         toolkit.createLabel( composite, "Encryption Types:" );
         encryptionTypesText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        encryptionTypesText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-        Label defaultEncryptionTypesLabel = createDefaultValueLabel( toolkit, composite, "des-cbc-md5" );
+        setGridDataWithDefaultWidth( encryptionTypesText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        Label defaultEncryptionTypesLabel = createDefaultValueLabel( toolkit, composite, "[des-cbc-md5]" );
         defaultEncryptionTypesLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
     }
 
@@ -337,33 +337,47 @@ public class KerberosServerPage extends 
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout glayout = new GridLayout( 2, true );
-        composite.setLayout( glayout );
+        GridLayout layout = new GridLayout( 3, false );
+        composite.setLayout( layout );
         section.setClient( composite );
 
         allowClockSkewCheckbox = toolkit.createButton( composite, "Allow Clock Skew", SWT.CHECK );
+        allowClockSkewCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns, 1 ) );
         verifyBodyChecksumCheckbox = toolkit.createButton( composite, "Verify Body Checksum", SWT.CHECK );
+        verifyBodyChecksumCheckbox
+            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns, 1 ) );
 
         allowEmptyAddressesCheckbox = toolkit.createButton( composite, "Allow Empty Addresses", SWT.CHECK );
+        allowEmptyAddressesCheckbox
+            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns, 1 ) );
+
         allowForwardableAddressesCheckbox = toolkit.createButton( composite, "Allow Forwardable Addresses",
             SWT.CHECK );
+        allowForwardableAddressesCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
+            layout.numColumns, 1 ) );
 
         requirePreAuthByEncryptedTimestampCheckbox = toolkit.createButton( composite,
-            "Require Pre-Authentication By Encrypted TimeStamp", SWT.CHECK );
+            "Require Pre-Authentication\nBy Encrypted TimeStamp", SWT.CHECK );
+        requirePreAuthByEncryptedTimestampCheckbox
+            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns, 1 ) );
+
         allowPostdatedTicketsCheckbox = toolkit.createButton( composite, "Allow Postdated Tickets", SWT.CHECK );
+        allowPostdatedTicketsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns,
+            1 ) );
 
         allowRenewableTicketsCheckbox = toolkit.createButton( composite, "Allow Renewable Tickets", SWT.CHECK );
-        toolkit.createLabel( composite, "" );
+        allowRenewableTicketsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, layout.numColumns,
+            1 ) );
 
-        Composite maximumRenewableLifetimeComposite = toolkit.createComposite( composite );
-        maximumRenewableLifetimeComposite.setLayout( new GridLayout( 2, false ) );
-        toolkit.createLabel( maximumRenewableLifetimeComposite, "Maximum Renewable Lifetime:" );
-        maximumRenewableLifetimeText = createIntegerText( toolkit, maximumRenewableLifetimeComposite );
-
-        Composite maximumTicketLifetimeComposite = toolkit.createComposite( composite );
-        maximumTicketLifetimeComposite.setLayout( new GridLayout( 2, false ) );
-        toolkit.createLabel( maximumTicketLifetimeComposite, "Maximum Ticket Lifetime:" );
-        maximumTicketLifetimeText = createIntegerText( toolkit, maximumTicketLifetimeComposite );
+        toolkit.createLabel( composite, "Max. Renewable Lifetime:" );
+        maximumRenewableLifetimeText = createIntegerText( toolkit, composite );
+        setGridDataWithDefaultWidth( maximumRenewableLifetimeText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        toolkit.createLabel( composite, "ms" );
+
+        toolkit.createLabel( composite, "Max. Ticket Lifetime:" );
+        maximumTicketLifetimeText = createIntegerText( toolkit, composite );
+        setGridDataWithDefaultWidth( maximumTicketLifetimeText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        toolkit.createLabel( composite, "ms" );
     }
 
 
@@ -636,7 +650,8 @@ public class KerberosServerPage extends 
         {
             for ( TransportBean kdcServerTransportBean : kdcServerTransportBeans )
             {
-                if ( "tcp".equals( kdcServerTransportBean.getTransportId() ) ) // TODO can either 'tcp' or 'udp'
+                if ( ( "tcp".equals( kdcServerTransportBean.getTransportId() ) )
+                    || ( "udp".equals( kdcServerTransportBean.getTransportId() ) ) )
                 {
                     transportBean = kdcServerTransportBean;
                     break;

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.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/LdapLdapsServersPage.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java Mon Oct 10 13:59:46 2011
@@ -266,7 +266,7 @@ public class LdapLdapsServersPage extend
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout glayout = new GridLayout( 3, false );
+        GridLayout glayout = new GridLayout( 2, false );
         composite.setLayout( glayout );
         section.setClient( composite );
 
@@ -274,7 +274,7 @@ public class LdapLdapsServersPage extend
         enableTlsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
 
         Button enableServerSidePasswordHashingCheckbox = toolkit.createButton( composite,
-            "Enable sever-side password hashing",
+            "Enable sever-side password\nhashing",
             SWT.CHECK );
         enableServerSidePasswordHashingCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
         toolkit.createLabel( composite, "Hashing Method:" );
@@ -282,6 +282,7 @@ public class LdapLdapsServersPage extend
         hashingMethodCombo.setItems( new String[]
             { "SSHA", "MD5" } );
         toolkit.adapt( hashingMethodCombo );
+        hashingMethodCombo.setText( "SSHA" );
         hashingMethodCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         createDefaultValueLabel( toolkit, composite, "SSHA" );
     }
@@ -303,7 +304,7 @@ public class LdapLdapsServersPage extend
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout glayout = new GridLayout( 3, true );
+        GridLayout glayout = new GridLayout( 3, false );
         composite.setLayout( glayout );
         section.setClient( composite );
 
@@ -312,7 +313,7 @@ public class LdapLdapsServersPage extend
         authMechDigestMd5Checkbox = toolkit.createButton( composite, "DIGEST-MD5", SWT.CHECK );
         authMechGssapiCheckbox = toolkit.createButton( composite, "GSSAPI", SWT.CHECK );
         authMechNtlmCheckbox = toolkit.createButton( composite, "NTLM", SWT.CHECK );
-        authMechGssSpnegoCheckbox = toolkit.createButton( composite, "GSS_SPNEGO", SWT.CHECK );
+        authMechGssSpnegoCheckbox = toolkit.createButton( composite, "GSS-SPNEGO", SWT.CHECK );
 
         // Supported Authentication Mechanisms Table
         //        Table supportedMechanismsTable = toolkit.createTable( composite, SWT.CHECK );
@@ -362,14 +363,14 @@ public class LdapLdapsServersPage extend
         // SASL Host
         toolkit.createLabel( composite, "SASL Host:" );
         saslHostText = toolkit.createText( composite, "" );
-        saslHostText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslHostText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslHostLabel = createDefaultValueLabel( toolkit, composite, "ldap.example.com" );
         defaultSaslHostLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
 
         // SASL Principal
         toolkit.createLabel( composite, "SASL Principal:" );
         saslPrincipalText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        saslPrincipalText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslPrincipalText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslPrincipalLabel = createDefaultValueLabel( toolkit, composite,
             "ldap/ldap.example.com@EXAMPLE.COM" );
         defaultSaslPrincipalLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
@@ -377,7 +378,7 @@ public class LdapLdapsServersPage extend
         // Search Base Dn
         toolkit.createLabel( composite, "Search Base Dn:" );
         saslSearchBaseDnText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        saslSearchBaseDnText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        setGridDataWithDefaultWidth( saslSearchBaseDnText, new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Label defaultSaslSearchBaseDnLabel = createDefaultValueLabel( toolkit, composite, "ou=users,dc=example,dc=com" );
         defaultSaslSearchBaseDnLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
     }
@@ -664,7 +665,7 @@ public class LdapLdapsServersPage extend
 
             // ID
             transportBean.setTransportId( id );
-            
+
             // Address
             transportBean.setTransportAddress( DEFAULT_ADDRESS );
 

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=1180974&r1=1180973&r2=1180974&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 Oct 10 13:59:46 2011
@@ -20,19 +20,20 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.server.config.beans.ChangePasswordServerBean;
 import org.apache.directory.server.config.beans.ConfigBean;
 import org.apache.directory.server.config.beans.DirectoryServiceBean;
 import org.apache.directory.server.config.beans.KdcServerBean;
+import org.apache.directory.server.config.beans.PartitionBean;
 import org.apache.directory.server.config.beans.TransportBean;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -267,14 +268,7 @@ public class OverviewPage extends Server
         partitionsTable.setLayoutData( gd );
         partitionsTableViewer = new TableViewer( partitionsTable );
         partitionsTableViewer.setContentProvider( new ArrayContentProvider() );
-        partitionsTableViewer.setLabelProvider( new LabelProvider()
-        {
-            public Image getImage( Object element )
-            {
-                return ApacheDS2ConfigurationPlugin.getDefault().getImage(
-                    ApacheDS2ConfigurationPluginConstants.IMG_PARTITION );
-            };
-        } );
+        partitionsTableViewer.setLabelProvider( PartitionsPage.PARTITIONS_LABEL_PROVIDER );
 
         openPartitionsConfigurationLink = toolkit.createHyperlink( composite,
             "Advanced Partitions configuration...", SWT.NONE );
@@ -411,11 +405,9 @@ public class OverviewPage extends Server
         enableChangePasswordCheckbox.setSelection( changePasswordServerBean.isEnabled() );
         changePasswordPortText.setText( "" + changePasswordServerBean.getTransports()[0].getSystemPort() );
 
-        partitionsLabel.setText( "There are 2 partitions defined:" );
-        List<String> partitionsList = new ArrayList<String>();
-        partitionsList.add( "dc=example,dc=com (id=example)" );
-        partitionsList.add( "ou=system (id=system)" );
-        partitionsTableViewer.setInput( partitionsList.toArray() );
+        List<PartitionBean> partitions = directoryServiceBean.getPartitions();
+        partitionsLabel.setText( NLS.bind( "There are {0} partitions defined:", partitions.size() ) );
+        partitionsTableViewer.setInput( partitions.toArray() );
 
         allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess() );
         enableAccesControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled() );

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionDetailsPage.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/PartitionDetailsPage.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionDetailsPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionDetailsPage.java Mon Oct 10 13:59:46 2011
@@ -20,12 +20,32 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import java.util.List;
+
+import org.apache.directory.server.config.beans.IndexBean;
+import org.apache.directory.server.config.beans.JdbmIndexBean;
+import org.apache.directory.server.config.beans.JdbmPartitionBean;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.name.Dn;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.events.VerifyEvent;
 import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.layout.GridData;
@@ -56,6 +76,12 @@ public class PartitionDetailsPage implem
     /** The Managed Form */
     private IManagedForm mform;
 
+    /** The input Partition */
+    private JdbmPartitionBean input;
+
+    /** The Indexed Attributes List */
+    private List<IndexBean> indexedAttributes;
+
     /** The dirty flag */
     private boolean dirty = false;
 
@@ -70,6 +96,89 @@ public class PartitionDetailsPage implem
     private Button indexedAttributeEditButton;
     private Button indexedAttributeDeleteButton;
 
+    // Listeners
+    /** The Text Modify Listener */
+    private ModifyListener textModifyListener = new ModifyListener()
+    {
+        public void modifyText( ModifyEvent e )
+        {
+            masterDetailsBlock.setEditorDirty();
+            dirty = true;
+        }
+    };
+
+    /** The Checkbox Selection Listener */
+    private SelectionListener checkboxSelectionListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            masterDetailsBlock.setEditorDirty();
+            dirty = true;
+        }
+    };
+
+    /** The Selection Changed Listener for the Indexed Attributes Table Viewer */
+    private ISelectionChangedListener indexedAttributesTableViewerListener = new ISelectionChangedListener()
+    {
+        public void selectionChanged( SelectionChangedEvent event )
+        {
+            indexedAttributeEditButton.setEnabled( !event.getSelection().isEmpty() );
+            indexedAttributeDeleteButton.setEnabled( !event.getSelection().isEmpty() );
+        }
+    };
+
+    /** The Double Click Listener for the Indexed Attributes Table Viewer */
+    private IDoubleClickListener indexedAttributesTableViewerDoubleClickListener = new IDoubleClickListener()
+    {
+        public void doubleClick( DoubleClickEvent event )
+        {
+            //            editSelectedIndexedAttribute();
+        }
+    };
+
+    /** The Listener for the Add button of the Indexed Attributes Section */
+    private SelectionListener indexedAttributeAddButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            //            IndexedAttributeDialog dialog = new IndexedAttributeDialog( new IndexedAttribute( "", 0 ) ); //$NON-NLS-1$
+            //            if ( Dialog.OK == dialog.open() )
+            //            {
+            //                indexedAttributes.add( dialog.getIndexedAttribute() );
+            //                indexedAttributesTableViewer.refresh();
+            //                masterDetailsBlock.setEditorDirty();
+            //                dirty = true;
+            //            }
+        }
+    };
+
+    /** The Listener for the Edit button of the Indexed Attributes Section */
+    private SelectionListener indexedAttributeEditButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            //            editSelectedIndexedAttribute();
+        }
+    };
+
+    /** The Listener for the Delete button of the Indexed Attributes Section */
+    private SelectionListener indexedAttributeDeleteButtonListener = new SelectionAdapter()
+    {
+        public void widgetSelected( SelectionEvent e )
+        {
+            StructuredSelection selection = ( StructuredSelection ) indexedAttributesTableViewer.getSelection();
+            if ( !selection.isEmpty() )
+            {
+                //                IndexedAttribute indexedAttribute = ( IndexedAttribute ) selection.getFirstElement();
+                //
+                //                indexedAttributes.remove( indexedAttribute );
+                //                indexedAttributesTableViewer.refresh();
+                //                masterDetailsBlock.setEditorDirty();
+                //                dirty = true;
+            }
+        }
+    };
+
 
     /**
      * Creates a new instance of PartitionDetailsPage.
@@ -114,7 +223,7 @@ public class PartitionDetailsPage implem
         Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
         section.marginWidth = 10;
         section.setText( "Partition Details" );
-        section.setDescription( " Partitions Details Description" );
+        section.setDescription( "Set the properties of the partition." );
         TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
         td.grabHorizontal = true;
         section.setLayoutData( td );
@@ -154,7 +263,7 @@ public class PartitionDetailsPage implem
         enableOptimizerCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
 
         // Synchronisation On Write
-        synchOnWriteCheckbox = toolkit.createButton( client, "Synchronization On Write:", SWT.CHECK );
+        synchOnWriteCheckbox = toolkit.createButton( client, "Synchronization On Write", SWT.CHECK );
         synchOnWriteCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) );
     }
 
@@ -172,7 +281,7 @@ public class PartitionDetailsPage implem
         Section indexedAttributesSection = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
         indexedAttributesSection.marginWidth = 10;
         indexedAttributesSection.setText( "Indexed Attributes" );
-        indexedAttributesSection.setDescription( "Indexed Attributes Description" );
+        indexedAttributesSection.setDescription( "Set the indexed attributes of the partition." );
         indexedAttributesSection.setLayoutData( new TableWrapData( TableWrapData.FILL ) );
         Composite indexedAttributesClient = toolkit.createComposite( indexedAttributesSection );
         toolkit.paintBordersFor( indexedAttributesClient );
@@ -185,7 +294,21 @@ public class PartitionDetailsPage implem
         indexedAttributesTable.setLayoutData( gd );
         indexedAttributesTableViewer = new TableViewer( indexedAttributesTable );
         indexedAttributesTableViewer.setContentProvider( new ArrayContentProvider() );
-        indexedAttributesTableViewer.setLabelProvider( new LabelProvider() );
+        indexedAttributesTableViewer.setLabelProvider( new LabelProvider()
+        {
+            public String getText( Object element )
+            {
+                if ( element instanceof JdbmIndexBean )
+                {
+                    JdbmIndexBean<String, Entry> jdbmIndexBean = ( JdbmIndexBean<String, Entry> ) element;
+
+                    return NLS.bind( "{0} [{1}]", jdbmIndexBean.getIndexAttributeId(),
+                        jdbmIndexBean.getIndexCacheSize() );
+                }
+
+                return super.getText( element );
+            }
+        } );
 
         GridData buttonsGD = new GridData( SWT.FILL, SWT.BEGINNING, false, false );
         buttonsGD.widthHint = IDialogConstants.BUTTON_WIDTH;
@@ -203,6 +326,42 @@ public class PartitionDetailsPage implem
     }
 
 
+    /**
+     * Adds listeners to UI fields.
+     */
+    private void addListeners()
+    {
+        idText.addModifyListener( textModifyListener );
+        cacheSizeText.addModifyListener( textModifyListener );
+        suffixText.addModifyListener( textModifyListener );
+        enableOptimizerCheckbox.addSelectionListener( checkboxSelectionListener );
+        synchOnWriteCheckbox.addSelectionListener( checkboxSelectionListener );
+
+        indexedAttributesTableViewer.addSelectionChangedListener( indexedAttributesTableViewerListener );
+        indexedAttributesTableViewer.addDoubleClickListener( indexedAttributesTableViewerDoubleClickListener );
+        indexedAttributeAddButton.addSelectionListener( indexedAttributeAddButtonListener );
+        indexedAttributeEditButton.addSelectionListener( indexedAttributeEditButtonListener );
+        indexedAttributeDeleteButton.addSelectionListener( indexedAttributeDeleteButtonListener );
+    }
+
+
+    /**
+     * Removes listeners to UI fields.
+     */
+    private void removeListeners()
+    {
+        idText.removeModifyListener( textModifyListener );
+        cacheSizeText.removeModifyListener( textModifyListener );
+        suffixText.removeModifyListener( textModifyListener );
+        enableOptimizerCheckbox.removeSelectionListener( checkboxSelectionListener );
+        synchOnWriteCheckbox.removeSelectionListener( checkboxSelectionListener );
+
+        indexedAttributesTableViewer.removeSelectionChangedListener( indexedAttributesTableViewerListener );
+        indexedAttributesTableViewer.removeDoubleClickListener( indexedAttributesTableViewerDoubleClickListener );
+        indexedAttributeAddButton.removeSelectionListener( indexedAttributeAddButtonListener );
+        indexedAttributeEditButton.removeSelectionListener( indexedAttributeEditButtonListener );
+        indexedAttributeDeleteButton.removeSelectionListener( indexedAttributeDeleteButtonListener );
+    }
 
 
     /* (non-Javadoc)
@@ -210,6 +369,16 @@ public class PartitionDetailsPage implem
      */
     public void selectionChanged( IFormPart part, ISelection selection )
     {
+        IStructuredSelection ssel = ( IStructuredSelection ) selection;
+        if ( ssel.size() == 1 )
+        {
+            input = ( JdbmPartitionBean ) ssel.getFirstElement();
+        }
+        else
+        {
+            input = null;
+        }
+        refresh();
     }
 
 
@@ -218,6 +387,22 @@ public class PartitionDetailsPage implem
      */
     public void commit( boolean onSave )
     {
+        if ( input != null )
+        {
+            input.setPartitionId( idText.getText() );
+            input.setPartitionCacheSize( Integer.parseInt( cacheSizeText.getText() ) );
+            try
+            {
+                input.setPartitionSuffix( new Dn( suffixText.getText() ) );
+            }
+            catch ( LdapInvalidDnException e )
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+            input.setJdbmPartitionOptimizerEnabled( enableOptimizerCheckbox.getSelection() );
+            input.setPartitionSyncOnWrite( synchOnWriteCheckbox.getSelection() );
+        }
     }
 
 
@@ -256,6 +441,36 @@ public class PartitionDetailsPage implem
     }
 
 
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#refresh()
+     */
+    public void refresh()
+    {
+        removeListeners();
+
+        // ID
+        String id = input.getPartitionId();
+        idText.setText( ( id == null ) ? "" : id ); //$NON-NLS-1$
+
+        // Cache Size
+        cacheSizeText.setText( "" + input.getPartitionCacheSize() ); //$NON-NLS-1$
+
+        // Suffix
+        Dn suffix = input.getPartitionSuffix();
+        suffixText.setText( ( suffix == null ) ? "" : suffix.toString() ); //$NON-NLS-1$
+
+        // Enable Optimizer
+        enableOptimizerCheckbox.setSelection( input.isJdbmPartitionOptimizerEnabled() );
+
+        // Synchronization on write
+        synchOnWriteCheckbox.setSelection( input.isPartitionSyncOnWrite() );
+
+        // Indexed Attributes
+        indexedAttributes = input.getIndexes();
+        indexedAttributesTableViewer.setInput( indexedAttributes );
+
+        addListeners();
+    }
 
 
     /* (non-Javadoc)
@@ -274,11 +489,4 @@ public class PartitionDetailsPage implem
     {
         return false;
     }
-
-
-    public void refresh()
-    {
-        // TODO Auto-generated method stub
-        
-    }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.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/PartitionsMasterDetailsBlock.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java Mon Oct 10 13:59:46 2011
@@ -20,15 +20,24 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.server.config.beans.IndexBean;
+import org.apache.directory.server.config.beans.JdbmIndexBean;
+import org.apache.directory.server.config.beans.JdbmPartitionBean;
+import org.apache.directory.server.config.beans.PartitionBean;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.name.Dn;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -38,7 +47,6 @@ import org.eclipse.ui.forms.DetailsPart;
 import org.eclipse.ui.forms.IManagedForm;
 import org.eclipse.ui.forms.MasterDetailsBlock;
 import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.editor.FormPage;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
 
@@ -50,8 +58,10 @@ import org.eclipse.ui.forms.widgets.Sect
  */
 public class PartitionsMasterDetailsBlock extends MasterDetailsBlock
 {
+    private static final String NEW_ID = "partition";
+
     /** The associated page */
-    private FormPage page;
+    private PartitionsPage page;
 
     /** The Details Page */
     private PartitionDetailsPage detailsPage;
@@ -68,7 +78,7 @@ public class PartitionsMasterDetailsBloc
      * @param page
      *      the associated page
      */
-    public PartitionsMasterDetailsBlock( FormPage page )
+    public PartitionsMasterDetailsBlock( PartitionsPage page )
     {
         this.page = page;
     }
@@ -113,14 +123,7 @@ public class PartitionsMasterDetailsBloc
             }
         } );
         viewer.setContentProvider( new ArrayContentProvider() );
-        viewer.setLabelProvider( new LabelProvider()
-        {
-            public Image getImage( Object element )
-            {
-                return ApacheDS2ConfigurationPlugin.getDefault().getImage(
-                    ApacheDS2ConfigurationPluginConstants.IMG_PARTITION );
-            };
-        } );
+        viewer.setLabelProvider( PartitionsPage.PARTITIONS_LABEL_PROVIDER );
 
         // Creating the button(s)
         addButton = toolkit.createButton( client, "Add", SWT.PUSH );
@@ -131,6 +134,7 @@ public class PartitionsMasterDetailsBloc
         deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
 
         initFromInput();
+        addListeners();
     }
 
 
@@ -139,8 +143,145 @@ public class PartitionsMasterDetailsBloc
      */
     private void initFromInput()
     {
-        viewer.setInput( new String[]
-            { "ou=system", "dc=example,dc=com" } );
+        viewer.setInput( page.getConfigBean().getDirectoryServiceBean().getPartitions() );
+    }
+
+
+    /**
+     * Add listeners to UI fields.
+     */
+    private void addListeners()
+    {
+        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        {
+            public void selectionChanged( SelectionChangedEvent event )
+            {
+                viewer.refresh();
+
+                deleteButton.setEnabled( !event.getSelection().isEmpty() );
+                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
+                if ( !selection.isEmpty() )
+                {
+                    JdbmPartitionBean partition = ( JdbmPartitionBean ) selection.getFirstElement();
+                    if ( PartitionsPage.isSystemPartition( partition ) )
+                    {
+                        deleteButton.setEnabled( false );
+                    }
+                }
+            }
+        } );
+
+        addButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                String newId = getNewId();
+
+                JdbmPartitionBean newPartitionBean = new JdbmPartitionBean();
+                newPartitionBean.setPartitionId( newId );
+                try
+                {
+                    newPartitionBean.setPartitionSuffix( new Dn( "dc=" + newId + ",dc=com" ) );
+                }
+                catch ( LdapInvalidDnException e1 )
+                {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+
+                // Default values
+                newPartitionBean.setPartitionCacheSize( 100 );
+                newPartitionBean.setJdbmPartitionOptimizerEnabled( true );
+                newPartitionBean.setPartitionSyncOnWrite( true );
+                List<IndexBean> indexes = new ArrayList<IndexBean>();
+                indexes.add( createJdbmIndex( "apacheAlias", 100 ) );
+                indexes.add( createJdbmIndex( "apacheOneAlias", 100 ) );
+                indexes.add( createJdbmIndex( "apacheOneLevel", 100 ) );
+                indexes.add( createJdbmIndex( "apachePresence", 100 ) );
+                indexes.add( createJdbmIndex( "apacheRdn", 100 ) );
+                indexes.add( createJdbmIndex( "apacheSubAlias", 100 ) );
+                indexes.add( createJdbmIndex( "apacheSubLevel", 100 ) );
+                indexes.add( createJdbmIndex( "dc", 100 ) );
+                indexes.add( createJdbmIndex( "entryCSN", 100 ) );
+                indexes.add( createJdbmIndex( "entryUUID", 100 ) );
+                indexes.add( createJdbmIndex( "krbPrincipalName", 100 ) );
+                indexes.add( createJdbmIndex( "objectClass", 100 ) );
+                indexes.add( createJdbmIndex( "ou", 100 ) );
+                indexes.add( createJdbmIndex( "uid", 100 ) );
+                newPartitionBean.setIndexes( indexes );
+
+                page.getConfigBean().getDirectoryServiceBean().addPartitions( newPartitionBean );
+                viewer.refresh();
+                viewer.setSelection( new StructuredSelection( newPartitionBean ) );
+                setEditorDirty();
+            }
+        } );
+
+        deleteButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
+                if ( !selection.isEmpty() )
+                {
+                    JdbmPartitionBean partition = ( JdbmPartitionBean ) selection.getFirstElement();
+                    if ( !PartitionsPage.isSystemPartition( partition ) )
+                    {
+                        page.getConfigBean().getDirectoryServiceBean().getPartitions().remove( partition );
+                        viewer.refresh();
+                        setEditorDirty();
+                    }
+                }
+            }
+        } );
+    }
+
+
+    /**
+     * Gets a new ID for a new Partition.
+     *
+     * @return 
+     *      a new ID for a new Partition
+     */
+    private String getNewId()
+    {
+        int counter = 1;
+        String name = NEW_ID;
+        boolean ok = false;
+
+        while ( !ok )
+        {
+            ok = true;
+            name = NEW_ID + counter;
+
+            for ( PartitionBean partition : page.getConfigBean().getDirectoryServiceBean().getPartitions() )
+            {
+                if ( partition.getPartitionId().equalsIgnoreCase( name ) )
+                {
+                    ok = false;
+                }
+            }
+            counter++;
+        }
+
+        return name;
+    }
+
+
+    /**
+     * Create a JDBM Index with the given index attribute id and cache size.
+     *
+     * @param indexAttributeId the attribute id
+     * @param indexCacheSize the cache size
+     */
+    private JdbmIndexBean<String, Entry> createJdbmIndex( String indexAttributeId, int indexCacheSize )
+    {
+        JdbmIndexBean<String, Entry> index = new JdbmIndexBean<String, Entry>();
+
+        index.setIndexAttributeId( indexAttributeId );
+        index.setIndexCacheSize( indexCacheSize );
+
+        return index;
     }
 
 
@@ -150,7 +291,7 @@ public class PartitionsMasterDetailsBloc
     protected void registerPages( DetailsPart detailsPart )
     {
         detailsPage = new PartitionDetailsPage( this );
-        detailsPart.registerPage( String.class, detailsPage );
+        detailsPart.registerPage( JdbmPartitionBean.class, detailsPage );
     }
 
 
@@ -161,4 +302,22 @@ public class PartitionsMasterDetailsBloc
 
     }
 
+
+    /**
+     * Sets the Editor as dirty.
+     */
+    public void setEditorDirty()
+    {
+        ( ( ServerConfigurationEditor ) page.getEditor() ).setDirty( true );
+    }
+
+
+    /**
+     * Saves the necessary elements to the input model.
+     */
+    public void save()
+    {
+        detailsPage.commit( true );
+        //        viewer.setInput( partitions );
+    }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.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/PartitionsPage.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java Mon Oct 10 13:59:46 2011
@@ -20,6 +20,12 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.apache.directory.server.config.beans.PartitionBean;
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
@@ -37,6 +43,44 @@ public class PartitionsPage extends Serv
     /** The Page Title */
     private static final String TITLE = "Partitions";
 
+    /** The label provider for partition table viewers */
+    public static LabelProvider PARTITIONS_LABEL_PROVIDER = new LabelProvider()
+    {
+        public String getText( Object element )
+        {
+            if ( element instanceof PartitionBean )
+            {
+                PartitionBean partition = ( PartitionBean ) element;
+
+                return NLS.bind( "{0} ({1})", partition.getPartitionId(), partition.getPartitionSuffix() );
+            }
+
+            return super.getText( element );
+        }
+
+
+        public Image getImage( Object element )
+        {
+            if ( element instanceof PartitionBean )
+            {
+                PartitionBean partition = ( PartitionBean ) element;
+
+                if ( isSystemPartition( partition ) )
+                {
+                    return ApacheDS2ConfigurationPlugin.getDefault().getImage(
+                        ApacheDS2ConfigurationPluginConstants.IMG_PARTITION_SYSTEM );
+                }
+                else
+                {
+                    return ApacheDS2ConfigurationPlugin.getDefault().getImage(
+                        ApacheDS2ConfigurationPluginConstants.IMG_PARTITION );
+                }
+            }
+
+            return super.getImage( element );
+        }
+    };
+
 
     /**
      * Creates a new instance of PartitionsPage.
@@ -65,7 +109,19 @@ public class PartitionsPage extends Serv
      */
     protected void refreshUI()
     {
-        // TODO Auto-generated method stub
+        // TODO
+    }
+
 
+    /**
+     * Indicates if the given partition is the system partition.
+     *
+     * @param partition the partition
+     * @return <code>true</code> if the partition is the system partition,
+     *         <code>false</code> if not.
+     */
+    public static boolean isSystemPartition( PartitionBean partition )
+    {
+        return "system".equalsIgnoreCase( partition.getPartitionId() );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.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/ReplicationPage.java?rev=1180974&r1=1180973&r2=1180974&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java Mon Oct 10 13:59:46 2011
@@ -20,7 +20,11 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
 
@@ -55,6 +59,12 @@ public class ReplicationPage extends Ser
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
+        Composite composite = toolkit.createComposite( parent );
+        composite.setLayout( new GridLayout() );
+        composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
+
+        Label label = toolkit.createLabel( composite, "Coming soon..." );
+        label.setLayoutData( new GridData( SWT.CENTER, SWT.CENTER, true, true ) );
     }
 
 
@@ -64,6 +74,5 @@ public class ReplicationPage extends Ser
     protected void refreshUI()
     {
         // TODO Auto-generated method stub
-
     }
 }

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=1180974&r1=1180973&r2=1180974&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 Oct 10 13:59:46 2011
@@ -267,7 +267,7 @@ public abstract class ServerConfiguratio
      */
     protected Label createDefaultValueLabel( FormToolkit toolkit, Composite parent, String text )
     {
-        Label label = toolkit.createLabel( parent, NLS.bind( "(Default: {0})", text ) );
+        Label label = toolkit.createLabel( parent, NLS.bind( "(Default: {0})", text ), SWT.WRAP );
         label.setForeground( GRAY_COLOR );
 
         return label;
@@ -430,6 +430,11 @@ public abstract class ServerConfiguratio
     }
 
 
+    /**
+     * Sets the focus to the given control.
+     *
+     * @param control the control
+     */
     protected void setFocus( Control control )
     {
         if ( ( control != null ) && ( !control.isDisposed() ) )
@@ -437,4 +442,18 @@ public abstract class ServerConfiguratio
             control.setFocus();
         }
     }
+
+
+    /**
+     * Sets the given {@link GridData} to the control
+     * and sets the width to a default value.
+     *
+     * @param control the control
+     * @param gd the grid data
+     */
+    protected void setGridDataWithDefaultWidth( Control control, GridData gd )
+    {
+        gd.widthHint = 50;
+        control.setLayoutData( gd );
+    }
 }



Mime
View raw message