directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r691555 - in /directory/studio/trunk/rcp: ./ src/main/java/org/apache/directory/studio/ src/main/java/org/apache/directory/studio/actions/
Date Wed, 03 Sep 2008 09:44:55 GMT
Author: seelmann
Date: Wed Sep  3 02:44:55 2008
New Revision: 691555

URL: http://svn.apache.org/viewvc?rev=691555&view=rev
Log:
Added action IDs to plugin.properties

Added:
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/PluginConstants.java
Modified:
    directory/studio/trunk/rcp/plugin.properties
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Activator.java
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/AddExtensionAction.java
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ManageConfigurationAction.java
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/OpenFileAction.java
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ReportABugAction.java
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/UpdateAction.java

Modified: directory/studio/trunk/rcp/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/plugin.properties?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/plugin.properties (original)
+++ directory/studio/trunk/rcp/plugin.properties Wed Sep  3 02:44:55 2008
@@ -14,9 +14,10 @@
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
-aboutText=Apache Directory Studio\n\n\
-Version: ${pom.version}\n\n\
-(c) Copyright Apache Software Foundation - 2006, 2008. All right reserved.\n\
-Visit http://directory.apache.org/studio\n\n\
-This product is licensed under the terms of the Apache Software License 2.0.\n\n\
-Some icons from FAMFAMFAM http://www.famfamfam.com/lab/icons/silk
+aboutText=Apache Directory Studio\n\n\Version: ${pom.version}\n\n\(c) Copyright Apache Software
Foundation - 2006, 2008. All right reserved.\n\Visit http://directory.apache.org/studio\n\n\This
product is licensed under the terms of the Apache Software License 2.0.\n\n\Some icons from
FAMFAMFAM http://www.famfamfam.com/lab/icons/silk
+
+Action_AddExtension_id=org.apache.directory.studio.newExtensions
+Action_ManageConfiguration_id=org.apache.directory.studio.manageConfiguration
+Action_OpenFile_id=org.apache.directory.studio.openFile
+Action_ReportABug_id=org.apache.directory.studio.reportABug
+Action_Update_id=org.apache.directory.studio.newUpdates

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Activator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Activator.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Activator.java (original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Activator.java Wed
Sep  3 02:44:55 2008
@@ -21,6 +21,12 @@
 package org.apache.directory.studio;
 
 
+import java.io.IOException;
+import java.util.PropertyResourceBundle;
+
+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.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
@@ -38,6 +44,9 @@
     //The shared instance.
     private static Activator plugin;
 
+    /** The plugin properties */
+    private PropertyResourceBundle properties;
+
 
     /**
      * The constructor.
@@ -89,4 +98,33 @@
     {
         return AbstractUIPlugin.imageDescriptorFromPlugin( Application.PLUGIN_ID, path );
     }
+
+
+    /**
+     * 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.rcp", Status.OK,
+                        "Unable to get the plugin properties.", e ) );
+            }
+        }
+
+        return properties;
+    }
 }

Added: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/PluginConstants.java?rev=691555&view=auto
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/PluginConstants.java
(added)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/PluginConstants.java
Wed Sep  3 02:44:55 2008
@@ -0,0 +1,52 @@
+/*
+ *  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;
+
+
+/**
+ * This interface contains all the Constants used in the Plugin.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface PluginConstants
+{
+
+    /** The Add Extension Action ID */
+    public static final String ACTION_ADD_EXTENSION_ID = Activator.getDefault().getPluginProperties().getString(
+        "Action_AddExtension_id" );
+
+    /** The Manage Configuration Action ID */
+    public static final String ACTION_MANAGE_CONFIGURATION_ID = Activator.getDefault().getPluginProperties().getString(
+        "Action_ManageConfiguration_id" );
+
+    /** The Open File Action ID */
+    public static final String ACTION_OPEN_FILE_ID = Activator.getDefault().getPluginProperties().getString(
+        "Action_OpenFile_id" );
+
+    /** The Report A Bug Action ID */
+    public static final String ACTION_REPORT_A_BUG_ID = Activator.getDefault().getPluginProperties().getString(
+        "Action_ReportABug_id" );
+
+    /** The Update ActionID */
+    public static final String ACTION_UPDATE_ID = Activator.getDefault().getPluginProperties().getString(
+        "Action_Update_id" );
+
+}

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/AddExtensionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/AddExtensionAction.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/AddExtensionAction.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/AddExtensionAction.java
Wed Sep  3 02:44:55 2008
@@ -25,6 +25,7 @@
 import java.net.URL;
 
 import org.apache.directory.studio.Messages;
+import org.apache.directory.studio.PluginConstants;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.swt.custom.BusyIndicator;
@@ -58,6 +59,7 @@
     public AddExtensionAction( IWorkbenchWindow window )
     {
         this.window = window;
+        setId( PluginConstants.ACTION_ADD_EXTENSION_ID ); //$NON-NLS-1$
         setText( Messages.getString( "AddExtensionAction.Add_Extensions" ) ); //$NON-NLS-1$
         setToolTipText( Messages.getString( "AddExtensionAction.Search_for_new_extensions"
) ); //$NON-NLS-1$
     }
@@ -87,10 +89,12 @@
                 UpdateSearchScope scope = new UpdateSearchScope();
                 try
                 {
-                    String homeBase = System.getProperty(
-                        "studio.homebase", Messages.getString( "AddExtensionAction.Apache_Directory_Studio_Home_Base"
) ); //$NON-NLS-1$ //$NON-NLS-2$
+                    String homeBase = System
+                        .getProperty(
+                            "studio.homebase", Messages.getString( "AddExtensionAction.Apache_Directory_Studio_Home_Base"
) ); //$NON-NLS-1$ //$NON-NLS-2$
                     URL url = new URL( homeBase );
-                    scope.addSearchSite( Messages.getString( "AddExtensionAction.Apache_Directory_Studio_Site"
), url, null ); //$NON-NLS-1$
+                    scope.addSearchSite(
+                        Messages.getString( "AddExtensionAction.Apache_Directory_Studio_Site"
), url, null ); //$NON-NLS-1$
                 }
                 catch ( MalformedURLException e )
                 {

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ManageConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ManageConfigurationAction.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ManageConfigurationAction.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ManageConfigurationAction.java
Wed Sep  3 02:44:55 2008
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.studio.Messages;
+import org.apache.directory.studio.PluginConstants;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.swt.custom.BusyIndicator;
@@ -50,6 +51,7 @@
     public ManageConfigurationAction( IWorkbenchWindow window )
     {
         this.window = window;
+        setId( PluginConstants.ACTION_MANAGE_CONFIGURATION_ID ); //$NON-NLS-1$
         setText( Messages.getString( "ManageConfigurationAction.Manage_Configuration" ) );
//$NON-NLS-1$
         setToolTipText( Messages.getString( "ManageConfigurationAction.Manage_configuration_for_LDAP_Studio"
) ); //$NON-NLS-1$
     }

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/OpenFileAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/OpenFileAction.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/OpenFileAction.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/OpenFileAction.java
Wed Sep  3 02:44:55 2008
@@ -24,6 +24,7 @@
 import java.text.MessageFormat;
 
 import org.apache.directory.studio.Messages;
+import org.apache.directory.studio.PluginConstants;
 import org.eclipse.core.filesystem.EFS;
 import org.eclipse.core.filesystem.IFileInfo;
 import org.eclipse.core.filesystem.IFileStore;
@@ -56,6 +57,7 @@
      */
     public OpenFileAction()
     {
+        setId( PluginConstants.ACTION_OPEN_FILE_ID ); //$NON-NLS-1$
         setText( Messages.getString( "OpenFileAction.Open_File" ) ); //$NON-NLS-1$
         setToolTipText( Messages.getString( "OpenFileAction.Open_file_from_filesystem" )
); //$NON-NLS-1$
         setEnabled( true );

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ReportABugAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ReportABugAction.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ReportABugAction.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/ReportABugAction.java
Wed Sep  3 02:44:55 2008
@@ -25,6 +25,7 @@
 import java.net.URL;
 
 import org.apache.directory.studio.Messages;
+import org.apache.directory.studio.PluginConstants;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
@@ -51,6 +52,7 @@
      */
     public ReportABugAction()
     {
+        setId( PluginConstants.ACTION_REPORT_A_BUG_ID ); //$NON-NLS-1$
         setText( Messages.getString( "ReportABugAction.Report_a_bug" ) ); //$NON-NLS-1$
         setToolTipText( Messages.getString( "ReportABugAction.Open_a_web_browser" ) ); //$NON-NLS-1$
         setEnabled( true );
@@ -112,14 +114,14 @@
         try
         {
             workbenchWindow.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(
-                new URL( Messages.getString("ReportABugAction.JIRA_URL") ) ); //$NON-NLS-1$
+                new URL( Messages.getString( "ReportABugAction.JIRA_URL" ) ) ); //$NON-NLS-1$
         }
         catch ( PartInitException e )
         {
         }
         catch ( MalformedURLException e )
         {
-        } 
+        }
     }
 
 }
\ No newline at end of file

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/UpdateAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/UpdateAction.java?rev=691555&r1=691554&r2=691555&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/UpdateAction.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/actions/UpdateAction.java
Wed Sep  3 02:44:55 2008
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.studio.Messages;
+import org.apache.directory.studio.PluginConstants;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.swt.custom.BusyIndicator;
@@ -51,6 +52,7 @@
     public UpdateAction( IWorkbenchWindow window )
     {
         this.window = window;
+        setId( PluginConstants.ACTION_UPDATE_ID ); //$NON-NLS-1$
         setText( Messages.getString( "UpdateAction.Search_for_updates" ) ); //$NON-NLS-1$
         setToolTipText( Messages.getString( "UpdateAction.Search_for_updates_for_LDAP_Studio"
) ); //$NON-NLS-1$
     }



Mime
View raw message