You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2012/11/06 19:13:45 UTC

svn commit: r1406258 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationDetailsPage.java

Author: pamarcelot
Date: Tue Nov  6 18:13:44 2012
New Revision: 1406258

URL: http://svn.apache.org/viewvc?rev=1406258&view=rev
Log:
Added UI fields.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationDetailsPage.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationDetailsPage.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/ReplicationDetailsPage.java?rev=1406258&r1=1406257&r2=1406258&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationDetailsPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationDetailsPage.java Tue Nov  6 18:13:44 2012
@@ -25,9 +25,14 @@ import org.eclipse.jface.dialogs.IDialog
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.IDetailsPage;
 import org.eclipse.ui.forms.IFormPart;
 import org.eclipse.ui.forms.IManagedForm;
@@ -53,6 +58,18 @@ public class ReplicationDetailsPage impl
     /** The input consumer */
     private ReplConsumerBean input;
 
+    // Listeners
+    VerifyListener integerVerifyListener = new VerifyListener()
+    {
+        public void verifyText( VerifyEvent e )
+        {
+            if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+            {
+                e.doit = false;
+            }
+        }
+    };
+
 
     /**
      * Creates a new instance of ReplicationDetailsPage.
@@ -80,6 +97,8 @@ public class ReplicationDetailsPage impl
         parent.setLayout( layout );
 
         createDetailsSection( parent, toolkit );
+        createConnectionSection( parent, toolkit );
+        createConfigurationSection( parent, toolkit );
     }
 
 
@@ -102,10 +121,151 @@ public class ReplicationDetailsPage impl
         section.setLayoutData( td );
         Composite client = toolkit.createComposite( section );
         toolkit.paintBordersFor( client );
-        GridLayout glayout = new GridLayout( 3, false );
+        GridLayout glayout = new GridLayout( 2, false );
+        client.setLayout( glayout );
+        section.setClient( client );
+
+        // Enabled Checkbox
+        Button enabledCheckbox = toolkit.createButton( client, "Enabled", SWT.CHECK );
+        enabledCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+        // ID Text
+        toolkit.createLabel( client, "ID:" );
+        Text idText = toolkit.createText( client, "" );
+        idText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Description Text
+        toolkit.createLabel( client, "Description:" );
+        Text descriptionText = toolkit.createText( client, "" );
+        descriptionText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+    }
+
+
+    /**
+     * Creates the Details Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createConnectionSection( Composite parent, FormToolkit toolkit )
+    {
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 10;
+        section.setText( "Connection" );
+        section.setDescription( "Set the properties of the connection." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite composite = toolkit.createComposite( section );
+        toolkit.paintBordersFor( composite );
+        GridLayout glayout = new GridLayout( 2, false );
+        composite.setLayout( glayout );
+        section.setClient( composite );
+
+        // Remote Host Text
+        toolkit.createLabel( composite, "Remote Host:" );
+        Text remoteHostText = toolkit.createText( composite, "" );
+        remoteHostText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Remote Port Text
+        toolkit.createLabel( composite, "Remote Port:" );
+        Text remotePortText = toolkit.createText( composite, "" );
+        remotePortText.addVerifyListener( integerVerifyListener );
+        remotePortText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Bind DN Text
+        toolkit.createLabel( composite, "Bind DN:" );
+        Text bindDnText = toolkit.createText( composite, "" );
+        bindDnText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Bind Password Text
+        toolkit.createLabel( composite, "Bind Password:" );
+        Text bindPasswordText = toolkit.createText( composite, "" );
+        bindPasswordText.setEchoChar( '\u2022' );
+        bindPasswordText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Show Password Checkbox
+        toolkit.createLabel( composite, "" ); //$NON-NLS-1$
+        Button showPasswordCheckbox = toolkit.createButton( composite, "Show password", SWT.CHECK );
+        showPasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
+        showPasswordCheckbox.setSelection( false );
+
+        // Size Limit Text
+        toolkit.createLabel( composite, "Size Limit:" );
+        Text sizeLimitText = toolkit.createText( composite, "" );
+        sizeLimitText.addVerifyListener( integerVerifyListener );
+        sizeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Time Limit Text
+        toolkit.createLabel( composite, "Time Limit:" );
+        Text timeLimitText = toolkit.createText( composite, "" );
+        timeLimitText.addVerifyListener( integerVerifyListener );
+        timeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+    }
+
+
+    /**
+     * Creates the Details Section
+     *
+     * @param parent
+     *      the parent composite
+     * @param toolkit
+     *      the toolkit to use
+     */
+    private void createConfigurationSection( Composite parent, FormToolkit toolkit )
+    {
+        Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+        section.marginWidth = 10;
+        section.setText( "Replication Consumer Details" );
+        section.setDescription( "Set the properties of the configuration." );
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        section.setLayoutData( td );
+        Composite client = toolkit.createComposite( section );
+        toolkit.paintBordersFor( client );
+        GridLayout glayout = new GridLayout( 2, false );
         client.setLayout( glayout );
         section.setClient( client );
 
+        // Base DN Text
+        toolkit.createLabel( client, "Base DN:" );
+        Text baseDnText = toolkit.createText( client, "" );
+        baseDnText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Filter Text
+        toolkit.createLabel( client, "Filter:" );
+        Text filterText = toolkit.createText( client, "" );
+        filterText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Scope
+        Label scopeLabel = toolkit.createLabel( client, "Scope:" );
+        scopeLabel.setLayoutData( new GridData( SWT.BEGINNING, SWT.TOP, false, false, 1, 3 ) );
+
+        // Subtree Scope Button
+        Button subtreeScopeButton = toolkit.createButton( client, "Subtree", SWT.RADIO );
+
+        // One Level Scope Button
+        Button oneLevelScopeButton = toolkit.createButton( client, "One Level", SWT.RADIO );
+
+        // Object Scope Button
+        Button objectScopeButton = toolkit.createButton( client, "Object", SWT.RADIO );
+
+        // Attributes Text
+        toolkit.createLabel( client, "Attributes:" );
+        Text attributesText = toolkit.createText( client, "" );
+        attributesText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Aliases Dereferencing Text
+        Label aliasesDereferencingLable = toolkit.createLabel( client, "Aliases\nDereferencing:" );
+        aliasesDereferencingLable.setLayoutData( new GridData( SWT.BEGINNING, SWT.TOP, false, false, 1, 2 ) );
+
+        // Finding Base DN Aliases Dereferencing Button
+        Button findingBaseDnAliasesDereferencingButton = toolkit.createButton( client, "Finding Base DN", SWT.CHECK );
+
+        // Search Aliases Dereferencing Button
+        Button searchAliasesDereferencingButton = toolkit.createButton( client, "Search", SWT.CHECK );
     }
 
 
@@ -206,13 +366,10 @@ public class ReplicationDetailsPage impl
     {
         removeListeners();
 
-
-        
         addListeners();
     }
 
 
-
     /**
      * {@inheritDoc}
      */