directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r689081 - in /directory/studio/trunk/connection-ui: ./ META-INF/ src/main/java/org/apache/directory/studio/connection/ui/ src/main/java/org/apache/directory/studio/connection/ui/actions/
Date Tue, 26 Aug 2008 13:58:47 GMT
Author: pamarcelot
Date: Tue Aug 26 06:58:46 2008
New Revision: 689081

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

Added:
    directory/studio/trunk/connection-ui/plugin.properties
Modified:
    directory/studio/trunk/connection-ui/META-INF/MANIFEST.MF
    directory/studio/trunk/connection-ui/plugin.xml
    directory/studio/trunk/connection-ui/pom.xml
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java

Modified: directory/studio/trunk/connection-ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/META-INF/MANIFEST.MF?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/connection-ui/META-INF/MANIFEST.MF Tue Aug 26 06:58:46 2008
@@ -1,10 +1,10 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: Apache Directory Studio Connection UI
+Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.apache.directory.studio.connection.ui;singleton:=true
 Bundle-Version: 1.3.0.SNAPSHOT
 Bundle-Activator: org.apache.directory.studio.connection.ui.ConnectionUIPlugin
-Bundle-Vendor: Apache Software Foundation
+Bundle-Vendor: %plugin_vendor
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,

Added: directory/studio/trunk/connection-ui/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/plugin.properties?rev=689081&view=auto
==============================================================================
--- directory/studio/trunk/connection-ui/plugin.properties (added)
+++ directory/studio/trunk/connection-ui/plugin.properties Tue Aug 26 06:58:46 2008
@@ -0,0 +1,38 @@
+# 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 Connection UI
+plugin_vendor=Apache Software Foundation
+
+ExtensionPoint_ConnectionParameterPages_id=org.apache.directory.studio.connectionparameterpages
+ExtensionPoint_ConnectionParameterPages_name=Connection Parameter Pages
+
+Prop_ConnectionPropertyPage_id=org.apache.directory.studio.connection.ui.properties.ConnectionPropertyPage
+Prop_ConnectionPropertyPage_name=Connection
+
+NewWizards_Category_id=org.apache.directory.studio.ldapbrowser.newWizards
+
+NewWizards_NewConnectionWizard_id=org.apache.directory.studio.connection.ui.wizards.NewConnectionWizard
+NewWizards_NewConnectionWizard_name=LDAP Connection
+
+ConnectionParameterPage_NetworkParameterPage_id=org.apache.directory.studio.connection.ui.widgets.NetworkParameterPage
+ConnectionParameterPage_NetworkParameterPage_name=Network Parameter
+ConnectionParameterPage_NetworkParameterPage_description=Please enter connection name and
network parameters.
+
+ConnectionParameterPage_AuthenticationParameterPage_id=org.apache.directory.studio.connection.ui.widgets.AuthenticationParameterPage
+ConnectionParameterPage_AuthenticationParameterPage_name=Authentication
+ConnectionParameterPage_AuthenticationParameterPage_description=Please select an authentification
method and input authentification data.
\ No newline at end of file

Modified: directory/studio/trunk/connection-ui/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/plugin.xml?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/plugin.xml (original)
+++ directory/studio/trunk/connection-ui/plugin.xml Tue Aug 26 06:58:46 2008
@@ -19,14 +19,14 @@
   under the License.
 -->
 <plugin>
-    <extension-point id="org.apache.directory.studio.connectionparameterpages" name="Connection
Parameter Pages" schema="src/main/resources/connectionParameterPages.exsd"/>
+    <extension-point id="org.apache.directory.studio.connectionparameterpages" name="%ExtensionPoint_ConnectionParameterPages_name"
schema="src/main/resources/connectionParameterPages.exsd"/>
 
    	<extension
 		point="org.eclipse.ui.propertyPages">
 		<page
         class="org.apache.directory.studio.connection.ui.properties.ConnectionPropertyPage"
-        id="org.apache.directory.studio.connection.ui.properties.ConnectionPropertyPage"
-        name="Connection"
+        id="%Prop_ConnectionPropertyPage_id"
+        name="%Prop_ConnectionPropertyPage_name"
         objectClass="org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider"/>
           
 
    </extension>
@@ -34,27 +34,27 @@
    <extension
          point="org.eclipse.ui.newWizards">
       <wizard
-            category="org.apache.directory.studio.ldapbrowser.newWizards"
+            category="%NewWizards_Category_id"
             class="org.apache.directory.studio.connection.ui.wizards.NewConnectionWizard"
             hasPages="true"
             icon="resources/icons/connection_add.gif"
-            id="org.apache.directory.studio.connection.ui.wizards.NewConnectionWizard"
-            name="LDAP Connection"
+            id="%NewWizards_NewConnectionWizard_id"
+            name="%NewWizards_NewConnectionWizard_name"
             project="false"/>
    </extension>
    <extension
          point="org.apache.directory.studio.connectionparameterpages">
       <connectionParameterPage
             class="org.apache.directory.studio.connection.ui.widgets.NetworkParameterPage"
-            dependsOnId="org.apache.directory.studio.connection.ui.widgets.NetworkParameterPage"
-            description="Please enter connection name and network parameters."
-            id="org.apache.directory.studio.connection.ui.widgets.NetworkParameterPage"
-            name="Network Parameter"/>
+            dependsOnId="%ConnectionParameterPage_NetworkParameterPage_id"
+            description="%ConnectionParameterPage_NetworkParameterPage_description"
+            id="%ConnectionParameterPage_NetworkParameterPage_id"
+            name="%ConnectionParameterPage_NetworkParameterPage_name"/>
       <connectionParameterPage
             class="org.apache.directory.studio.connection.ui.widgets.AuthenticationParameterPage"
-            dependsOnId="org.apache.directory.studio.connection.ui.widgets.NetworkParameterPage"
-            description="Please select an authentification method and input authentification
data."
-            id="org.apache.directory.studio.connection.ui.widgets.AuthenticationParameterPage"
-            name="Authentication"/>
+            dependsOnId="%ConnectionParameterPage_NetworkParameterPage_id"
+            description="%ConnectionParameterPage_AuthenticationParameterPage_description"
+            id="%ConnectionParameterPage_AuthenticationParameterPage_id"
+            name="%ConnectionParameterPage_AuthenticationParameterPage_name"/>
    </extension>  
 </plugin>

Modified: directory/studio/trunk/connection-ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/pom.xml?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/pom.xml (original)
+++ directory/studio/trunk/connection-ui/pom.xml Tue Aug 26 06:58:46 2008
@@ -39,6 +39,7 @@
       <resource>
         <directory>.</directory>
         <includes>
+          <include>plugin.properties</include>
           <include>plugin.xml</include>
         </includes>
       </resource>

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
Tue Aug 26 06:58:46 2008
@@ -42,7 +42,7 @@
  */
 public class ConnectionParameterPageManager
 {
-    
+
     /**
      * Gets the connection parameter pages by searching for connection parameter page
      * extensions.
@@ -52,8 +52,8 @@
     public static ConnectionParameterPage[] getConnectionParameterPages()
     {
         IExtensionRegistry registry = Platform.getExtensionRegistry();
-        IExtensionPoint extensionPoint = registry
-            .getExtensionPoint( "org.apache.directory.studio.connectionparameterpages" );
+        IExtensionPoint extensionPoint = registry.getExtensionPoint( ConnectionUIPlugin.getDefault()
+            .getPluginProperties().getString( "ExtensionPoint_ConnectionParameterPages_id"
) );
         IConfigurationElement[] members = extensionPoint.getConfigurationElements();
         final Map<String, ConnectionParameterPage> pageMap = new HashMap<String,
ConnectionParameterPage>();
 
@@ -87,25 +87,25 @@
                 String dependsOnId2 = p2.getPageDependsOnId();
                 do
                 {
-                    if(dependsOnId1 == null && dependsOnId2 != null )
+                    if ( dependsOnId1 == null && dependsOnId2 != null )
                     {
                         return -1;
                     }
-                    else if(dependsOnId2 == null && dependsOnId1 != null )
+                    else if ( dependsOnId2 == null && dependsOnId1 != null )
                     {
                         return 1;
                     }
-                    else if(dependsOnId1 != null && dependsOnId1.equals( p2.getPageId()
))
+                    else if ( dependsOnId1 != null && dependsOnId1.equals( p2.getPageId()
) )
                     {
                         return 1;
                     }
-                    else if(dependsOnId2 != null && dependsOnId2.equals( p1.getPageId()
))
+                    else if ( dependsOnId2 != null && dependsOnId2.equals( p1.getPageId()
) )
                     {
                         return -1;
                     }
-                    
+
                     ConnectionParameterPage page = pageMap.get( dependsOnId1 );
-                    if(page != null)
+                    if ( page != null )
                     {
                         dependsOnId1 = page.getPageDependsOnId();
                     }
@@ -114,31 +114,31 @@
                         dependsOnId1 = null;
                     }
                 }
-                while(dependsOnId1 != null && !dependsOnId1.equals( p1.getPageId()
));
-                
+                while ( dependsOnId1 != null && !dependsOnId1.equals( p1.getPageId()
) );
+
                 dependsOnId1 = p1.getPageDependsOnId();
                 dependsOnId2 = p2.getPageDependsOnId();
                 do
                 {
-                    if(dependsOnId1 == null && dependsOnId2 != null )
+                    if ( dependsOnId1 == null && dependsOnId2 != null )
                     {
                         return -1;
                     }
-                    else if(dependsOnId2 == null && dependsOnId1 != null )
+                    else if ( dependsOnId2 == null && dependsOnId1 != null )
                     {
                         return 1;
                     }
-                    else if(dependsOnId1 != null && dependsOnId1.equals( p2.getPageId()
))
+                    else if ( dependsOnId1 != null && dependsOnId1.equals( p2.getPageId()
) )
                     {
                         return 1;
                     }
-                    else if(dependsOnId2 != null && dependsOnId2.equals( p1.getPageId()
))
+                    else if ( dependsOnId2 != null && dependsOnId2.equals( p1.getPageId()
) )
                     {
                         return -1;
                     }
-                    
+
                     ConnectionParameterPage page = pageMap.get( dependsOnId2 );
-                    if(page != null)
+                    if ( page != null )
                     {
                         dependsOnId2 = page.getPageDependsOnId();
                     }
@@ -147,13 +147,13 @@
                         dependsOnId2 = null;
                     }
                 }
-                while(dependsOnId2 != null && !dependsOnId2.equals( p2.getPageId()
));
-                
+                while ( dependsOnId2 != null && !dependsOnId2.equals( p2.getPageId()
) );
+
                 return 0;
             }
         };
         Arrays.sort( pages, pageComparator );
-        
+
         return pages;
     }
 }

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
Tue Aug 26 06:58:46 2008
@@ -21,12 +21,15 @@
 package org.apache.directory.studio.connection.ui;
 
 
+import java.io.IOException;
 import java.net.URL;
+import java.util.PropertyResourceBundle;
 
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.event.EventRunner;
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -38,7 +41,6 @@
  */
 public class ConnectionUIPlugin extends AbstractUIPlugin
 {
-
     /** The Constant PLUGIN_ID. */
     public static final String PLUGIN_ID = "org.apache.directory.studio.connection.ui";
 
@@ -51,6 +53,9 @@
     /** The event runner. */
     private EventRunner eventRunner;
 
+    /** The plugin properties */
+    private PropertyResourceBundle properties;
+
 
     /**
      * The constructor
@@ -188,4 +193,30 @@
         return eventRunner;
     }
 
+
+    /**
+     * 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, ConnectionUIPlugin.PLUGIN_ID, Status.OK,
+                        "Unable to get the plugin properties.", e ) );
+            }
+        }
+
+        return properties;
+    }
 }

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java?rev=689081&r1=689080&r2=689081&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
Tue Aug 26 06:58:46 2008
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.studio.connection.core.Utils;
+import org.apache.directory.studio.connection.ui.ConnectionUIPlugin;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -96,7 +97,7 @@
         if ( getSelectedConnections().length == 1 )
         {
             element = ( IAdaptable ) getSelectedConnections()[0];
-            pageId = "org.apache.directory.studio.connection.ui.properties.ConnectionPropertyPage";
+            pageId = ConnectionUIPlugin.getDefault().getPluginProperties().getString( "Prop_ConnectionPropertyPage_id"
);
             title = getSelectedConnections()[0].getName();
         }
 
@@ -110,5 +111,4 @@
 
         }
     }
-    
 }



Mime
View raw message