directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1031681 - in /directory/studio/trunk/plugins/apacheds.configuration.v2: resources/icons/ src/main/java/org/apache/directory/studio/apacheds/configuration/v2/ src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/ src/...
Date Fri, 05 Nov 2010 17:54:40 GMT
Author: pamarcelot
Date: Fri Nov  5 17:54:39 2010
New Revision: 1031681

URL: http://svn.apache.org/viewvc?rev=1031681&view=rev
Log:
Added an abstract common form page extended by page implementations.
Added two empty actions for importing and exporting configuration from the editor.

Added:
    directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/export.gif  
(with props)
    directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/import.gif  
(with props)
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.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/ApacheDS2ConfigurationPluginConstants.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/AuthenticationPage.java
    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/LdapServerPage.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/PartitionsPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyPage.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/ServerConfigurationEditor.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationInput.java

Added: directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/export.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/export.gif?rev=1031681&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/export.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/import.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/import.gif?rev=1031681&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/plugins/apacheds.configuration.v2/resources/icons/import.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/ApacheDS2ConfigurationPluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/ApacheDS2ConfigurationPluginConstants.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/ApacheDS2ConfigurationPluginConstants.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/ApacheDS2ConfigurationPluginConstants.java
Fri Nov  5 17:54:39 2010
@@ -30,6 +30,9 @@ public interface ApacheDS2ConfigurationP
     // ------
     // IMAGES
     // ------
+    public static final String IMG_EDITOR = "resources/icons/editor.gif"; //$NON-NLS-1$
+    public static final String IMG_EXPORT = "resources/icons/export.gif"; //$NON-NLS-1$
+    public static final String IMG_IMPORT = "resources/icons/import.gif"; //$NON-NLS-1$
     public static final String IMG_EXTENDED_OPERATION = "resources/icons/extended_operation.gif";
//$NON-NLS-1$
     public static final String IMG_HORIZONTAL_ORIENTATION = "resources/icons/horizontal_orientation.gif";
//$NON-NLS-1$
     public static final String IMG_INTERCEPTOR = "resources/icons/interceptor.gif"; //$NON-NLS-1$

Added: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java?rev=1031681&view=auto
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
(added)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
Fri Nov  5 17:54:39 2010
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.apacheds.configuration.v2.actions;
+
+
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+
+/**
+ * This class implements the create connection action for an ApacheDS 1.5.7 server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class EditorExportConfigurationAction extends Action
+{
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return ApacheDS2ConfigurationPlugin.getDefault().getImageDescriptor(
+            ApacheDS2ConfigurationPluginConstants.IMG_EXPORT );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "Export Configuration";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+    }
+}

Added: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java?rev=1031681&view=auto
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
(added)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Fri Nov  5 17:54:39 2010
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.apacheds.configuration.v2.actions;
+
+
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+
+/**
+ * This class implements the create connection action for an ApacheDS 1.5.7 server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class EditorImportConfigurationAction extends Action
+{
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return ApacheDS2ConfigurationPlugin.getDefault().getImageDescriptor(
+            ApacheDS2ConfigurationPluginConstants.IMG_IMPORT );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "Import Configuration";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+    }
+}

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/AuthenticationPage.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/AuthenticationPage.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/AuthenticationPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/AuthenticationPage.java
Fri Nov  5 17:54:39 2010
@@ -20,11 +20,9 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
-import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
 
 
 /**
@@ -32,7 +30,7 @@ import org.eclipse.ui.forms.widgets.Scro
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AuthenticationPage extends FormPage
+public class AuthenticationPage extends ServerConfigurationEditorPage
 {
     /** The Page ID*/
     public static final String ID = AuthenticationPage.class.getName(); //$NON-NLS-1$
@@ -53,12 +51,10 @@ public class AuthenticationPage extends 
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ScrolledForm form = managedForm.getForm();
-        form.setText( "Authentication" );
     }
 }

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=1031681&r1=1031680&r2=1031681&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
Fri Nov  5 17:54:39 2010
@@ -20,11 +20,9 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
-import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
 
 
 /**
@@ -32,7 +30,7 @@ import org.eclipse.ui.forms.widgets.Scro
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KerberosServerPage extends FormPage
+public class KerberosServerPage extends ServerConfigurationEditorPage
 {
     /** The Page ID*/
     public static final String ID = KerberosServerPage.class.getName(); //$NON-NLS-1$
@@ -53,12 +51,10 @@ public class KerberosServerPage extends 
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ScrolledForm form = managedForm.getForm();
-        form.setText( "Kerberos Server" );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapServerPage.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/LdapServerPage.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapServerPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapServerPage.java
Fri Nov  5 17:54:39 2010
@@ -20,11 +20,9 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
-import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
 
 
 /**
@@ -32,7 +30,7 @@ import org.eclipse.ui.forms.widgets.Scro
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapServerPage extends FormPage
+public class LdapServerPage extends ServerConfigurationEditorPage
 {
     /** The Page ID*/
     public static final String ID = LdapServerPage.class.getName(); //$NON-NLS-1$
@@ -53,12 +51,10 @@ public class LdapServerPage extends Form
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ScrolledForm form = managedForm.getForm();
-        form.setText( "LDAP/LDAPS Server" );
     }
 }

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=1031681&r1=1031680&r2=1031681&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
Fri Nov  5 17:54:39 2010
@@ -40,12 +40,9 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.Text;
-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.FormToolkit;
 import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.eclipse.ui.forms.widgets.Section;
 
 
@@ -54,7 +51,7 @@ import org.eclipse.ui.forms.widgets.Sect
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class OverviewPage extends FormPage
+public class OverviewPage extends ServerConfigurationEditorPage
 {
     private static final Color GRAY_COLOR = new Color( null, 120, 120, 120 );
     private static final String TABULATION = "      ";
@@ -96,19 +93,11 @@ public class OverviewPage extends FormPa
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ScrolledForm form = managedForm.getForm();
-        form.setText( "Overview" );
-
-        Composite parent = form.getBody();
-        parent.setLayout( new GridLayout() );
-
-        FormToolkit toolkit = managedForm.getToolkit();
-
         Composite composite = toolkit.createComposite( parent );
         GridLayout layout = new GridLayout();
         layout.numColumns = 2;
@@ -286,6 +275,15 @@ public class OverviewPage extends FormPa
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void setFocus()
+    {
+        // Does Nothing
+    }
+
+
+    /**
      * Creates a Text that can be used to enter a port number.
      *
      * @param toolkit

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=1031681&r1=1031680&r2=1031681&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
Fri Nov  5 17:54:39 2010
@@ -20,11 +20,9 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
-import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
 
 
 /**
@@ -32,7 +30,7 @@ import org.eclipse.ui.forms.widgets.Scro
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PartitionsPage extends FormPage
+public class PartitionsPage extends ServerConfigurationEditorPage
 {
     /** The Page ID*/
     public static final String ID = PartitionsPage.class.getName(); //$NON-NLS-1$
@@ -53,12 +51,10 @@ public class PartitionsPage extends Form
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ScrolledForm form = managedForm.getForm();
-        form.setText( "Partitions" );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyPage.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/PasswordPolicyPage.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPolicyPage.java
Fri Nov  5 17:54:39 2010
@@ -20,10 +20,12 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
 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.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 
@@ -53,12 +55,18 @@ public class PasswordPolicyPage extends 
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
     protected void createFormContent( IManagedForm managedForm )
     {
         ScrolledForm form = managedForm.getForm();
         form.setText( "Password Policy" );
+
+        Composite parent = form.getBody();
+        parent.setLayout( new GridLayout() );
+
+        FormToolkit toolkit = managedForm.getToolkit();
+        toolkit.decorateFormHeading( form.getForm() );
     }
 }

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=1031681&r1=1031680&r2=1031681&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
Fri Nov  5 17:54:39 2010
@@ -20,10 +20,12 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
 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.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 
@@ -53,12 +55,18 @@ public class ReplicationPage extends For
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+    /**
+     * {@inheritDoc}
      */
     protected void createFormContent( IManagedForm managedForm )
     {
         ScrolledForm form = managedForm.getForm();
         form.setText( "Replication" );
+
+        Composite parent = form.getBody();
+        parent.setLayout( new GridLayout() );
+
+        FormToolkit toolkit = managedForm.getToolkit();
+        toolkit.decorateFormHeading( form.getForm() );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
Fri Nov  5 17:54:39 2010
@@ -44,8 +44,8 @@ public class ServerConfigurationEditor e
     public static final String ID = ServerConfigurationEditor.class.getName();
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+    /**
+     * {@inheritDoc}
      */
     public void init( IEditorSite site, IEditorInput input ) throws PartInitException
     {
@@ -54,8 +54,8 @@ public class ServerConfigurationEditor e
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+    /**
+     * {@inheritDoc}
      */
     protected void addPages()
     {
@@ -76,132 +76,24 @@ public class ServerConfigurationEditor e
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+    /**
+     * {@inheritDoc}
      */
     public void doSave( IProgressMonitor monitor )
     {
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+    /**
+     * {@inheritDoc}
      */
     public void doSaveAs()
     {
     }
 
 
-    //    /**
-    //     * Performs the "Save as..." action.
-    //     *
-    //     * @param monitor
-    //     *      the monitor to use
-    //     * @throws Exception
-    //     */
-    //    private boolean doSaveAs( IProgressMonitor monitor ) throws Exception
-    //    {
-    //        // detect IDE or RCP:
-    //        // check if perspective org.eclipse.ui.resourcePerspective is available
-    //        boolean isIDE = ApacheDSConfigurationPluginUtils.isIDEEnvironment();
-    //
-    //        if ( isIDE )
-    //        {
-    //            // Asking the user for the location where to 'save as' the file
-    //            SaveAsDialog dialog = new SaveAsDialog( getSite().getShell() );
-    //            if ( !( getEditorInput() instanceof NonExistingServerConfigurationInput
) )
-    //            {
-    //                dialog.setOriginalFile( ResourcesPlugin.getWorkspace().getRoot().getFile(
-    //                    new Path( getEditorInput().getToolTipText() ) ) );
-    //            }
-    //            if ( dialog.open() != Dialog.OK )
-    //            {
-    //                return false;
-    //            }
-    //
-    //            // Getting if the resulting file
-    //            IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile( dialog.getResult()
);
-    //
-    //            // Creating the file if it does not exist
-    //            if ( !file.exists() )
-    //            {
-    //                file.create( new ByteArrayInputStream( "".getBytes() ), true, null
); //$NON-NLS-1$
-    //            }
-    //
-    //            // Creating the new input for the editor
-    //            FileEditorInput fei = new FileEditorInput( file );
-    //
-    //            // Saving the file to disk
-    //            saveEditorPages();
-    //            saveConfiguration( fei, monitor );
-    //
-    //            // Setting the new input to the editor
-    //            setInput( fei );
-    //        }
-    //        else
-    //        {
-    //            Shell shell = getSite().getShell();
-    //            boolean canOverwrite = false;
-    //            String path = null;
-    //
-    //            while ( !canOverwrite )
-    //            {
-    //                // Open FileDialog
-    //                FileDialog dialog = new FileDialog( shell, SWT.SAVE );
-    //                path = dialog.open();
-    //                if ( path == null )
-    //                {
-    //                    return false;
-    //                }
-    //
-    //                // Check whether file exists and if so, confirm overwrite
-    //                final File externalFile = new File( path );
-    //                if ( externalFile.exists() )
-    //                {
-    //                    String question = NLS.bind( Messages
-    //                        .getString( "ServerConfigurationEditor.TheFileAlreadyExistsReplace"
), path ); //$NON-NLS-1$
-    //                    MessageDialog overwriteDialog = new MessageDialog( shell, Messages
-    //                        .getString( "ServerConfigurationEditor.Question" ), null, question,
//$NON-NLS-1$
-    //                        MessageDialog.QUESTION, new String[]
-    //                            { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
IDialogConstants.CANCEL_LABEL }, 0 );
-    //                    int overwrite = overwriteDialog.open();
-    //                    switch ( overwrite )
-    //                    {
-    //                        case 0: // Yes
-    //                            canOverwrite = true;
-    //                            break;
-    //                        case 1: // No
-    //                            break;
-    //                        case 2: // Cancel
-    //                        default:
-    //                            return false;
-    //                    }
-    //                }
-    //                else
-    //                {
-    //                    canOverwrite = true;
-    //                }
-    //            }
-    //
-    //            // Saving the file to disk
-    //            saveEditorPages();
-    //            saveConfiguration( path );
-    //
-    //            // Creating the new input for the editor
-    //            PathEditorInput newInput = new PathEditorInput( new Path( path ) );
-    //
-    //            // Setting the new input to the editor
-    //            setInput( newInput );
-    //        }
-    //
-    //        // Updating the title and tooltip texts
-    //        setPartName( getEditorInput().getName() );
-    //
-    //        return true;
-    //    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+    /**
+     * {@inheritDoc}
      */
     public boolean isSaveAsAllowed()
     {

Added: 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=1031681&view=auto
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
(added)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
Fri Nov  5 17:54:39 2010
@@ -0,0 +1,80 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.apacheds.configuration.v2.editor;
+
+
+import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorExportConfigurationAction;
+import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorImportConfigurationAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+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.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * This class represents the General Page of the Server Configuration Editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public abstract class ServerConfigurationEditorPage extends FormPage
+{
+    /**
+     * Creates a new instance of GeneralPage.
+     *
+     * @param editor
+     *      the associated editor
+     */
+    public ServerConfigurationEditorPage( FormEditor editor, String id, String title )
+    {
+        super( editor, id, title );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void createFormContent( IManagedForm managedForm )
+    {
+        ScrolledForm form = managedForm.getForm();
+        form.setText( getTitle() );
+
+        Composite parent = form.getBody();
+        parent.setLayout( new GridLayout() );
+
+        FormToolkit toolkit = managedForm.getToolkit();
+        toolkit.decorateFormHeading( form.getForm() );
+
+        IToolBarManager toolbarManager = form.getToolBarManager();
+        toolbarManager.add( new EditorImportConfigurationAction() );
+        toolbarManager.add( new Separator() );
+        toolbarManager.add( new EditorExportConfigurationAction() );
+        toolbarManager.update( true );
+
+        createFormContent( parent, toolkit );
+    }
+
+
+    protected abstract void createFormContent( Composite parent, FormToolkit toolkit );
+}

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationInput.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/ServerConfigurationInput.java?rev=1031681&r1=1031680&r2=1031681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationInput.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationInput.java
Fri Nov  5 17:54:39 2010
@@ -20,6 +20,8 @@
 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 org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
@@ -32,8 +34,8 @@ import org.eclipse.ui.IPersistableElemen
  */
 public class ServerConfigurationInput implements IEditorInput
 {
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getToolTipText()
+    /**
+     * {@inheritDoc}
      */
     public String getToolTipText()
     {
@@ -41,8 +43,8 @@ public class ServerConfigurationInput im
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getName()
+    /**
+     * {@inheritDoc}
      */
     public String getName()
     {
@@ -50,8 +52,8 @@ public class ServerConfigurationInput im
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#exists()
+    /**
+     * {@inheritDoc}
      */
     public boolean exists()
     {
@@ -59,17 +61,18 @@ public class ServerConfigurationInput im
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+    /**
+     * {@inheritDoc}
      */
     public ImageDescriptor getImageDescriptor()
     {
-        return null;
+        return ApacheDS2ConfigurationPlugin.getDefault().getImageDescriptor(
+            ApacheDS2ConfigurationPluginConstants.IMG_EDITOR );
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getPersistable()
+    /**
+     * {@inheritDoc}
      */
     public IPersistableElement getPersistable()
     {
@@ -77,10 +80,9 @@ public class ServerConfigurationInput im
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+    /**
+     * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
         return null;



Mime
View raw message