directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1675851 - in /directory/studio/trunk/plugins/openldap.config.editor: ./ resources/icons/ src/main/java/org/apache/directory/studio/openldap/config/ src/main/java/org/apache/directory/studio/openldap/config/jobs/ src/main/java/org/apache/di...
Date Fri, 24 Apr 2015 13:29:41 GMT
Author: elecharny
Date: Fri Apr 24 13:29:41 2015
New Revision: 1675851

URL: http://svn.apache.org/r1675851
Log:
o Added a handle for the new configuration files opening in the File-> new menu
o Formatted the plugin.xml file
o Added the editor_new gif
o Minor formating

Added:
    directory/studio/trunk/plugins/openldap.config.editor/resources/icons/editor_new.gif 
 (with props)
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/NewOpenLDAPConfigurationFileWizard.java
Modified:
    directory/studio/trunk/plugins/openldap.config.editor/plugin.xml
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/OpenLdapConfigurationPlugin.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/jobs/LoadConfigurationRunnable.java

Modified: directory/studio/trunk/plugins/openldap.config.editor/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/plugin.xml?rev=1675851&r1=1675850&r2=1675851&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/plugin.xml (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/plugin.xml Fri Apr 24 13:29:41 2015
@@ -19,64 +19,69 @@
 -->
 <?eclipse version="3.2"?>
 <plugin>
-   <extension
-         point="org.eclipse.ui.editors">
-      <editor
-            class="org.apache.directory.studio.openldap.config.editor.ServerConfigurationEditor"
-            default="false"
-            icon="resources/icons/editor.gif"
-            id="org.apache.directory.studio.openldap.config.editor.ServerConfigurationEditor"
-            name="OpenLDAP Configuration Editor">
-      </editor>
-   </extension>
-   <extension
-         point="org.eclipse.ui.popupMenus">
-      <objectContribution
-            objectClass="org.apache.directory.studio.connection.core.Connection"
-            id="org.apache.directory.studio.connection.core.Connection">
-         <action
-               class="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
-               enablesFor="1"
-               id="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
-               label="Open Configuration"
-               icon="resources/icons/editor.gif">
-         </action>
-         <visibility> 
-             <objectState
-         	    name="serverType"
-         	    value="OPENLDAP_2_3">
-         	 </objectState>
-         </visibility>
-      </objectContribution>
-   </extension>
+  <!-- The context menu which will be used to open the server's configuration -->
+  <extension point="org.eclipse.ui.editors">
+    <editor
+        class="org.apache.directory.studio.openldap.config.editor.ServerConfigurationEditor"
+        default="false"
+        icon="resources/icons/editor.gif"
+        id="org.apache.directory.studio.openldap.config.editor.ServerConfigurationEditor"
+        name="OpenLDAP Configuration Editor">
+    </editor>
+  </extension>
    
-   <extension
-         point="org.eclipse.ui.perspectiveExtensions">
-      <perspectiveExtension targetID="%Perspective_LdapPerspective_id">
-         <actionSet id="%ActionSet_OpenLdapMenuActionSet_id"/>
-      </perspectiveExtension>
-   </extension>
+  <extension point="org.eclipse.ui.popupMenus">
+    <objectContribution
+        objectClass="org.apache.directory.studio.connection.core.Connection"
+        id="org.apache.directory.studio.connection.core.Connection">
+      <action
+          class="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
+          enablesFor="1"
+          id="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
+          label="Open Configuration"
+          icon="resources/icons/editor.gif"/>
+      <visibility> 
+         <objectState name="serverType" value="OPENLDAP_2_3"/>
+      </visibility>
+   </objectContribution>
+  </extension>
+
+  <extension point="org.eclipse.ui.perspectiveExtensions">
+    <perspectiveExtension targetID="%Perspective_LdapPerspective_id">
+      <actionSet id="%ActionSet_OpenLdapMenuActionSet_id"/>
+    </perspectiveExtension>
+  </extension>
    
-   <extension
-         point="org.eclipse.ui.actionSets">
-      <actionSet
-            id="%ActionSet_OpenLdapMenuActionSet_id"
-            label="%ActionSet_OpenLdapMenuActionSet_label"
-            visible="false">
-         <menu
-               id="%ActionSet_OpenLdapMenu_id"
-               label="%ActionSet_OpenLdapMenu_label">
-            <groupMarker name="%GroupMarker_OpenConfiguration_name"/>
-         </menu>
-         <action
-               class="org.apache.directory.studio.openldap.config.actions.OpenDirectoryConfigurationAction"
-               icon="resources/icons/open_configuration.gif"
-               id="%Action_OpenDirectoryConfigurationAction_id"
-               label="%Action_OpenDirectoryConfigurationAction_label"
-               menubarPath="%Action_OpenDirectoryConfigurationAction_menubarpath"
-               style="push">
-         </action>
+  <extension point="org.eclipse.ui.actionSets">
+    <actionSet
+        id="%ActionSet_OpenLdapMenuActionSet_id"
+        label="%ActionSet_OpenLdapMenuActionSet_label"
+        visible="false">
+      <menu id="%ActionSet_OpenLdapMenu_id" label="%ActionSet_OpenLdapMenu_label">
+        <groupMarker name="%GroupMarker_OpenConfiguration_name"/>
+      </menu>
+      <action
+          class="org.apache.directory.studio.openldap.config.actions.OpenDirectoryConfigurationAction"
+          icon="resources/icons/open_configuration.gif"
+          id="%Action_OpenDirectoryConfigurationAction_id"
+          label="%Action_OpenDirectoryConfigurationAction_label"
+          menubarPath="%Action_OpenDirectoryConfigurationAction_menubarpath"
+          style="push"/>
     </actionSet>
+  </extension>
+
+
+ <!-- Add a new entry to create an OpenLDAP  configuration in the New menu -->  
+ <extension point="org.eclipse.ui.newWizards">
+  <category id="%NewWizards_Category_id" name="%NewWizards_Category_name" />
+  <wizard
+      canFinishEarly="true"
+      category="%NewWizards_Category_id"
+      class="org.apache.directory.studio.openldap.config.wizards.NewOpenLDAPConfigurationFileWizard"
+      hasPages="false"
+      icon="resources/icons/editor_new.gif"
+      id="%NewWizards_NewOpenLDAPConfigurationFileWizard_id"
+      name="%NewWizards_NewOpenLDAPConfigurationFileWizard_name"
+      project="false"/>
  </extension>
-   
 </plugin>

Added: directory/studio/trunk/plugins/openldap.config.editor/resources/icons/editor_new.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/resources/icons/editor_new.gif?rev=1675851&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/plugins/openldap.config.editor/resources/icons/editor_new.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/OpenLdapConfigurationPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/OpenLdapConfigurationPlugin.java?rev=1675851&r1=1675850&r2=1675851&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/OpenLdapConfigurationPlugin.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/OpenLdapConfigurationPlugin.java
Fri Apr 24 13:29:41 2015
@@ -132,7 +132,7 @@ public class OpenLdapConfigurationPlugin
             URL url = FileLocator.find( getBundle(), new Path( key ), null );
             
             if ( url != null )
-            {   	
+            {
                 return ImageDescriptor.createFromURL( url );
             }
             else

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/jobs/LoadConfigurationRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/jobs/LoadConfigurationRunnable.java?rev=1675851&r1=1675850&r2=1675851&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/jobs/LoadConfigurationRunnable.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/jobs/LoadConfigurationRunnable.java
Fri Apr 24 13:29:41 2015
@@ -48,8 +48,7 @@ public class LoadConfigurationRunnable i
     /**
      * Creates a new instance of LoadConfigurationRunnable.
      * 
-     * @param editor
-     *            the editor
+     * @param editor the editor
      */
     public LoadConfigurationRunnable( ServerConfigurationEditor editor )
     {
@@ -128,12 +127,9 @@ public class LoadConfigurationRunnable i
     /**
      * Gets the configuration from the input.
      * 
-     * @param input
-     *      the editor input
-     * @param monitor
-     *      the studio progress monitor
-     * @return
-     *      the configuration
+     * @param input the editor input
+     * @param monitor the studio progress monitor
+     * @return the configuration
      * @throws Exception
      */
     public OpenLdapConfiguration getConfiguration( IEditorInput input, StudioProgressMonitor
monitor ) throws Exception
@@ -158,12 +154,9 @@ public class LoadConfigurationRunnable i
     /**
      * Reads the configuration from the given connection.
      *
-     * @param input
-     *      the editor input
-     * @param monitor 
-     *      the studio progress monitor
-     * @return
-     *      the associated configuration bean
+     * @param input the editor input
+     * @param monitor the studio progress monitor
+     * @return the associated configuration bean
      * @throws Exception
      */
     private OpenLdapConfiguration readConfiguration( ConnectionServerConfigurationInput input,
@@ -181,12 +174,9 @@ public class LoadConfigurationRunnable i
     /**
      * Reads the configuration from the given connection.
      *
-     * @param input
-     *      the editor input
-     * @param monitor 
-     *      the studio progress monitor
-     * @return
-     *      the associated configuration bean
+     * @param input the editor input
+     * @param monitor the studio progress monitor
+     * @return the associated configuration bean
      * @throws Exception
      */
     private OpenLdapConfiguration readConfiguration( DirectoryServerConfigurationInput input,

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/NewOpenLDAPConfigurationFileWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/NewOpenLDAPConfigurationFileWizard.java?rev=1675851&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/NewOpenLDAPConfigurationFileWizard.java
(added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/wizards/NewOpenLDAPConfigurationFileWizard.java
Fri Apr 24 13:29:41 2015
@@ -0,0 +1,76 @@
+/*
+ *  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.openldap.config.wizards;
+
+
+import org.apache.directory.studio.openldap.config.editor.NewServerConfigurationInput;
+import org.apache.directory.studio.openldap.config.editor.ServerConfigurationEditor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This class implements the New ApacheDS Configuration File Wizard.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class NewOpenLDAPConfigurationFileWizard extends Wizard implements INewWizard
+{
+    /**
+     * {@inheritDoc}
+     */
+    public void addPages()
+    {
+        // This wizard has no page
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean performFinish()
+    {
+        try
+        {
+            IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+            page.openEditor( new NewServerConfigurationInput(), ServerConfigurationEditor.ID
);
+        }
+        catch ( PartInitException e )
+        {
+            // Should never happen
+            return false;
+        }
+
+        return true;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void init( IWorkbench workbench, IStructuredSelection selection )
+    {
+    }
+}



Mime
View raw message