directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r690916 - in /directory/studio/trunk/ldifeditor: ./ src/main/java/org/apache/directory/studio/ldifeditor/ src/main/java/org/apache/directory/studio/ldifeditor/editor/
Date Mon, 01 Sep 2008 09:13:20 GMT
Author: pamarcelot
Date: Mon Sep  1 02:13:19 2008
New Revision: 690916

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

Modified:
    directory/studio/trunk/ldifeditor/plugin.properties
    directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
    directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
    directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java
    directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java

Modified: directory/studio/trunk/ldifeditor/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/plugin.properties?rev=690916&r1=690915&r2=690916&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/plugin.properties (original)
+++ directory/studio/trunk/ldifeditor/plugin.properties Mon Sep  1 02:13:19 2008
@@ -15,6 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+Plugin_id=org.apache.directory.studio.ldifeditor
+
 Editor_LdifEditor_id=org.apache.directory.studio.ldifeditor.editor.LdifEditor
 Editor_LdifEditor_name=LDIF Editor
 

Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java?rev=690916&r1=690915&r2=690916&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
(original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
Mon Sep  1 02:13:19 2008
@@ -23,10 +23,12 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.MissingResourceException;
+import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
 
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.text.templates.ContextTypeRegistry;
@@ -46,10 +48,6 @@
  */
 public class LdifEditorActivator extends AbstractUIPlugin
 {
-
-    /** The plugin ID */
-    public static final String PLUGIN_ID = "org.apache.directory.studio.ldifeditor";
-
     /** The shared instance */
     private static LdifEditorActivator plugin;
 
@@ -65,6 +63,9 @@
     /** The context type registry */
     private ContributionContextTypeRegistry ldifTemplateContextTypeRegistry;
 
+    /** The plugin properties */
+    private PropertyResourceBundle properties;
+
 
     /**
      * The constructor
@@ -283,4 +284,32 @@
         return resourceBundle;
     }
 
+
+    /**
+     * 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 )
+            {
+                // We can't use the PLUGIN_ID constant since loading the plugin.properties
file has failed,
+                // So we're using a default plugin id.
+                getLog().log(
+                    new Status( Status.ERROR, "org.apache.directory.studio.ldifeditor", Status.OK,
+                        "Unable to get the plugin properties.", e ) );
+            }
+        }
+
+        return properties;
+    }
 }

Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java?rev=690916&r1=690915&r2=690916&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
(original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
Mon Sep  1 02:13:19 2008
@@ -28,6 +28,9 @@
  */
 public interface LdifEditorConstants
 {
+    /** The plug-in ID */
+    public static final String PLUGIN_ID = LdifEditorActivator.getDefault().getPluginProperties().getString(
+        "Plugin_id" );
 
     public static final String ACTION_ID_EDIT_RECORD = "org.apache.directory.studio.ldapbrowser.action.editRecord";
 

Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java?rev=690916&r1=690915&r2=690916&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java
(original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java
Mon Sep  1 02:13:19 2008
@@ -34,7 +34,7 @@
 import java.util.List;
 
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
-import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.studio.ldifeditor.LdifEditorConstants;
 import org.apache.directory.studio.ldifeditor.editor.text.LdifExternalAnnotationModel;
 import org.apache.directory.studio.ldifparser.model.LdifFile;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
@@ -280,7 +280,7 @@
         }
         catch ( IOException e )
         {
-            throw new CoreException( new Status( IStatus.ERROR, LdifEditorActivator.PLUGIN_ID,
IStatus.OK,
+            throw new CoreException( new Status( IStatus.ERROR, LdifEditorConstants.PLUGIN_ID,
IStatus.OK,
                 "error reading file", e ) ); //$NON-NLS-1$
         }
     }

Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java?rev=690916&r1=690915&r2=690916&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
(original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
Mon Sep  1 02:13:19 2008
@@ -29,10 +29,10 @@
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.connection.ui.ConnectionUIPlugin;
+import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.actions.ValueEditorPreferencesAction;
-import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.common.widgets.search.BrowserConnectionWidget;
@@ -156,7 +156,7 @@
             { browserStore, editorStore } );
         setPreferenceStore( combinedStore );
 
-        setHelpContextId( LdifEditorActivator.PLUGIN_ID + "." + "tools_ldif_editor" );
+        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" );
     }
 
 
@@ -446,7 +446,7 @@
      */
     public void createPartControl( Composite parent )
     {
-        setHelpContextId( LdifEditorActivator.PLUGIN_ID + "." + "tools_ldif_editor" );
+        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" );
 
         Composite composite = new Composite( parent, SWT.NONE );
         composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );



Mime
View raw message