From commits-return-20595-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Fri Nov 28 08:03:24 2008 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 85039 invoked from network); 28 Nov 2008 08:03:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2008 08:03:24 -0000 Received: (qmail 13061 invoked by uid 500); 28 Nov 2008 08:03:35 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 13027 invoked by uid 500); 28 Nov 2008 08:03:35 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 13018 invoked by uid 99); 28 Nov 2008 08:03:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Nov 2008 00:03:35 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Nov 2008 08:02:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB3DF23888A4; Fri, 28 Nov 2008 00:02:32 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r721374 - /directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/ Date: Fri, 28 Nov 2008 08:02:32 -0000 To: commits@directory.apache.org From: felixk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081128080232.EB3DF23888A4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: felixk Date: Fri Nov 28 00:02:31 2008 New Revision: 721374 URL: http://svn.apache.org/viewvc?rev=721374&view=rev Log: Externalize Strings Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java (with props) directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties (with props) Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionActionHelper.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/DeleteAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/NewServerAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/OpenConfigurationAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/PropertiesAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RenameAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RunAction.java directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/StopAction.java Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionAction.java Fri Nov 28 00:02:31 2008 @@ -17,6 +17,7 @@ * under the License. * */ + package org.apache.directory.studio.apacheds.actions; @@ -52,8 +53,6 @@ */ public class CreateConnectionAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "Create a Connection"; - /** The associated view */ private ServersView view; @@ -63,7 +62,7 @@ */ public CreateConnectionAction() { - super( ACTION_TEXT ); + super( Messages.getString( "CreateConnectionAction.CreateAConnection" ) ); //$NON-NLS-1$ init(); } @@ -76,7 +75,7 @@ */ public CreateConnectionAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "CreateConnectionAction.CreateAConnection" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -89,7 +88,7 @@ { setId( ApacheDsPluginConstants.CMD_CREATE_CONNECTION ); setActionDefinitionId( ApacheDsPluginConstants.CMD_CREATE_CONNECTION ); - setToolTipText( "Stop" ); + setToolTipText( Messages.getString( "CreateConnectionAction.StopToolTip" ) ); //$NON-NLS-1$ setImageDescriptor( ApacheDsPlugin.getDefault().getImageDescriptor( ApacheDsPluginConstants.IMG_CREATE_CONNECTION ) ); } @@ -133,7 +132,7 @@ return; } - if ( isEnableLdapOrLdaps( serverConfiguration )) + if ( isEnableLdapOrLdaps( serverConfiguration ) ) { // Creating the connection using the helper class CreateConnectionActionHelper.createLdapBrowserConnection( server.getName(), serverConfiguration ); @@ -141,9 +140,9 @@ else { // LDAP and LDAPS protocols are disabled, we report this error to the user - MessageDialog dialog = new MessageDialog( view.getSite().getShell(), - "Unable to create a connection", null, - "LDAP and LDAPS protocols are disabled. A connection cannot be created.", MessageDialog.ERROR, + MessageDialog dialog = new MessageDialog( view.getSite().getShell(), Messages + .getString( "CreateConnectionAction.UnableCreateConnection" ), null, //$NON-NLS-1$ + Messages.getString( "CreateConnectionAction.LDAPAndLDAPSDisabled" ), MessageDialog.ERROR, //$NON-NLS-1$ new String[] { IDialogConstants.OK_LABEL }, MessageDialog.OK ); dialog.open(); @@ -166,15 +165,17 @@ if ( errorMessage == null ) { - message = "Unable to read the server configuration."; + message = Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ); //$NON-NLS-1$ } else { - message = "Unable to read the server configuration." + ApacheDsPluginUtils.LINE_SEPARATOR - + ApacheDsPluginUtils.LINE_SEPARATOR + "The following error occurred: " + errorMessage; + message = Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ) + ApacheDsPluginUtils.LINE_SEPARATOR //$NON-NLS-1$ + + ApacheDsPluginUtils.LINE_SEPARATOR + + Messages.getString( "CreateConnectionAction.FollowingErrorOccurred" ) + errorMessage; //$NON-NLS-1$ } - MessageDialog dialog = new MessageDialog( view.getSite().getShell(), "Unable to read the server configuration", + MessageDialog dialog = new MessageDialog( view.getSite().getShell(), Messages + .getString( "CreateConnectionAction.UnableReadServerConfiguration" ), //$NON-NLS-1$ null, message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, MessageDialog.OK ); dialog.open(); @@ -253,7 +254,7 @@ PropertyResourceBundle properties = ApacheDsPlugin.getDefault().getPluginProperties(); // Connection Core Plugin - Bundle connectionCoreBundle = Platform.getBundle( properties.getString( "Plugin_ConnectionCore_id" ) ); + Bundle connectionCoreBundle = Platform.getBundle( properties.getString( "Plugin_ConnectionCore_id" ) ); //$NON-NLS-1$ if ( connectionCoreBundle != null ) { // Checking the state of the plugin @@ -263,7 +264,7 @@ } // Connection UI Plugin - Bundle connectionUiBundle = Platform.getBundle( properties.getString( "Plugin_ConnectionUi_id" ) ); + Bundle connectionUiBundle = Platform.getBundle( properties.getString( "Plugin_ConnectionUi_id" ) ); //$NON-NLS-1$ if ( connectionUiBundle != null ) { // Checking the state of the plugin @@ -274,7 +275,7 @@ // LDAP Browser Common Plugin Bundle ldapBrowserCommonBundle = Platform.getBundle( properties - .getString( "Plugin_LdapBrowserCommon_id" ) ); + .getString( "Plugin_LdapBrowserCommon_id" ) ); //$NON-NLS-1$ if ( ldapBrowserCommonBundle != null ) { // Checking the state of the plugin @@ -285,7 +286,7 @@ // LDAP Browser Core Plugin Bundle ldapBrowserCoreBundle = Platform.getBundle( properties - .getString( "Plugin_LdapBrowserCore_id" ) ); + .getString( "Plugin_LdapBrowserCore_id" ) ); //$NON-NLS-1$ if ( ldapBrowserCoreBundle != null ) { // Checking the state of the plugin @@ -296,7 +297,7 @@ // LDAP Browser UI Plugin Bundle ldapBrowserUiBundle = Platform.getBundle( properties - .getString( "Plugin_LdapBrowserUi_id" ) ); + .getString( "Plugin_LdapBrowserUi_id" ) ); //$NON-NLS-1$ if ( ldapBrowserUiBundle != null ) { // Checking the state of the plugin @@ -307,7 +308,7 @@ // LDIF Editor Plugin Bundle ldifEditorBundle = Platform - .getBundle( properties.getString( "Plugin_LdifEditor_id" ) ); + .getBundle( properties.getString( "Plugin_LdifEditor_id" ) ); //$NON-NLS-1$ if ( ldifEditorBundle != null ) { // Checking the state of the plugin @@ -318,7 +319,7 @@ // LDIF Parser Plugin Bundle ldifParserBundle = Platform.getBundle( properties - .getString( "Plugin_LdifParser_id" ) ); + .getString( "Plugin_LdifParser_id" ) ); //$NON-NLS-1$ if ( ldifParserBundle != null ) { // Checking the state of the plugin @@ -328,7 +329,7 @@ } // Jars Plugin - Bundle jarsBundle = Platform.getBundle( properties.getString( "Plugin_Jars_id" ) ); + Bundle jarsBundle = Platform.getBundle( properties.getString( "Plugin_Jars_id" ) ); //$NON-NLS-1$ if ( jarsBundle != null ) { // Checking the state of the plugin Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionActionHelper.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionActionHelper.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionActionHelper.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/CreateConnectionActionHelper.java Fri Nov 28 00:02:31 2008 @@ -31,6 +31,7 @@ import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.osgi.util.NLS; import org.eclipse.ui.IPerspectiveDescriptor; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; @@ -91,13 +92,13 @@ } // Bind password - connectionParameter.setBindPassword( "secret" ); + connectionParameter.setBindPassword( "secret" ); //$NON-NLS-1$ // Bind principal - connectionParameter.setBindPrincipal( "uid=admin,ou=system" ); + connectionParameter.setBindPrincipal( "uid=admin,ou=system" ); //$NON-NLS-1$ // Host - connectionParameter.setHost( "localhost" ); + connectionParameter.setHost( "localhost" ); //$NON-NLS-1$ // Name connectionParameter.setName( serverName ); @@ -122,8 +123,12 @@ { // As we're already in the LDAP perspective, we only indicate to the user // the name of the connection that has been created - MessageDialog dialog = new MessageDialog( window.getShell(), "Connection created", null, - "A connection called '" + connection.getName() + "' has been created.", MessageDialog.INFORMATION, + MessageDialog dialog = new MessageDialog( + window.getShell(), + Messages.getString( "CreateConnectionActionHelper.ConnectionCreated" ), null, //$NON-NLS-1$ + NLS + .bind( + Messages.getString( "CreateConnectionActionHelper.ConnectionCalledCreated" ), new String[] { connection.getName() } ), MessageDialog.INFORMATION, //$NON-NLS-1$ new String[] { IDialogConstants.OK_LABEL }, MessageDialog.OK ); dialog.open(); @@ -133,9 +138,12 @@ // We're not already in the LDAP perspective, we indicate to the user // the name of the connection that has been created and we ask him // if we wants to switch to the LDAP perspective - MessageDialog dialog = new MessageDialog( window.getShell(), "Connection created", null, - "A connection called '" + connection.getName() - + "' has been created.\n\nDo you want to switch to the LDAP perspective ?", + MessageDialog dialog = new MessageDialog( + window.getShell(), + Messages.getString( "CreateConnectionActionHelper.ConnectionCreated" ), null, //$NON-NLS-1$ + NLS + .bind( + Messages.getString( "CreateConnectionActionHelper.ConnectionCalledCreatedSwitch" ), new String[] { connection.getName() } ), //$NON-NLS-1$ MessageDialog.INFORMATION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, MessageDialog.OK ); if ( dialog.open() == MessageDialog.OK ) @@ -157,7 +165,7 @@ { for ( IPerspectiveDescriptor perspective : PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives() ) { - if ( ApacheDsPlugin.getDefault().getPluginProperties().getString( "Perspective_LdapBrowserPerspective_id" ) + if ( ApacheDsPlugin.getDefault().getPluginProperties().getString( "Perspective_LdapBrowserPerspective_id" ) //$NON-NLS-1$ .equalsIgnoreCase( perspective.getId() ) ) { return perspective; Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/DeleteAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/DeleteAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/DeleteAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/DeleteAction.java Fri Nov 28 00:02:31 2008 @@ -50,8 +50,6 @@ */ public class DeleteAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "&Delete"; - /** The associated view */ private ServersView view; @@ -61,7 +59,7 @@ */ public DeleteAction() { - super( ACTION_TEXT ); + super( Messages.getString( "DeleteAction.Delete" ) ); //$NON-NLS-1$ init(); } @@ -74,7 +72,7 @@ */ public DeleteAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "DeleteAction.Delete" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -87,7 +85,7 @@ { setId( ApacheDsPluginConstants.CMD_DELETE ); setActionDefinitionId( ApacheDsPluginConstants.CMD_DELETE ); - setToolTipText( "Delete" ); + setToolTipText( Messages.getString( "DeleteAction.DeleteToolTip" ) ); //$NON-NLS-1$ setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor( ISharedImages.IMG_TOOL_DELETE ) ); } @@ -132,7 +130,7 @@ } catch ( DebugException e ) { - ApacheDsPluginUtils.reportError( "An error occurred when stopping the server.\n\n" + ApacheDsPluginUtils.reportError( Messages.getString( "DeleteAction.ErrorWhileStopping" ) //$NON-NLS-1$ + e.getMessage() ); } } Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java?rev=721374&view=auto ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java (added) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java Fri Nov 28 00:02:31 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.apacheds.actions; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + + +public class Messages +{ + private static final String BUNDLE_NAME = "org.apache.directory.studio.apacheds.actions.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + + private Messages() + { + } + + + public static String getString( String key ) + { + try + { + return RESOURCE_BUNDLE.getString( key ); + } + catch ( MissingResourceException e ) + { + return '!' + key + '!'; + } + } +} Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/Messages.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/NewServerAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/NewServerAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/NewServerAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/NewServerAction.java Fri Nov 28 00:02:31 2008 @@ -46,10 +46,10 @@ */ public NewServerAction() { - super( "New &Server" ); + super( Messages.getString( "NewServerAction.NewServer" ) ); //$NON-NLS-1$ setId( ApacheDsPluginConstants.CMD_NEW_SERVER ); setActionDefinitionId( ApacheDsPluginConstants.CMD_NEW_SERVER ); - setToolTipText( "New Server" ); + setToolTipText( Messages.getString( "NewServerAction.NewServerToolTip" ) ); //$NON-NLS-1$ setImageDescriptor( ApacheDsPlugin.getDefault().getImageDescriptor( ApacheDsPluginConstants.IMG_SERVER_NEW ) ); } Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/OpenConfigurationAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/OpenConfigurationAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/OpenConfigurationAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/OpenConfigurationAction.java Fri Nov 28 00:02:31 2008 @@ -49,8 +49,6 @@ */ public class OpenConfigurationAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "&Open Configuration"; - /** The associated view */ private ServersView view; @@ -60,7 +58,7 @@ */ public OpenConfigurationAction() { - super( ACTION_TEXT ); + super( Messages.getString( "OpenConfigurationAction.OpenConfiguration" ) ); //$NON-NLS-1$ init(); } @@ -73,7 +71,7 @@ */ public OpenConfigurationAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "OpenConfigurationAction.OpenConfiguration" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -86,7 +84,7 @@ { setId( ApacheDsPluginConstants.CMD_OPEN_CONFIGURATION ); setActionDefinitionId( ApacheDsPluginConstants.CMD_OPEN_CONFIGURATION ); - setToolTipText( "Open Configuration" ); + setToolTipText( Messages.getString( "OpenConfigurationAction.OpenConfigurationToolTip" ) ); //$NON-NLS-1$ } @@ -107,16 +105,15 @@ // Opening the editor IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); PathEditorInput input = new PathEditorInput( ApacheDsPluginUtils.getApacheDsServersFolder().append( - server.getId() ).append( "conf" ).append( "server.xml" ) ); + server.getId() ).append( "conf" ).append( "server.xml" ) ); //$NON-NLS-1$ //$NON-NLS-2$ try { page.openEditor( input, ServerConfigurationEditor.ID ); } catch ( PartInitException e ) { - ApacheDsPluginUtils - .reportError( "An error occurred when opening the Apache DS Configuration Editor.\n\n" - + e.getMessage() ); + ApacheDsPluginUtils.reportError( Messages.getString( "OpenConfigurationAction.ErrorWhenOpening" ) //$NON-NLS-1$ + + e.getMessage() ); } } } Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/PropertiesAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/PropertiesAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/PropertiesAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/PropertiesAction.java Fri Nov 28 00:02:31 2008 @@ -41,8 +41,6 @@ */ public class PropertiesAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "&Properties"; - /** The associated view */ private ServersView view; @@ -52,7 +50,7 @@ */ public PropertiesAction() { - super( ACTION_TEXT ); + super( Messages.getString( "PropertiesAction.Properties" ) ); //$NON-NLS-1$ init(); } @@ -65,7 +63,7 @@ */ public PropertiesAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "PropertiesAction.Properties" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -78,7 +76,7 @@ { setId( ApacheDsPluginConstants.CMD_PROPERTIES ); setActionDefinitionId( ApacheDsPluginConstants.CMD_PROPERTIES ); - setToolTipText( "Properties" ); + setToolTipText( Messages.getString( "PropertiesAction.PropertiesToolTip" ) ); //$NON-NLS-1$ } @@ -95,7 +93,8 @@ Server server = ( Server ) selection.getFirstElement(); PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( view.getViewSite().getShell(), server, ApacheDsPluginConstants.PROP_SERVER_PROPERTY_PAGE, null, null ); - dialog.getShell().setText( "Properties for '" + shorten( server.getName(), 30 ) + "'" ); + dialog.getShell().setText( + Messages.getString( "PropertiesAction.PropertiesFor" ) + shorten( server.getName(), 30 ) + "'" ); //$NON-NLS-1$ //$NON-NLS-2$ dialog.open(); } } @@ -121,11 +120,11 @@ // shorten label if ( maxLength < 3 ) { - return "..."; + return "..."; //$NON-NLS-1$ } if ( label.length() > maxLength ) { - label = label.substring( 0, maxLength / 2 ) + "..." + label = label.substring( 0, maxLength / 2 ) + "..." //$NON-NLS-1$ + label.substring( label.length() - maxLength / 2, label.length() ); } Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RenameAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RenameAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RenameAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RenameAction.java Fri Nov 28 00:02:31 2008 @@ -64,8 +64,6 @@ */ public class RenameAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "R&ename..."; - /** The associated view */ private ServersView view; private Tree tree; @@ -84,7 +82,7 @@ */ public RenameAction() { - super( ACTION_TEXT ); + super( Messages.getString( "RenameAction.Rename" ) ); //$NON-NLS-1$ init(); } @@ -97,7 +95,7 @@ */ public RenameAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "RenameAction.Rename" ) ); //$NON-NLS-1$ this.view = view; this.tree = view.getViewer().getTree(); this.treeEditor = new TreeEditor( tree ); @@ -112,7 +110,7 @@ { setId( ApacheDsPluginConstants.CMD_RENAME ); setActionDefinitionId( ApacheDsPluginConstants.CMD_RENAME ); - setToolTipText( "Rename..." ); + setToolTipText( Messages.getString( "RenameAction.RenameToolTip" ) ); //$NON-NLS-1$ } @@ -303,8 +301,8 @@ { if ( !ServersHandler.getDefault().isNameAvailable( newName ) ) { - MessageDialog.openError( tree.getShell(), "Server", - "The name is already in use. Specify a different name." ); + MessageDialog.openError( tree.getShell(), Messages.getString( "RenameAction.Server" ), //$NON-NLS-1$ + Messages.getString( "RenameAction.ErrorNameInUse" ) ); //$NON-NLS-1$ } else { Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RunAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RunAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RunAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/RunAction.java Fri Nov 28 00:02:31 2008 @@ -41,6 +41,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; @@ -53,8 +54,6 @@ */ public class RunAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "&Run"; - /** The associated view */ private ServersView view; @@ -64,7 +63,7 @@ */ public RunAction() { - super( ACTION_TEXT ); + super( Messages.getString( "RunAction.Run" ) ); //$NON-NLS-1$ init(); } @@ -77,7 +76,7 @@ */ public RunAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "RunAction.Run" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -90,7 +89,7 @@ { setId( ApacheDsPluginConstants.CMD_RUN ); setActionDefinitionId( ApacheDsPluginConstants.CMD_RUN ); - setToolTipText( "Run" ); + setToolTipText( Messages.getString( "RunAction.RunToolTip" ) ); //$NON-NLS-1$ setImageDescriptor( ApacheDsPlugin.getDefault().getImageDescriptor( ApacheDsPluginConstants.IMG_RUN ) ); } @@ -142,22 +141,23 @@ if ( alreadyInUseProtocolPortsList.length == 1 ) { - title = "Port already in use"; - message = "The port of the protocol " + alreadyInUseProtocolPortsList[0] - + " is already in use."; + title = Messages.getString( "RunAction.PortInUse" ); //$NON-NLS-1$ + message = NLS + .bind( + Messages.getString( "RunAction.PortOfProtocolInUse" ), new String[] { alreadyInUseProtocolPortsList[0] } ); //$NON-NLS-1$ } else { - title = "Ports already in use"; - message = "The ports of the following protocols are already in use:"; + title = Messages.getString( "RunAction.PortsInUse" ); //$NON-NLS-1$ + message = Messages.getString( "RunAction.PortsOfProtocolsInUse" ); //$NON-NLS-1$ for ( String alreadyInUseProtocolPort : alreadyInUseProtocolPortsList ) { - message += ApacheDsPluginUtils.LINE_SEPARATOR + " - " + alreadyInUseProtocolPort; + message += ApacheDsPluginUtils.LINE_SEPARATOR + " - " + alreadyInUseProtocolPort; //$NON-NLS-1$ } } message += ApacheDsPluginUtils.LINE_SEPARATOR + ApacheDsPluginUtils.LINE_SEPARATOR - + "Do you wish to continue?"; + + Messages.getString( "RunAction.Continue" ); //$NON-NLS-1$ MessageDialog dialog = new MessageDialog( view.getSite().getShell(), title, null, message, MessageDialog.WARNING, new String[] @@ -195,15 +195,17 @@ if ( errorMessage == null ) { - message = "Unable to read the server configuration."; + message = Messages.getString( "RunAction.UnableReadServerConfiguration" ); //$NON-NLS-1$ } else { - message = "Unable to read the server configuration." + ApacheDsPluginUtils.LINE_SEPARATOR - + ApacheDsPluginUtils.LINE_SEPARATOR + "The following error occurred: " + errorMessage; + message = Messages.getString( "RunAction.UnableReadServerConfiguration" ) + ApacheDsPluginUtils.LINE_SEPARATOR //$NON-NLS-1$ + + ApacheDsPluginUtils.LINE_SEPARATOR + + Messages.getString( "RunAction.FollowingErrorOccurred" ) + errorMessage; //$NON-NLS-1$ } - MessageDialog dialog = new MessageDialog( view.getSite().getShell(), "Unable to read the server configuration", + MessageDialog dialog = new MessageDialog( view.getSite().getShell(), Messages + .getString( "RunAction.UnableReadServerConfiguration" ), //$NON-NLS-1$ null, message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, MessageDialog.OK ); dialog.open(); @@ -258,7 +260,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getLdapPort() ) ) { - alreadyInUseProtocolPortsList.add( "LDAP (port " + serverConfiguration.getLdapPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.LDAPPort" ), new Object[] { serverConfiguration.getLdapPort() } ) ); //$NON-NLS-1$ } } @@ -267,7 +270,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getLdapsPort() ) ) { - alreadyInUseProtocolPortsList.add( "LDAPS (port " + serverConfiguration.getLdapsPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.LDAPSPort" ), new Object[] { serverConfiguration.getLdapsPort() } ) ); //$NON-NLS-1$ } } @@ -276,7 +280,10 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getKerberosPort() ) ) { - alreadyInUseProtocolPortsList.add( "Kerberos (port " + serverConfiguration.getKerberosPort() + ")" ); + alreadyInUseProtocolPortsList + .add( NLS + .bind( + Messages.getString( "RunAction.KerberosPort" ), new Object[] { serverConfiguration.getKerberosPort() } ) ); //$NON-NLS-1$ } } @@ -285,7 +292,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getDnsPort() ) ) { - alreadyInUseProtocolPortsList.add( "DNS (port " + serverConfiguration.getDnsPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.DNSPort" ), new Object[] { serverConfiguration.getDnsPort() } ) ); //$NON-NLS-1$ } } @@ -294,7 +302,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getNtpPort() ) ) { - alreadyInUseProtocolPortsList.add( "NTP (port " + serverConfiguration.getNtpPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.NTPPort" ), new Object[] { serverConfiguration.getNtpPort() } ) ); //$NON-NLS-1$ } } @@ -303,8 +312,10 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getChangePasswordPort() ) ) { - alreadyInUseProtocolPortsList.add( "ChangePassword (port " - + serverConfiguration.getChangePasswordPort() + ")" ); + alreadyInUseProtocolPortsList + .add( NLS + .bind( + Messages.getString( "RunAction.ChangePasswordPort" ), new Object[] { serverConfiguration.getChangePasswordPort() } ) ); //$NON-NLS-1$ } } @@ -331,7 +342,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getLdapPort() ) ) { - alreadyInUseProtocolPortsList.add( "LDAP (port " + serverConfiguration.getLdapPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.LDAPPort" ), new Object[] { serverConfiguration.getLdapPort() } ) ); //$NON-NLS-1$ } } @@ -340,7 +352,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getLdapsPort() ) ) { - alreadyInUseProtocolPortsList.add( "LDAPS (port " + serverConfiguration.getLdapsPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.LDAPSPort" ), new Object[] { serverConfiguration.getLdapsPort() } ) ); //$NON-NLS-1$ } } @@ -349,7 +362,10 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getKerberosPort() ) ) { - alreadyInUseProtocolPortsList.add( "Kerberos (port " + serverConfiguration.getKerberosPort() + ")" ); + alreadyInUseProtocolPortsList + .add( NLS + .bind( + Messages.getString( "RunAction.KerberosPort" ), new Object[] { serverConfiguration.getKerberosPort() } ) ); //$NON-NLS-1$ } } @@ -358,7 +374,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getDnsPort() ) ) { - alreadyInUseProtocolPortsList.add( "DNS (port " + serverConfiguration.getDnsPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( + Messages.getString( "RunAction.DNSPort" ), new Object[] { serverConfiguration.getDnsPort() } ) ); //$NON-NLS-1$ } } @@ -367,7 +384,8 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getNtpPort() ) ) { - alreadyInUseProtocolPortsList.add( "NTP (port " + serverConfiguration.getNtpPort() + ")" ); + alreadyInUseProtocolPortsList.add( NLS.bind( Messages.getString( "RunAction.NTPPort" ), new Object[] + { serverConfiguration.getNtpPort() } ) ); } } @@ -376,8 +394,10 @@ { if ( !AvailablePortFinder.available( serverConfiguration.getChangePasswordPort() ) ) { - alreadyInUseProtocolPortsList.add( "ChangePassword (port " - + serverConfiguration.getChangePasswordPort() + ")" ); + alreadyInUseProtocolPortsList + .add( NLS + .bind( + Messages.getString( "RunAction.ChangePasswordPort" ), new Object[] { serverConfiguration.getChangePasswordPort() } ) ); //$NON-NLS-1$ } } Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/StopAction.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/StopAction.java?rev=721374&r1=721373&r2=721374&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/StopAction.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/StopAction.java Fri Nov 28 00:02:31 2008 @@ -50,8 +50,6 @@ */ public class StopAction extends Action implements IWorkbenchWindowActionDelegate { - private static final String ACTION_TEXT = "S&top"; - /** The associated view */ private ServersView view; @@ -64,7 +62,7 @@ */ public StopAction() { - super( ACTION_TEXT ); + super( Messages.getString( "StopAction.Stop" ) ); //$NON-NLS-1$ init(); } @@ -77,7 +75,7 @@ */ public StopAction( ServersView view ) { - super( ACTION_TEXT ); + super( Messages.getString( "StopAction.Stop" ) ); //$NON-NLS-1$ this.view = view; init(); } @@ -90,7 +88,7 @@ { setId( ApacheDsPluginConstants.CMD_STOP ); setActionDefinitionId( ApacheDsPluginConstants.CMD_STOP ); - setToolTipText( "Stop" ); + setToolTipText( Messages.getString( "StopAction.StopToolTip" ) ); //$NON-NLS-1$ setImageDescriptor( ApacheDsPlugin.getDefault().getImageDescriptor( ApacheDsPluginConstants.IMG_STOP ) ); } @@ -124,11 +122,11 @@ try { launch.terminate(); - writeToInfoConsoleMessageStream( "Server stopped.\n" ); + writeToInfoConsoleMessageStream( Messages.getString( "StopAction.ServerStopped" ) ); //$NON-NLS-1$ } catch ( DebugException e ) { - ApacheDsPluginUtils.reportError( "An error occurred when stopping the server.\n\n" + ApacheDsPluginUtils.reportError( Messages.getString( "StopAction.ErrorWhenStopping" ) //$NON-NLS-1$ + e.getMessage() ); } } @@ -157,9 +155,8 @@ } catch ( IOException e ) { - ApacheDsPluginUtils - .reportError( "An error occurred when writing to the Info console message stream.\n\n" - + e.getMessage() ); + ApacheDsPluginUtils.reportError( Messages.getString( "StopAction.ErrorWhenWriting" ) //$NON-NLS-1$ + + e.getMessage() ); } } } ); Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties?rev=721374&view=auto ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties (added) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties Fri Nov 28 00:02:31 2008 @@ -0,0 +1,61 @@ +# 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. + +CreateConnectionAction.CreateAConnection=Create a Connection +CreateConnectionAction.FollowingErrorOccurred=The following error occurred\: +CreateConnectionAction.LDAPAndLDAPSDisabled=LDAP and LDAPS protocols are disabled. A connection cannot be created. +CreateConnectionAction.StopToolTip=Stop +CreateConnectionAction.UnableCreateConnection=Unable to create a connection +CreateConnectionAction.UnableReadServerConfiguration=Unable to read the server configuration. +CreateConnectionActionHelper.ConnectionCalledCreated=A connection called "{0}" has been created. +CreateConnectionActionHelper.ConnectionCalledCreatedSwitch=A connection called "{0}" has been created.\n\nDo you want to switch to the LDAP perspective ? +CreateConnectionActionHelper.ConnectionCreated=Connection created +DeleteAction.Delete=&Delete +DeleteAction.DeleteToolTip=Delete +DeleteAction.ErrorWhileStopping=An error occurred when stopping the server.\n\n +NewServerAction.NewServer=New &Server +NewServerAction.NewServerToolTip=New Server +OpenConfigurationAction.ErrorWhenOpening=An error occurred when opening the Apache DS Configuration Editor.\n\n +OpenConfigurationAction.OpenConfiguration=&Open Configuration +OpenConfigurationAction.OpenConfigurationToolTip=Open Configuration +PropertiesAction.Properties=&Properties +PropertiesAction.PropertiesFor=Properties for "{0}" +PropertiesAction.PropertiesToolTip=Properties +RenameAction.ErrorNameInUse=The name is already in use. Specify a different name. +RenameAction.Rename=R&ename... +RenameAction.RenameToolTip=Rename... +RenameAction.Server=Server +RunAction.ChangePasswordPort=ChangePassword (port {0}) +RunAction.Continue=Do you wish to continue? +RunAction.DNSPort=DNS (port {0}) +RunAction.FollowingErrorOccurred=The following error occurred\: +RunAction.KerberosPort=Kerberos (port {0}) +RunAction.LDAPPort=LDAP (port {0}) +RunAction.LDAPSPort=LDAPS (port {0}) +RunAction.NTPPort=NTP (port {0}) +RunAction.PortInUse=Port already in use +RunAction.PortOfProtocolInUse=The port of the protocol {0} is already in use. +RunAction.PortsInUse=Ports already in use +RunAction.PortsOfProtocolsInUse=The ports of the following protocols are already in use: +RunAction.Run=&Run +RunAction.RunToolTip=Run +RunAction.UnableReadServerConfiguration=Unable to read the server configuration. +StopAction.ErrorWhenStopping=An error occurred when stopping the server.\n\n +StopAction.ErrorWhenWriting=An error occurred when writing to the Info console message stream.\n\n +StopAction.ServerStopped=Server stopped.\n +StopAction.Stop=S&top +StopAction.StopToolTip=Stop Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/actions/messages.properties ------------------------------------------------------------------------------ svn:keywords = Id