directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r689048 - in /directory/studio/trunk/apacheds-configuration: ./ META-INF/ src/main/java/org/apache/directory/studio/apacheds/configuration/ src/main/java/org/apache/directory/studio/apacheds/configuration/editor/
Date Tue, 26 Aug 2008 12:32:12 GMT
Author: pamarcelot
Date: Tue Aug 26 05:32:09 2008
New Revision: 689048

URL: http://svn.apache.org/viewvc?rev=689048&view=rev
Log:
Part of a fix for DIRSTUDIO-375 (Move each plugin IDs in a plugin.properties file).

Added:
    directory/studio/trunk/apacheds-configuration/plugin.properties
Modified:
    directory/studio/trunk/apacheds-configuration/META-INF/MANIFEST.MF
    directory/studio/trunk/apacheds-configuration/plugin.xml
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java

Modified: directory/studio/trunk/apacheds-configuration/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/META-INF/MANIFEST.MF?rev=689048&r1=689047&r2=689048&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/apacheds-configuration/META-INF/MANIFEST.MF Tue Aug 26 05:32:09
2008
@@ -1,10 +1,10 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: Apache Directory Studio Apache DS Configuration
+Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.apache.directory.studio.apacheds.configuration;singleton:=true
 Bundle-Version: 1.3.0.SNAPSHOT
 Bundle-Activator: org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin
-Bundle-Vendor: Apache Software Foundation
+Bundle-Vendor: %plugin_vendor
 Bundle-Localization: plugin
 Eclipse-LazyStart: true
 Require-Bundle: org.eclipse.core.runtime,

Added: directory/studio/trunk/apacheds-configuration/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/plugin.properties?rev=689048&view=auto
==============================================================================
--- directory/studio/trunk/apacheds-configuration/plugin.properties (added)
+++ directory/studio/trunk/apacheds-configuration/plugin.properties Tue Aug 26 05:32:09 2008
@@ -0,0 +1,31 @@
+# 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.
+
+plugin_name=Apache Directory Studio Apache DS Configuration
+plugin_vendor=Apache Software Foundation
+
+Editor_ServerConfigurationEditor_id=org.apache.directory.studio.apacheds.configuration.editor
+Editor_ServerConfigurationEditor_name=Apache DS Configuration File Editor
+
+ContentType_ServerConfiguration_id=org.apache.directory.studio.apacheds.configuration.contenttype
+ContentType_ServerConfiguration_name=Apache DS Configuration File
+
+NewWizards_Category_id=org.apache.directory.studio.apacheds.configuration.newWizards
+NewWizards_Category_name=Apache DS
+
+NewWizards_NewApacheDSConfigurationFileWizard_id=org.apache.directory.studio.apacheds.configuration.NewApacheDSConfigurationFileWizard
+NewWizards_NewApacheDSConfigurationFileWizard_name=Apache DS Configuration File
\ No newline at end of file

Modified: directory/studio/trunk/apacheds-configuration/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/plugin.xml?rev=689048&r1=689047&r2=689048&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/plugin.xml (original)
+++ directory/studio/trunk/apacheds-configuration/plugin.xml Tue Aug 26 05:32:09 2008
@@ -25,8 +25,8 @@
             class="org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor"
             default="true"
             icon="resources/icons/editor.gif"
-            id="org.apache.directory.studio.apacheds.configuration.editor"
-            name="Apache DS Configuration File Editor">
+            id="%Editor_ServerConfigurationEditor_id"
+            name="%Editor_ServerConfigurationEditor_name">
          <contentTypeBinding
                contentTypeId="org.apache.directory.studio.apacheds.configuration.contenttype">
          </contentTypeBinding>
@@ -39,25 +39,24 @@
             describer="org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationContentDescriber"
             file-extensions="xml"
             file-names="server.xml"
-            id="org.apache.directory.studio.apacheds.configuration.contenttype"
-            name="Apache DS Configuration File"
+            id="%ContentType_ServerConfiguration_id"
+            name="%ContentType_ServerConfiguration_name"
             priority="normal">
       </content-type>
    </extension>
-      <extension
+   <extension
          point="org.eclipse.ui.newWizards">
+      <category
+            id="%NewWizards_Category_id"
+            name="%NewWizards_Category_name" />
       <wizard
             canFinishEarly="false"
-            category="org.apache.directory.studio.apacheds.configuration.newWizards"
+            category="%NewWizards_Category_id"
             class="org.apache.directory.studio.apacheds.configuration.wizards.NewApacheDSConfigurationFileWizard"
             hasPages="true"
             icon="resources/icons/editor_new.gif"
-            id="org.apache.directory.studio.apacheds.configuration.NewApacheDSConfigurationFileWizard"
-            name="Apache DS Configuration File"
+            id="%NewWizards_NewApacheDSConfigurationFileWizard_id"
+            name="%NewWizards_NewApacheDSConfigurationFileWizard_name"
             project="false"/>
-      <category
-            id="org.apache.directory.studio.apacheds.configuration.newWizards"
-            name="Apache DS">
-      </category>
    </extension>
 </plugin>

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java?rev=689048&r1=689047&r2=689048&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPlugin.java
Tue Aug 26 05:32:09 2008
@@ -20,11 +20,14 @@
 package org.apache.directory.studio.apacheds.configuration;
 
 
+import java.io.IOException;
 import java.net.URL;
+import java.util.PropertyResourceBundle;
 
 import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -56,6 +59,9 @@
     /** The shared instance */
     private static ApacheDSConfigurationPlugin plugin;
 
+    /** The plugin properties */
+    private PropertyResourceBundle properties;
+
     private ServerXmlIO[] serverXmlIOs = new ServerXmlIO[]
         { new ServerXmlIOV153(), new ServerXmlIOV152(), new ServerXmlIOV151(), new ServerXmlIOV150(),
};
 
@@ -183,4 +189,30 @@
         }
         return image;
     }
+
+
+    /**
+     * Gets the plugin properties.
+     *
+     * @return
+     *      the plugin properties
+     */
+    public PropertyResourceBundle getPluginProperties()
+    {
+        if ( properties == null )
+        {
+            try
+            {
+                properties = new PropertyResourceBundle( FileLocator.openStream( this.getBundle(),
new Path(
+                    "plugin.properties" ), false ) );
+            }
+            catch ( IOException e )
+            {
+                getLog().log(
+                    new Status( Status.ERROR, PLUGIN_ID, Status.OK, "Unable to get the plugin
properties.", e ) );
+            }
+        }
+
+        return properties;
+    }
 }

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java?rev=689048&r1=689047&r2=689048&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationPluginConstants.java
Tue Aug 26 05:32:09 2008
@@ -28,7 +28,9 @@
  */
 public interface ApacheDSConfigurationPluginConstants
 {
-    // Images
+    // ------
+    // IMAGES
+    // ------
     public static final String IMG_EXTENDED_OPERATION = "resources/icons/extended_operation.gif";
     public static final String IMG_HORIZONTAL_ORIENTATION = "resources/icons/horizontal_orientation.gif";
     public static final String IMG_INTERCEPTOR = "resources/icons/interceptor.gif";
@@ -36,4 +38,10 @@
     public static final String IMG_PARTITION = "resources/icons/partition.gif";
     public static final String IMG_PARTITION_SYSTEM = "resources/icons/partition_system.gif";
     public static final String IMG_VERTICAL_ORIENTATION = "resources/icons/vertical_orientation.gif";
+
+    // -------
+    // EDITORS
+    // -------
+    public static final String EDITOR_SERVER_CONFIGURATION_EDITOR = ApacheDSConfigurationPlugin.getDefault()
+        .getPluginProperties().getString( "Editor_ServerConfigurationEditor_id" );
 }

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=689048&r1=689047&r2=689048&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
Tue Aug 26 05:32:09 2008
@@ -31,6 +31,7 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginConstants;
 import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginUtils;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
 import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
@@ -76,7 +77,7 @@
 public class ServerConfigurationEditor extends FormEditor
 {
     /** The Editor ID */
-    public static final String ID = "org.apache.directory.studio.apacheds.configuration.editor";
+    public static final String ID = ApacheDSConfigurationPluginConstants.EDITOR_SERVER_CONFIGURATION_EDITOR;
 
     /** The Server Configuration */
     private ServerConfiguration serverConfiguration;



Mime
View raw message