directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r525812 - in /directory/ldapstudio/trunk/ldapstudio-apacheds-configuration: icons/ src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/ src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ src/main/j...
Date Thu, 05 Apr 2007 13:08:52 GMT
Author: pamarcelot
Date: Thu Apr  5 06:08:51 2007
New Revision: 525812

URL: http://svn.apache.org/viewvc?view=rev&rev=525812
Log:
Improved Apache DS Configuration Editor. Added Partitions Master/DetailsPage.

Added:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/icons/horizontal_orientation.gif
  (with props)
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/icons/vertical_orientation.gif
  (with props)
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
      - copied, changed from r525559, directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/BasicPage.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionDetailsPage.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/Partition.java
Removed:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/BasicPage.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/LimitsPage.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/OptionsPage.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/Activator.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsPage.java
    directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditor.java

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

Propchange: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/icons/horizontal_orientation.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

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

Propchange: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/icons/vertical_orientation.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/Activator.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/Activator.java?view=diff&rev=525812&r1=525811&r2=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/Activator.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/Activator.java
Thu Apr  5 06:08:51 2007
@@ -20,6 +20,12 @@
 package org.apache.directory.ldapstudio.apacheds.configuration;
 
 
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
@@ -77,5 +83,22 @@
     public static Activator getDefault()
     {
         return plugin;
+    }
+    
+    /**
+     * Returns the button with respect to the font metrics.
+     *
+     * @param control a control
+     * @return the button width
+     */
+    public static int getButtonWidth( Control control )
+    {
+        GC gc = new GC( control );
+        gc.setFont( JFaceResources.getDialogFont() );
+        FontMetrics fontMetrics = gc.getFontMetrics();
+        gc.dispose();
+
+        int width = Dialog.convertHorizontalDLUsToPixels( fontMetrics, IDialogConstants.BUTTON_WIDTH
);
+        return width;
     }
 }

Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java?view=auto&rev=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
(added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/PluginConstants.java
Thu Apr  5 06:08:51 2007
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.ldapstudio.apacheds.configuration;
+
+/**
+ * This interface contains all the Constants used in the Plugin.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface PluginConstants
+{
+    public static final String IMG_VERTICAL_ORIENTATION = "icons/vertical_orientation.gif";
+    public static final String IMG_HORIZONTAL_ORIENTATION = "icons/horizontal_orientation.gif";

+}

Copied: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
(from r525559, directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/BasicPage.java)
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java?view=diff&rev=525812&p1=directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/BasicPage.java&r1=525559&p2=directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java&r2=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/BasicPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
Thu Apr  5 06:08:51 2007
@@ -30,7 +30,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BasicPage extends FormPage
+public class GeneralPage extends FormPage
 {
     /** The Page ID*/
     public static final String ID = ServerConfigurationEditor.ID + ".BasicPage";
@@ -40,12 +40,12 @@
 
 
     /**
-     * Creates a new instance of BasicPage.
+     * Creates a new instance of GeneralPage.
      *
      * @param editor
      *      the associated editor
      */
-    public BasicPage( FormEditor editor )
+    public GeneralPage( FormEditor editor )
     {
         super( editor, ID, TITLE );
     }

Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionDetailsPage.java?view=auto&rev=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionDetailsPage.java
(added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionDetailsPage.java
Thu Apr  5 06:08:51 2007
@@ -0,0 +1,240 @@
+package org.apache.directory.ldapstudio.apacheds.configuration.editor;
+
+
+import org.apache.directory.ldapstudio.apacheds.configuration.model.Partition;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+
+public class PartitionDetailsPage implements IDetailsPage
+{
+    /** The Managed Form */
+    private IManagedForm mform;
+    private Partition input;
+    private Text name;
+    private Text cacheSize;
+    private Text suffix;
+    private Button enableOptimizer;
+    private Button synchOnWrite;
+    private Table indexedAttributesTable;
+    private Button indexedAttributeAddButton;
+    private Button indexedAttributeEditButton;
+    private Button indexedAttributeDeleteButton;
+    private Table contextEntryTable;
+    private Button contextEntryAddButton;
+    private Button contextEntryEditButton;
+    private Button contextEntryDeleteButton;
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
+     */
+    public void createContents( Composite parent )
+    {
+        FormToolkit toolkit = mform.getToolkit();
+
+        TableWrapLayout layout = new TableWrapLayout();
+        layout.topMargin = 5;
+        layout.leftMargin = 5;
+        layout.rightMargin = 2;
+        layout.bottomMargin = 2;
+        parent.setLayout( layout );
+
+        Section detailsSection = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR
);
+        detailsSection.marginWidth = 10;
+        detailsSection.setText( "Partition Details" ); //$NON-NLS-1$
+        detailsSection.setDescription( "Set the properties of the partition." ); //$NON-NLS-1$
+        TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+        td.grabHorizontal = true;
+        detailsSection.setLayoutData( td );
+        Composite detailsClient = toolkit.createComposite( detailsSection );
+        toolkit.paintBordersFor( detailsClient );
+        GridLayout glayout = new GridLayout( 3, false );
+        detailsClient.setLayout( glayout );
+        detailsSection.setClient( detailsClient );
+
+        // Name
+        toolkit.createLabel( detailsClient, "Name:" );
+        name = toolkit.createText( detailsClient, "" );
+        name.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+        // Cache Size
+        toolkit.createLabel( detailsClient, "Cache Size:" );
+        cacheSize = toolkit.createText( detailsClient, "" );
+        cacheSize.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+        // Suffix
+        toolkit.createLabel( detailsClient, "Suffix:" );
+        suffix = toolkit.createText( detailsClient, "" );
+        suffix.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+        // Enable Optimizer
+        enableOptimizer = toolkit.createButton( detailsClient, "Enable optimizer", SWT.CHECK
);
+        enableOptimizer.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3,
1 ) );
+
+        // Synchronisation On Write
+        synchOnWrite = toolkit.createButton( detailsClient, " Synchronization on write",
SWT.CHECK );
+        synchOnWrite.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 )
);
+
+        GridData buttonsGD = new GridData( SWT.FILL, SWT.BEGINNING, false, false );
+        buttonsGD.widthHint = IDialogConstants.BUTTON_WIDTH;
+
+        // Context Entry
+        Section contextEntrySection = toolkit.createSection( parent, Section.DESCRIPTION
| Section.TITLE_BAR );
+        contextEntrySection.marginWidth = 10;
+        contextEntrySection.setText( "Context Entry" ); //$NON-NLS-1$
+        contextEntrySection.setDescription( "Set the attribute/value pairs for the Context
Entry of the partition." ); //$NON-NLS-1$
+        contextEntrySection.setLayoutData( new TableWrapData( TableWrapData.FILL ) );
+        Composite contextEntryClient = toolkit.createComposite( contextEntrySection );
+        toolkit.paintBordersFor( contextEntryClient );
+        contextEntryClient.setLayout( new GridLayout( 2, false ) );
+        contextEntrySection.setClient( contextEntryClient );
+
+        contextEntryTable = toolkit.createTable( contextEntryClient, SWT.NONE );
+        GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
+        gd.heightHint = 80;
+        contextEntryTable.setLayoutData( gd );
+
+        contextEntryAddButton = toolkit.createButton( contextEntryClient, "Add...", SWT.PUSH
);
+        contextEntryAddButton.setLayoutData( buttonsGD );
+
+        contextEntryEditButton = toolkit.createButton( contextEntryClient, "Edit...", SWT.PUSH
);
+        contextEntryEditButton.setLayoutData( buttonsGD );
+
+        contextEntryDeleteButton = toolkit.createButton( contextEntryClient, "Delete", SWT.PUSH
);
+        contextEntryDeleteButton.setLayoutData( buttonsGD );
+
+        // Indexed Attributes
+        Section indexedAttributesSection = toolkit.createSection( parent, Section.DESCRIPTION
| Section.TITLE_BAR );
+        indexedAttributesSection.marginWidth = 10;
+        indexedAttributesSection.setText( "Indexed Attributes" ); //$NON-NLS-1$
+        indexedAttributesSection.setDescription( "Set the indexed attributes for the partition."
); //$NON-NLS-1$
+        indexedAttributesSection.setLayoutData( new TableWrapData( TableWrapData.FILL ) );
+        Composite indexedAttributesClient = toolkit.createComposite( indexedAttributesSection
);
+        toolkit.paintBordersFor( indexedAttributesClient );
+        indexedAttributesClient.setLayout( new GridLayout( 2, false ) );
+        indexedAttributesSection.setClient( indexedAttributesClient );
+
+        indexedAttributesTable = toolkit.createTable( indexedAttributesClient, SWT.NONE );
+        gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
+        gd.heightHint = 80;
+        indexedAttributesTable.setLayoutData( gd );
+
+        indexedAttributeAddButton = toolkit.createButton( indexedAttributesClient, "Add...",
SWT.PUSH );
+        indexedAttributeAddButton.setLayoutData( buttonsGD );
+
+        indexedAttributeEditButton = toolkit.createButton( indexedAttributesClient, "Edit...",
SWT.PUSH );
+        indexedAttributeEditButton.setLayoutData( buttonsGD );
+
+        indexedAttributeDeleteButton = toolkit.createButton( indexedAttributesClient, "Delete",
SWT.PUSH );
+        indexedAttributeDeleteButton.setLayoutData( buttonsGD );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse.ui.forms.IFormPart,
org.eclipse.jface.viewers.ISelection)
+     */
+    public void selectionChanged( IFormPart part, ISelection selection )
+    {
+        IStructuredSelection ssel = ( IStructuredSelection ) selection;
+        if ( ssel.size() == 1 )
+        {
+            input = ( Partition ) ssel.getFirstElement();
+        }
+        else
+        {
+            input = null;
+        }
+        refresh();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#commit(boolean)
+     */
+    public void commit( boolean onSave )
+    {
+        input.setName( name.getText() );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#dispose()
+     */
+    public void dispose()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#initialize(org.eclipse.ui.forms.IManagedForm)
+     */
+    public void initialize( IManagedForm form )
+    {
+        this.mform = form;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#isDirty()
+     */
+    public boolean isDirty()
+    {
+        // TODO Auto-generated method stub
+        return true;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#isStale()
+     */
+    public boolean isStale()
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#refresh()
+     */
+    public void refresh()
+    {
+        name.setText( input.getName() );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#setFocus()
+     */
+    public void setFocus()
+    {
+        name.setFocus();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.IFormPart#setFormInput(java.lang.Object)
+     */
+    public boolean setFormInput( Object input )
+    {
+        return false;
+    }
+}

Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java?view=auto&rev=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java
(added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsMasterDetailsBlock.java
Thu Apr  5 06:08:51 2007
@@ -0,0 +1,119 @@
+package org.apache.directory.ldapstudio.apacheds.configuration.editor;
+
+
+import org.apache.directory.ldapstudio.apacheds.configuration.Activator;
+import org.apache.directory.ldapstudio.apacheds.configuration.PluginConstants;
+import org.apache.directory.ldapstudio.apacheds.configuration.model.Partition;
+import org.eclipse.jface.action.Action;
+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.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.forms.DetailsPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.MasterDetailsBlock;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+public class PartitionsMasterDetailsBlock extends MasterDetailsBlock
+{
+    private FormPage page;
+
+
+    public PartitionsMasterDetailsBlock( FormPage page )
+    {
+        this.page = page;
+    }
+
+
+    @Override
+    protected void createMasterPart( final IManagedForm managedForm, Composite parent )
+    {
+        //final ScrolledForm form = managedForm.getForm();
+        FormToolkit toolkit = managedForm.getToolkit();
+        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
+        section.setText( "All Partitions" ); //$NON-NLS-1$
+//        section.setDescription( "The list contains all the partitions whose details are
editable on the right" ); //$NON-NLS-1$
+        section.marginWidth = 10;
+        section.marginHeight = 5;
+        Composite client = toolkit.createComposite( section, SWT.WRAP );
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 2;
+        layout.marginWidth = 2;
+        layout.marginHeight = 2;
+        client.setLayout( layout );
+        Table t = toolkit.createTable( client, SWT.NULL );
+        GridData gd = new GridData( GridData.FILL_BOTH );
+        gd.heightHint = 20;
+        gd.widthHint = 100;
+        t.setLayoutData( gd );
+        toolkit.paintBordersFor( client );
+        Button b = toolkit.createButton( client, "Add...", SWT.PUSH ); //$NON-NLS-1$
+        gd = new GridData( GridData.VERTICAL_ALIGN_BEGINNING );
+        b.setLayoutData( gd );
+        section.setClient( client );
+        final SectionPart spart = new SectionPart( section );
+        managedForm.addPart( spart );
+        TableViewer viewer = new TableViewer( t );
+        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        {
+            public void selectionChanged( SelectionChangedEvent event )
+            {
+                managedForm.fireSelectionChanged( spart, event.getSelection() );
+            }
+        } );
+        viewer.setContentProvider( new ArrayContentProvider() );
+        viewer.setLabelProvider( new LabelProvider() );
+        viewer.setInput( new Object[] { new Partition( "System Partition" ), new Partition(
"Example Partition" ) } );
+    }
+
+
+    @Override
+    protected void createToolBarActions( IManagedForm managedForm )
+    {
+        final ScrolledForm form = managedForm.getForm();
+        Action haction = new Action( "Horizontal Orientation", Action.AS_RADIO_BUTTON ) {
//$NON-NLS-1$
+            public void run()
+            {
+                sashForm.setOrientation( SWT.HORIZONTAL );
+                form.reflow( true );
+            }
+        };
+        haction.setChecked( true );
+        haction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
+        haction.setImageDescriptor( Activator.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+            PluginConstants.IMG_HORIZONTAL_ORIENTATION ) );
+        Action vaction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
+            public void run()
+            {
+                sashForm.setOrientation( SWT.VERTICAL );
+                form.reflow( true );
+            }
+        };
+        vaction.setChecked( false );
+        vaction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
+        vaction.setImageDescriptor( Activator.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+            PluginConstants.IMG_VERTICAL_ORIENTATION ) );
+        form.getToolBarManager().add( haction );
+        form.getToolBarManager().add( vaction );
+    }
+
+
+    @Override
+    protected void registerPages( DetailsPart detailsPart )
+    {
+        detailsPart.registerPage( Partition.class, new PartitionDetailsPage() );
+    }
+
+}

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsPage.java?view=diff&rev=525812&r1=525811&r2=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/PartitionsPage.java
Thu Apr  5 06:08:51 2007
@@ -20,8 +20,10 @@
 package org.apache.directory.ldapstudio.apacheds.configuration.editor;
 
 
+import org.eclipse.ui.forms.IManagedForm;
 import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 
 /**
@@ -38,6 +40,9 @@
     /** The Page Title */
     private static final String TITLE = "Partitions";
 
+    /** The MasterDetails block */
+    private PartitionsMasterDetailsBlock masterDetailBlock;
+
 
     /**
      * Creates a new instance of PartitionsPage.
@@ -48,5 +53,17 @@
     public PartitionsPage( FormEditor editor )
     {
         super( editor, ID, TITLE );
+        masterDetailBlock = new PartitionsMasterDetailsBlock( this );
+    }
+
+
+    @Override
+    protected void createFormContent( IManagedForm managedForm )
+    {
+        super.createFormContent( managedForm );
+
+        final ScrolledForm form = managedForm.getForm();
+        form.setText( "Partitions" ); //$NON-NLS-1$
+        masterDetailBlock.createContent( managedForm );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditor.java?view=diff&rev=525812&r1=525811&r2=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditor.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/ServerConfigurationEditor.java
Thu Apr  5 06:08:51 2007
@@ -40,9 +40,7 @@
     public static final String ID = "org.apache.directory.ldapstudio.apacheds.configuration.editor";
 
     // The Pages
-    private FormPage basicPage;
-    private FormPage limitsPage;
-    private FormPage optionsPage;
+    private FormPage generalPage;
     private FormPage partitionsPage;
     private FormPage interceptorsPage;
     private FormPage extendedOperationsPage;
@@ -61,18 +59,14 @@
      */
     protected void addPages()
     {
-        basicPage = new BasicPage( this );
-        limitsPage = new LimitsPage( this );
-        optionsPage = new OptionsPage( this );
+        generalPage = new GeneralPage( this );
         partitionsPage = new PartitionsPage( this );
         interceptorsPage = new InterceptorsPage( this );
         extendedOperationsPage = new ExtendedOperationsPage( this );
 
         try
         {
-            addPage( basicPage );
-            addPage( limitsPage );
-            addPage( optionsPage );
+            addPage( generalPage );
             addPage( partitionsPage );
             addPage( interceptorsPage );
             addPage( extendedOperationsPage );

Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/Partition.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/Partition.java?view=auto&rev=525812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/Partition.java
(added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/Partition.java
Thu Apr  5 06:08:51 2007
@@ -0,0 +1,33 @@
+package org.apache.directory.ldapstudio.apacheds.configuration.model;
+
+
+public class Partition
+{
+
+    private String name;
+
+
+    public Partition( String name )
+    {
+        this.name = name;
+    }
+
+
+    public String getName()
+    {
+        return this.name;
+    }
+
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+
+    @Override
+    public String toString()
+    {
+        return name;
+    }
+}



Mime
View raw message