From b11a8658051a0ca2cdc6f6628ead355fb0c798ad Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 20 Feb 2008 21:25:04 +0000 Subject: [PATCH] [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible -this is phase 1...still need to get rid of duplicate messages --- .../dstore/DStoreConnectorService.java | 173 +++++++++++------ .../dstore/util/ConnectionStatusListener.java | 50 +++-- .../connectorservice/dstore/Activator.java | 3 + .../dstore/ConnectorServiceResources.java | 59 +++++- .../ConnectorServiceResources.properties | 72 ++++++- .../dstore/RexecDstoreServer.java | 28 +-- .../ssh/SshConnectorResources.java | 6 + .../ssh/SshConnectorResources.properties | 9 + .../ssh/SshConnectorService.java | 21 ++- .../telnet/TelnetConnectorResources.java | 9 + .../TelnetConnectorResources.properties | 13 ++ .../telnet/TelnetConnectorService.java | 33 ++-- .../org/eclipse/rse/core/RSECorePlugin.java | 2 + .../resources/SystemEditableRemoteFile.java | 44 +++-- .../ui/resources/SystemTempFileListener.java | 17 +- .../UniversalFileTransferUtility.java | 51 ++--- .../rse/files/ui/widgets/SaveAsForm.java | 13 +- .../SystemFileFilterStringEditPane.java | 16 +- .../SystemQualifiedRemoteFolderCombo.java | 30 ++- .../widgets/SystemSelectRemoteFilesForm.java | 12 +- .../rse/internal/files/ui/Activator.java | 3 + .../rse/internal/files/ui/FileResources.java | 133 +++++++++++++ .../files/ui/FileResources.properties | 177 ++++++++++++++++-- .../actions/SystemCopyRemoteFileAction.java | 12 +- .../actions/SystemMoveRemoteFileAction.java | 48 +++-- .../actions/SystemUploadConflictAction.java | 15 +- .../SystemCachePreferencePage.java | 12 +- .../propertypages/SystemFilePropertyPage.java | 15 +- .../files/ui/search/SystemSearchPage.java | 23 ++- .../ui/view/SystemViewRemoteFileAdapter.java | 97 +++++++--- ...ystemViewRemoteSearchResultSetAdapter.java | 19 +- .../files/ui/wizards/SystemNewFileWizard.java | 31 ++- .../ui/wizards/SystemNewFolderWizard.java | 29 ++- .../RemoteImportExportResources.java | 49 ++++- .../RemoteImportExportResources.properties | 58 +++++- .../files/RemoteExportWizardPage1.java | 54 ++++-- .../files/RemoteFileExportActionDelegate.java | 11 +- .../files/RemoteFileExportOperation.java | 11 +- .../files/RemoteFileImportActionDelegate.java | 9 +- .../files/RemoteFileImportOperation.java | 6 +- .../files/RemoteImportWizardPage1.java | 37 ++-- .../importexport/files/Utilities.java | 34 ++-- .../processes/ui/ProcessesPlugin.java | 4 + .../ui/SystemProcessesResources.java | 9 +- .../ui/SystemProcessesResources.properties | 10 +- .../ui/actions/SystemKillProcessAction.java | 14 +- .../view/SystemViewRemoteProcessAdapter.java | 9 +- .../ui/SystemProcessFilterStringEditPane.java | 9 +- .../services/files/ftp/FTPService.java | 13 +- .../services/ssh/files/SftpFileService.java | 8 +- .../messages/SimpleSystemMessage.java | 107 +++++++++++ .../clientserver/messages/SystemMessage.java | 84 +++------ .../messages/SystemMessageException.java | 11 +- .../files/RemoteFileCancelledException.java | 8 +- .../services/files/RemoteFileIOException.java | 9 +- .../files/RemoteFileSecurityException.java | 9 +- .../files/RemoteFolderNotEmptyException.java | 9 +- .../internal/shells/ui/ShellResources.java | 6 + .../shells/ui/ShellResources.properties | 7 + .../ui/actions/SystemCommandAction.java | 8 +- .../shells/ui/view/CommandsViewPage.java | 16 +- .../subsystems/files/core/Activator.java | 3 + .../files/core/SystemFileResources.java | 28 ++- .../files/core/SystemFileResources.properties | 37 +++- .../FileServiceSubSystem.java | 23 ++- .../core/subsystems/RemoteFileSubSystem.java | 12 +- .../core/util/ValidatorFileFilterString.java | 13 +- .../core/util/ValidatorFileUniqueName.java | 17 +- .../subsystems/shells/core/ShellStrings.java | 5 + .../shells/core/ShellStrings.properties | 6 +- .../core/subsystems/RemoteCmdSubSystem.java | 48 +++-- .../rse/internal/ui/GenericMessages.java | 8 +- .../internal/ui/GenericMessages.properties | 7 +- .../rse/ui/messages/SystemMessageDialog.java | 23 ++- .../rse/core/subsystems/SubSystem.java | 68 +++++-- .../subsystems/SubSystemConfiguration.java | 33 ++-- .../ui/subsystems/SubSystemResources.java | 64 +++++++ .../subsystems/SubSystemResources.properties | 53 ++++++ 78 files changed, 1782 insertions(+), 560 deletions(-) create mode 100644 rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java create mode 100644 rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.java create mode 100644 rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.properties diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java index 066bbeefa6d..4cdf8527afe 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java @@ -22,6 +22,7 @@ * David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect() * David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup * David McKnight (IBM) - [216596] dstore preferences (timeout, and others) + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.connectorservice.dstore; @@ -37,6 +38,7 @@ import javax.net.ssl.SSLHandshakeException; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.dstore.core.client.ClientConnection; import org.eclipse.dstore.core.client.ConnectionStatus; @@ -51,6 +53,7 @@ import org.eclipse.dstore.core.model.ISSLProperties; import org.eclipse.dstore.internal.core.client.ClientSSLProperties; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory; @@ -67,11 +70,13 @@ import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ServerLaunchType; import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; +import org.eclipse.rse.internal.connectorservice.dstore.Activator; +import org.eclipse.rse.internal.connectorservice.dstore.ConnectorServiceResources; import org.eclipse.rse.internal.connectorservice.dstore.RexecDstoreServer; import org.eclipse.rse.internal.ui.SystemPropertyResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemPreferencesConstants; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; @@ -356,6 +361,7 @@ public class DStoreConnectorService extends StandardConnectorService implements // Fire comm event to signal state changed notifyDisconnection(); + clientConnection = null; // DKM - no need to clear uid cache clearPassword(false, true); // clear in-memory password @@ -503,7 +509,7 @@ public class DStoreConnectorService extends StandardConnectorService implements /** * @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor) */ - protected void internalConnect(IProgressMonitor monitor) throws Exception + protected synchronized void internalConnect(IProgressMonitor monitor) throws Exception { if (isConnected()) { return; @@ -550,8 +556,8 @@ public class DStoreConnectorService extends StandardConnectorService implements { if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_STARTING_SERVER_VIA_REXEC); - monitor.subTask(cmsg.getLevelOneText()); + String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_REXEC; + monitor.subTask(cmsg); } SystemSignonInformation info = getSignonInformation(); @@ -572,9 +578,8 @@ public class DStoreConnectorService extends StandardConnectorService implements if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); - cmsg.makeSubstitution(clientConnection.getPort()); - monitor.subTask(cmsg.getLevelOneText()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); + monitor.subTask(cmsg); } // connect to launched server @@ -600,7 +605,7 @@ public class DStoreConnectorService extends StandardConnectorService implements String errorMsg = null; if (msg == null) { - errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED).getLevelOneText(); + errorMsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); } else { @@ -614,8 +619,8 @@ public class DStoreConnectorService extends StandardConnectorService implements { if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_STARTING_SERVER_VIA_DAEMON); - monitor.subTask(cmsg.getLevelOneText()); + String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_DAEMON; + monitor.subTask(cmsg); } // DY: getLocalUserId() may return null for Windows connections because @@ -686,8 +691,19 @@ public class DStoreConnectorService extends StandardConnectorService implements SystemSignonInformation newCredentials = null; while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) { - String messageId = isPasswordExpired(launchMsg) ? ISystemMessages.MSG_VALIDATE_PASSWORD_EXPIRED : ISystemMessages.MSG_VALIDATE_PASSWORD_INVALID; - SystemMessage message = RSEUIPlugin.getPluginMessage(messageId); + String pmsg = null; + String pmsgDetails = null; + boolean expired = isPasswordExpired(launchMsg); + if (expired){ + pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED; + pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS; + } + else { + pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID; + pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS; + } + + SystemMessage message = createSystemMessage(IStatus.ERROR, pmsg, pmsgDetails); getCredentialsProvider().repairCredentials(message); newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); @@ -707,12 +723,14 @@ public class DStoreConnectorService extends StandardConnectorService implements { launchFailed = true; - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_PORT_OUT_RANGE); + int colonIndex = launchMsg.indexOf(':'); String portRange = launchMsg.substring(colonIndex + 1); - cmsg.makeSubstitution(portRange); - ShowConnectMessage msgAction = new ShowConnectMessage(cmsg); + String pmsg =NLS.bind(ConnectorServiceResources.MSG_PORT_OUT_RANGE, portRange); + SystemMessage message = createSystemMessage(IStatus.ERROR, pmsg); + + ShowConnectMessage msgAction = new ShowConnectMessage(message); Display.getDefault().asyncExec(msgAction); return; } @@ -726,9 +744,11 @@ public class DStoreConnectorService extends StandardConnectorService implements { if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); - cmsg.makeSubstitution(clientConnection.getPort()); - monitor.subTask(cmsg.getLevelOneText()); + if (clientConnection == null){ + System.out.println("client connection is null!"); + } + String pmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); + monitor.subTask(pmsg); } // connect to launched server connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout); @@ -790,17 +810,17 @@ public class DStoreConnectorService extends StandardConnectorService implements else { connectStatus = new ConnectionStatus(false); - connectStatus.setMessage( - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED).getLevelOneText()); + + String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); + connectStatus.setMessage(cmsg); } } else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL) { if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); - cmsg.makeSubstitution(clientConnection.getPort()); - monitor.subTask(cmsg.getLevelOneText()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); + monitor.subTask(cmsg); } // connection directly boolean useSSL = isUsingSSL(); @@ -833,8 +853,9 @@ public class DStoreConnectorService extends StandardConnectorService implements IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); if (clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_SSL)) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_USING_SSL); - msg.makeSubstitution(getHostName()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_USING_SSL, getHostName()); + msg = createSystemMessage(IStatus.INFO, cmsg); + DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_SSL); Display.getDefault().syncExec(msgAction); if (msgAction.getReturnCode() != IDialogConstants.YES_ID) @@ -845,8 +866,9 @@ public class DStoreConnectorService extends StandardConnectorService implements } else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL)) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_NOT_USING_SSL); - msg.makeSubstitution(getHostName()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName()); + msg = createSystemMessage(IStatus.INFO, cmsg); + DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_NONSSL); Display.getDefault().syncExec(msgAction); if (msgAction.getReturnCode() != IDialogConstants.YES_ID) @@ -901,14 +923,18 @@ public class DStoreConnectorService extends StandardConnectorService implements { if (message.startsWith(ClientConnection.CLIENT_OLDER)) { + String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING, getHostName()); + String cmsgDetail = ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING_DETAILS; - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CLIENT_OLDER_WARNING); - msg.makeSubstitution(getHostName()); + msg = createSystemMessage(IStatus.WARNING, cmsg, cmsgDetail); + } else if (message.startsWith(ClientConnection.SERVER_OLDER)) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_SERVER_OLDER_WARNING); - msg.makeSubstitution(getHostName()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING, getHostName()); + String cmsgDetail = ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING_DETAILS; + + msg = createSystemMessage(IStatus.WARNING, cmsg, cmsgDetail); } if (store.getBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)){ @@ -933,16 +959,15 @@ public class DStoreConnectorService extends StandardConnectorService implements { dataStore.addMinersLocation("."); //$NON-NLS-1$ // older servers initialized in one shot - DataElement schemaStatus = dataStore.getSchema(); + dataStore.getSchema(); // Initialzie the miners if (monitor != null) { - SystemMessage imsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_INITIALIZING_SERVER); - monitor.subTask(imsg.getLevelOneText()); + String imsg = ConnectorServiceResources.MSG_INITIALIZING_SERVER; + monitor.subTask(imsg); } DataElement initStatus = dataStore.initMiners(); - //statusMonitor.waitForUpdate(schemaStatus); statusMonitor.waitForUpdate(initStatus); } //long t2 = System.currentTimeMillis(); @@ -972,9 +997,8 @@ public class DStoreConnectorService extends StandardConnectorService implements } else { - - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_SSL_EXCEPTION); - msg.makeSubstitution(launchStatus.getMessage()); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_SSL_EXCEPTION, launchStatus.getMessage()); + msg = createSystemMessage(IStatus.ERROR, cmsg); } } } @@ -986,8 +1010,9 @@ public class DStoreConnectorService extends StandardConnectorService implements if (launchStatus.getException() != null && serverLauncher != null) { Throwable exception = launchStatus.getException(); - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_DAEMON_FAILED_EXCEPTION); - msg.makeSubstitution(getHostName(), ""+serverLauncher.getDaemonPort(), exception); //$NON-NLS-1$ + String fmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED_EXCEPTION, getHostName(), ""+serverLauncher.getDaemonPort()); //$NON-NLS-1$ + + msg = createSystemMessage(IStatus.ERROR, fmsg, exception); } else if (launchMsg != null && launchMsg.indexOf(IDataStoreConstants.AUTHENTICATION_FAILED) != -1) { @@ -997,8 +1022,11 @@ public class DStoreConnectorService extends StandardConnectorService implements } // Display error message - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_AUTH_FAILED); - msg.makeSubstitution(getHostName()); + String msgTxt = ConnectorServiceResources.MSG_COMM_AUTH_FAILED; + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_AUTH_FAILED_DETAILS, getHostName()); + + msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); + DisplaySystemMessageAction msgAction = new DisplaySystemMessageAction(msg); Display.getDefault().syncExec(msgAction); @@ -1040,8 +1068,15 @@ public class DStoreConnectorService extends StandardConnectorService implements SystemSignonInformation newCredentials = null; while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) { - String messageId = isPasswordExpired(launchMsg) ? ISystemMessages.MSG_VALIDATE_PASSWORD_EXPIRED : ISystemMessages.MSG_VALIDATE_PASSWORD_INVALID; - SystemMessage message = RSEUIPlugin.getPluginMessage(messageId); + String msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID; + String msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS; + if (isPasswordExpired(launchMsg)){ + msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED; + msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS; + } + + SystemMessage message = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); + getCredentialsProvider().repairCredentials(message); newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); @@ -1071,8 +1106,8 @@ public class DStoreConnectorService extends StandardConnectorService implements } else if (launchMsg != null) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_DAEMON_FAILED); - msg.makeSubstitution(getHostName(), clientConnection.getPort(), launchMsg); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED, getHostName(), clientConnection.getPort()); + msg = createSystemMessage(IStatus.ERROR, msgTxt, launchMsg); } } @@ -1081,21 +1116,25 @@ public class DStoreConnectorService extends StandardConnectorService implements { if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_SERVER_UPDATE)) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INCOMPATIBLE_UPDATE); - msg.makeSubstitution(getHostName()); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE, getHostName()); + String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS; + + msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); } else if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_PROTOCOL)) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INCOMPATIBLE_PROTOCOL); - msg.makeSubstitution(getHostName()); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL, getHostName()); + String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS; + + msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); } else { Throwable exception = connectStatus.getException(); if (exception != null) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED); - msg.makeSubstitution(getHostName(), exception); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_CONNECT_FAILED, getHostName()); + msg = createSystemMessage(IStatus.ERROR, msgTxt, exception); } } } @@ -1104,23 +1143,25 @@ public class DStoreConnectorService extends StandardConnectorService implements else if (connectStatus == null) { SystemBasePlugin.logError("Failed to connect to remote system", null); //$NON-NLS-1$ - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED); - msg.makeSubstitution(getHostName()); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName()); + msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); } // if, for some reason, we don't have a message if (msg == null && connectStatus != null) { SystemBasePlugin.logError("Failed to connect to remote system" + connectStatus.getMessage(), null); //$NON-NLS-1$ - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED); - msg.makeSubstitution(getHostName()); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName()); + msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); } clientConnection.disconnect(); clientConnection = null; // yantzi: artemis 6.0, check for invalid login (user ID / pwd) and reprompt for signon information - if (msg != null && msg.getFullMessageID().startsWith(ISystemMessages.MSG_COMM_INVALID_LOGIN)) + if (msg != null && msg.getLevelOneText().startsWith(NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, getHostName()))) { if (launchFailed) { @@ -1211,7 +1252,7 @@ public class DStoreConnectorService extends StandardConnectorService implements String serverPort = (String)starter.launch(monitor); if (monitor.isCanceled()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED); + SystemMessage msg = createSystemMessage(IStatus.CANCEL, ConnectorServiceResources.MSG_OPERATION_CANCELLED); throw new SystemMessageException(msg); } @@ -1329,8 +1370,7 @@ public class DStoreConnectorService extends StandardConnectorService implements { for (int idx = 0; idx < warnings.size(); idx++) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_W); - msg.makeSubstitution((warnings.elementAt(idx)).toString()); + SystemMessage msg = createSystemMessage(IStatus.WARNING, warnings.elementAt(idx).toString()); SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); msgDlg.open(); } @@ -1384,4 +1424,17 @@ public class DStoreConnectorService extends StandardConnectorService implements return result; } + + protected SystemMessage createSystemMessage(int severity, String msg) { + return createSystemMessage(severity, msg, (String)null); + } + + protected SystemMessage createSystemMessage(int severity, String msg, Throwable e) { + return new SimpleSystemMessage(Activator.PLUGIN_ID, severity, msg, e); + } + + protected SystemMessage createSystemMessage(int severity, String msg, String msgDetails) { + return new SimpleSystemMessage(Activator.PLUGIN_ID, severity, msg, msgDetails); + } } + diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java index d527ebb4371..58d54dbfe74 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java @@ -12,25 +12,33 @@ * * Contributors: * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * David McKnight (IBM) - [216252] SystemMessages using RSEStatus + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.connectorservice.dstore.util; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.extra.DomainEvent; import org.eclipse.dstore.extra.IDomainListener; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; +import org.eclipse.rse.internal.connectorservice.dstore.Activator; +import org.eclipse.rse.internal.connectorservice.dstore.ConnectorServiceResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -113,10 +121,13 @@ public class ConnectionStatusListener implements IDomainListener, IRunnableWithP { Shell shell = getShell(); _connectionDown = true; - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_UNKNOWNHOST); - msg.makeSubstitution(_connection.getPrimarySubSystem().getHost().getAliasName()); + + String fmsgStr = NLS.bind(ConnectorServiceResources.MSG_CONNECT_UNKNOWNHOST, _connection.getPrimarySubSystem().getHost().getAliasName()); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, fmsgStr); SystemMessageDialog dialog = new SystemMessageDialog(internalGetShell(), msg); dialog.open(); + try { IRunnableContext runnableContext = getRunnableContext(getShell()); @@ -245,14 +256,23 @@ public class ConnectionStatusListener implements IDomainListener, IRunnableWithP */ protected void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc) { - //SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR,shell,RSEUIPlugin.getResourceBundle(), - // ISystemMessages.MSG_DISCONNECT_FAILED, - // hostName, exc.getMessage()); - //RSEUIPlugin.logError("Disconnect failed",exc); // temporary - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_FAILED).makeSubstitution(hostName,exc)); - msgDlg.setException(exc); - msgDlg.open(); + String dfailedMsg = NLS.bind(ConnectorServiceResources.MSG_DISCONNECT_FAILED, hostName); + + StringWriter excWriter = new StringWriter(); + exc.printStackTrace(new PrintWriter(excWriter)); + String dmsg = exc.toString(); + if ((dmsg == null) || (exc instanceof ClassCastException)) dmsg = exc.getClass().getName(); + String details = dmsg + "\n" + excWriter.toString(); //$NON-NLS-1$ + + try{ + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, dfailedMsg, details); + + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); + msgDlg.setException(exc); + msgDlg.open(); + } + catch (Exception e){ + } } /** * Show an error message when the user cancels the disconnection. @@ -261,10 +281,8 @@ public class ConnectionStatusListener implements IDomainListener, IRunnableWithP */ protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port) { - //SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell, RSEUIPlugin.getResourceBundle(), - // ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName); - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_CANCELLED).makeSubstitution(hostName)); - msgDlg.open(); + String msg = NLS.bind(ConnectorServiceResources.MSG_DISCONNECT_CANCELLED, hostName); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, msg)); + msgDlg.open(); } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java index 611be049fdd..86141917ac3 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.connectorservice.dstore; @@ -32,6 +33,8 @@ public class Activator extends SystemBasePlugin { //The shared instance. private static Activator plugin; + public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$ + /** * The constructor. */ diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java index ef1a438695e..e098826e63a 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.dstore; @@ -26,6 +26,63 @@ public class ConnectorServiceResources extends NLS public static String DStore_ConnectorService_Label; public static String DStore_ConnectorService_Description; + public static String MSG_CONNECT_UNKNOWNHOST; + + public static String MSG_DISCONNECT_FAILED; + public static String MSG_DISCONNECT_CANCELLED; + + public static String MSG_CONNECT_SSL_EXCEPTION; + public static String MSG_CONNECT_SSL_EXCEPTION_DETAILS; + public static String MSG_STARTING_SERVER_VIA_REXEC; + public static String MSG_STARTING_SERVER_VIA_DAEMON; + + public static String MSG_CONNECTING_TO_SERVER; + public static String MSG_INITIALIZING_SERVER; + public static String MSG_PORT_OUT_RANGE; + + public static String MSG_COMM_CONNECT_FAILED; + public static String MSG_COMM_CONNECT_FAILED_DETAILS; + + public static String MSG_VALIDATE_PASSWORD_EMPTY; + public static String MSG_VALIDATE_PASSWORD_EXPIRED; + public static String MSG_VALIDATE_PASSWORD_INVALID; + + public static String MSG_VALIDATE_PASSWORD_EMPTY_DETAILS; + public static String MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS; + public static String MSG_VALIDATE_PASSWORD_INVALID_DETAILS; + + public static String MSG_COMM_USING_SSL; + public static String MSG_COMM_NOT_USING_SSL; + + public static String MSG_COMM_SERVER_OLDER_WARNING; + public static String MSG_COMM_CLIENT_OLDER_WARNING; + public static String MSG_COMM_SERVER_OLDER_WARNING_DETAILS; + public static String MSG_COMM_CLIENT_OLDER_WARNING_DETAILS; + + public static String MSG_CONNECT_DAEMON_FAILED; + public static String MSG_CONNECT_DAEMON_FAILED_EXCEPTION; + + public static String MSG_COMM_AUTH_FAILED; + public static String MSG_COMM_PWD_INVALID; + public static String MSG_COMM_AUTH_FAILED_DETAILS; + public static String MSG_COMM_PWD_INVALID_DETAILS; + + public static String MSG_COMM_INCOMPATIBLE_PROTOCOL; + public static String MSG_COMM_INCOMPATIBLE_UPDATE; + public static String MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS; + public static String MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS; + + public static String MSG_CONNECT_FAILED; + + public static String MSG_OPERATION_CANCELLED; + + public static String MSG_COMM_INVALID_LOGIN; + public static String MSG_COMM_INVALID_LOGIN_DETAILS; + + + public static String MSG_COMM_REXEC_NOTSTARTED; + public static String MSG_COMM_REXEC_NOTSTARTED_DETAILS; + static { // load message values from bundle file NLS.initializeMessages(BUNDLE_NAME, ConnectorServiceResources.class); diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties index dc95e090a0e..3e83eff3801 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties @@ -12,7 +12,7 @@ # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # # Contributors: -# {Name} (company) - description of contribution. +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_NONE @@ -20,3 +20,73 @@ DStore_ConnectorService_Label=DStore Connector Service DStore_ConnectorService_Description=The DStore Connector Service uses RSE's DataStore protocol to connect to the host. You must have a DataStore daemon or server running on the remote machine. + +MSG_CONNECT_UNKNOWNHOST=Connect failed. Host {0} not found or not responding + +MSG_DISCONNECT_FAILED=Disconnect from {0} failed with exception + +MSG_DISCONNECT_CANCELLED=Disconnect from {0} was canceled + +MSG_COMM_CONNECT_FAILED=Connection to {0} could not be established. +MSG_COMM_CONNECT_FAILED_DETAILS=A socket connection to {0} could not be established. If you are connecting via the communications daemon make sure the daemon is running on the remote system. If you are connecting directly to the communications server make sure the server is started on the remote system. If you are connecting using REXEC, make sure that the server is installed on the remote system and that the REXEC service is running on that system. + + +MSG_CONNECT_SSL_EXCEPTION = Unable to establish a secure connection with the Remote System Explorer host server. +MSG_CONNECT_SSL_EXCEPTION_DETAILS = Make sure both the client and server are configured to use SSL. The SSL handshake between client and server failed with the following exception: {0} + +MSG_STARTING_SERVER_VIA_REXEC = Remote System Explorer host server using REXEC + +MSG_STARTING_SERVER_VIA_DAEMON = Starting Remote System Explorer host server using daemon + +MSG_CONNECTING_TO_SERVER= Connecting to Remote System Explorer host server on port {0} +MSG_INITIALIZING_SERVER= Initializing Remote System Explorer host server +MSG_PORT_OUT_RANGE = The specified server port is out of the allowed range: {0} + +MSG_VALIDATE_PASSWORD_EMPTY=Enter password +MSG_VALIDATE_PASSWORD_EMPTY_DETAILS=You must specify your password. + +MSG_VALIDATE_PASSWORD_EXPIRED=Password has expired +MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS=Your password has expired, and must be reset before continuing. + +MSG_VALIDATE_PASSWORD_INVALID=The new password is invalid. +MSG_VALIDATE_PASSWORD_INVALID_DETAILS=The remote system indicated that the new password is unacceptable. Please ensure the new password follows all password rules for the remote system. + +MSG_COMM_USING_SSL=Communication with the remote system {0} has been secured using SSL. Continue? +MSG_COMM_NOT_USING_SSL=Connection {0} has not been secured using SSL. Proceed anyway? + +MSG_COMM_SERVER_OLDER_WARNING=The host server running on remote system {0} is an older version than the RSE client. +MSG_COMM_SERVER_OLDER_WARNING_DETAILS=It is recommended that the client and server versions match. +MSG_COMM_CLIENT_OLDER_WARNING=The host server running on remote system {0} is a newer version than the RSE client. +MSG_COMM_CLIENT_OLDER_WARNING_DETAILS=It is recommended that the client and server versions match. + + +MSG_CONNECT_DAEMON_FAILED=Daemon failed to launch server on {0} using port {1} +MSG_CONNECT_DAEMON_FAILED_EXCEPTION=Failed to connect to the daemon on {0} using port %2 with an unexpected exception + +MSG_COMM_AUTH_FAILED=Invalid password or user ID +MSG_COMM_AUTH_FAILED_DETAILS=Authentication with {0} failed because the password or user ID is not correct. + +MSG_COMM_PWD_INVALID=The saved password is not correct. +MSG_COMM_PWD_INVALID_DETAILS=The saved password for user ID {0} on host {1} is not correct. Please enter the password and try again. + + +MSG_COMM_INCOMPATIBLE_PROTOCOL=Incompatible host server running on remote system {0}. +MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS=The host server is not a Remote System Explorer server. + +MSG_COMM_INCOMPATIBLE_UPDATE=Incompatible Remote System Explorer host server running on remote system {0}. +MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS=The host server needs to be updated to work with the current client. + +MSG_CONNECT_FAILED=Connect to {0} failed with an unexpected exception + +MSG_OPERATION_CANCELLED=Operation canceled. + +MSG_COMM_INVALID_LOGIN=Invalid password or user ID for {0}. +MSG_COMM_INVALID_LOGIN_DETAILS=Message from host: {0} + +MSG_COMM_REXEC_NOTSTARTED=Unable to connect to REXEC host service on port {0} of host {1} +MSG_COMM_REXEC_NOTSTARTED_DETAILS=Message from host: {0} + + + + + diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java index d878feb3baa..19fb3ecb0d5 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java @@ -22,8 +22,10 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.EOFException; import java.net.Socket; +import java.text.MessageFormat; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.dstore.core.client.ClientConnection; import org.eclipse.dstore.core.client.ConnectionStatus; import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants; @@ -31,9 +33,8 @@ import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.IRemoteServerLauncher; import org.eclipse.rse.core.subsystems.IServerLauncher; import org.eclipse.rse.core.subsystems.IServerLauncherProperties; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; /** @@ -480,8 +481,10 @@ public class RexecDstoreServer implements IServerLauncher } if (timeout == 0) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INVALID_LOGIN); - msg.makeSubstitution(signonInfo.getHostname(), ""); //$NON-NLS-1$ + String msgTxt = MessageFormat.format(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, new Object[] {signonInfo.getHostname()}); + String msgDetails = MessageFormat.format(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, new Object[] {""}); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; return port; } @@ -561,12 +564,16 @@ public class RexecDstoreServer implements IServerLauncher if (index > -1) // remove the embedded ASCII_TEST_STRING hostMessage = hostMessage.substring(0,index) + hostMessage.substring(index+1+ASCII_TEST_STRING.length()); if (hostMessage.indexOf(EZYRD11E) >0 ){ - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INVALID_LOGIN); - msg.makeSubstitution(signonInfo.getHostname(), hostMessage); + String msgTxt = MessageFormat.format(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, new Object[] {signonInfo.getHostname()}); + String msgDetails = MessageFormat.format(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, new Object[] {hostMessage}); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; } else { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_REXEC_NOTSTARTED); - msg.makeSubstitution(""+rexecPort, signonInfo.getHostname(), hostMessage); //$NON-NLS-1$ + String msgTxt = MessageFormat.format(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED, new Object[] {""+rexecPort, signonInfo.getHostname()}); + String msgDetails = MessageFormat.format(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED_DETAILS, new Object[] {hostMessage}); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; } @@ -835,9 +842,8 @@ public class RexecDstoreServer implements IServerLauncher if (monitor != null) { - SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); - cmsg.makeSubstitution(clientConnection.getPort()); - monitor.subTask(cmsg.getLevelOneText()); + String cmsg = MessageFormat.format(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, new Object[] {clientConnection.getPort()}); + monitor.subTask(cmsg); } // connect to launched server diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java index fddef56d1c7..3aef9cc9d3e 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java @@ -8,6 +8,7 @@ * Contributors: * Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - copy dialogs from team.cvs.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.ssh; @@ -42,4 +43,9 @@ public class SshConnectorResources extends NLS { public static String KeyboardInteractiveDialog_message; public static String KeyboardInteractiveDialog_labelConnection; + public static String MSG_CONNECT_CANCELLED; + + public static String MSG_DISCONNECT_FAILED; + public static String MSG_DISCONNECT_CANCELLED; + } diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties index 8041534f220..6fc07229fa9 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties @@ -8,6 +8,7 @@ # Contributors: # Martin Oberhuber (Wind River) - initial API and implementation # Martin Oberhuber (Wind River) - copy dialogs from team.cvs.ui +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ################################################################################ # NLS_MESSAGEFORMAT_VAR @@ -32,3 +33,11 @@ UserValidationDialog_7=Saved passwords are stored on your computer in a file tha KeyboardInteractiveDialog_message=Keyboard Interactive authentication for {0} KeyboardInteractiveDialog_labelConnection=Enter values for the following connection: {0} + + +MSG_CONNECT_CANCELLED = Connect to {0} was canceled + +MSG_DISCONNECT_FAILED = Disconnect from {0} failed with exception +MSG_DISCONNECT_CANCELLED = Disconnect from {0} was canceled + + diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java index 486c5d63d29..8b50db3192d 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected * Martin Oberhuber (Wind River) - [203500] Support encodings for SSH Sftp paths * Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.ssh; @@ -22,6 +23,7 @@ package org.eclipse.rse.internal.connectorservice.ssh; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; @@ -29,6 +31,7 @@ import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.window.Window; import org.eclipse.jsch.core.IJSchService; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchWindow; @@ -47,8 +50,8 @@ import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; import org.eclipse.rse.internal.services.ssh.ISshSessionProvider; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -276,8 +279,10 @@ public class SshConnectorService extends StandardConnectorService implements ISs //TODO need a more correct message for "session lost" //TODO allow users to reconnect from this dialog //SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_UNKNOWNHOST); - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED); - msg.makeSubstitution(_connection.getPrimarySubSystem().getHost().getAliasName()); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, + NLS.bind(SshConnectorResources.MSG_CONNECT_CANCELLED, _connection.getHost().getAliasName())); + SystemMessageDialog dialog = new SystemMessageDialog(getShell(), msg); dialog.open(); try @@ -395,8 +400,8 @@ public class SshConnectorService extends StandardConnectorService implements ISs // ISystemMessages.MSG_DISCONNECT_FAILED, // hostName, exc.getMessage()); //RSEUIPlugin.logError("Disconnect failed",exc); // temporary - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_FAILED).makeSubstitution(hostName,exc)); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, NLS.bind(SshConnectorResources.MSG_DISCONNECT_FAILED, hostName), exc); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); msgDlg.setException(exc); msgDlg.open(); } @@ -409,9 +414,9 @@ public class SshConnectorService extends StandardConnectorService implements ISs protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port) { //SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell, RSEUIPlugin.getResourceBundle(), - // ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName); - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_CANCELLED).makeSubstitution(hostName)); + // ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName) + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, NLS.bind(SshConnectorResources.MSG_DISCONNECT_CANCELLED, hostName)); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg); msgDlg.open(); } } diff --git a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java index c2277112e04..893797433a6 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java @@ -9,6 +9,7 @@ * Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - copy dialogs from team.cvs.ui * Sheldon D'souza (Celunite) - adapted from SshConnectorResources + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.telnet; @@ -31,5 +32,13 @@ public class TelnetConnectorResources extends NLS { public static String PropertySet_Description; public static String TelnetConnectorService_ErrorDisconnecting; + + public static String MSG_EXCEPTION_OCCURRED; + public static String MSG_COMM_AUTH_FAILED; + public static String MSG_COMM_AUTH_FAILED_DETAILS; + + public static String MSG_CONNECT_CANCELLED; + public static String MSG_DISCONNECT_FAILED; + public static String MSG_DISCONNECT_CANCELLED; } diff --git a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties index cd4a0030502..7c0a450c6f2 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties +++ b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties @@ -9,6 +9,7 @@ # Martin Oberhuber (Wind River) - initial API and implementation # Martin Oberhuber (Wind River) - copy dialogs from team.cvs.ui # Sheldon D'souza (Celunite) - adapted from SshConnectorResources.properties +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ################################################################################ # NLS_MESSAGEFORMAT_VAR @@ -20,3 +21,15 @@ TelnetConnectorService_Description=Telnet Connector Service Description PropertySet_Description=Telnet login properties. Set these according to your remote system's login prompts. TelnetConnectorService_ErrorDisconnecting=ConnectionStatusListener: Error disconnecting + +MSG_EXCEPTION_OCCURRED = An unexpected exception has occurred + +MSG_COMM_AUTH_FAILED = Invalid password or user ID +MSG_COMM_AUTH_FAILED_DETAILS = Authentication with {0} failed because the password or user ID is not correct. + + +MSG_CONNECT_CANCELLED = Connect to {0} was canceled + + +MSG_DISCONNECT_FAILED = Disconnect from {0} failed with exception +MSG_DISCONNECT_CANCELLED = Disconnect from {0} was canceled \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java index 1270a0eada8..e4b3872002d 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java @@ -17,6 +17,7 @@ * Sheldon D'souza (Celunite) - [187301] support multiple telnet shells * Sheldon D'souza (Celunite) - [194464] fix create multiple telnet shells quickly * Martin Oberhuber (Wind River) - [186761] make the port setting configurable + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.telnet; @@ -30,10 +31,12 @@ import java.util.List; import org.apache.commons.net.telnet.TelnetClient; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IPropertySet; @@ -44,9 +47,9 @@ import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; import org.eclipse.rse.internal.services.telnet.ITelnetSessionProvider; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -202,10 +205,12 @@ public class TelnetConnectorService extends StandardConnectorService implements //from the remote side with the SystemMessageException for user diagnostics SystemMessage msg; if (nestedException!=null) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED); - msg.makeSubstitution(nestedException); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, TelnetConnectorResources.MSG_EXCEPTION_OCCURRED, nestedException); } else { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_AUTH_FAILED); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + TelnetConnectorResources.MSG_COMM_AUTH_FAILED, + NLS.bind(TelnetConnectorResources.MSG_COMM_AUTH_FAILED_DETAILS, getHost().getAliasName())); + msg.makeSubstitution(getHost().getAliasName()); } throw new SystemMessageException(msg); @@ -352,8 +357,10 @@ public class TelnetConnectorService extends StandardConnectorService implements // TODO need a more correct message for "session lost" // TODO allow users to reconnect from this dialog // SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_UNKNOWNHOST); - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED); - msg.makeSubstitution(_connection.getPrimarySubSystem().getHost().getAliasName()); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, + NLS.bind(TelnetConnectorResources.MSG_CONNECT_CANCELLED, _connection.getHost().getAliasName())); + SystemMessageDialog dialog = new SystemMessageDialog(getShell(), msg); dialog.open(); try { @@ -471,9 +478,10 @@ public class TelnetConnectorService extends StandardConnectorService implements // ISystemMessages.MSG_DISCONNECT_FAILED, // hostName, exc.getMessage()); // RSEUIPlugin.logError("Disconnect failed",exc); // temporary - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_FAILED) - .makeSubstitution(hostName, exc)); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + NLS.bind(TelnetConnectorResources.MSG_DISCONNECT_FAILED, hostName), exc); + + SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg); msgDlg.setException(exc); msgDlg.open(); } @@ -487,10 +495,9 @@ public class TelnetConnectorService extends StandardConnectorService implements // SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell, // RSEUIPlugin.getResourceBundle(), // ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName); - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage( - ISystemMessages.MSG_DISCONNECT_CANCELLED) - .makeSubstitution(hostName)); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, + NLS.bind(TelnetConnectorResources.MSG_DISCONNECT_CANCELLED, hostName)); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg); msgDlg.open(); } } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 3cc17af7a57..72927514215 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -61,6 +61,8 @@ public class RSECorePlugin extends Plugin { */ public static final int CURRENT_RELEASE = 200; // updated to new release + public static final String PLUGIN_ID = "org.eclipse.rse.core"; + /** * Current release as a string. */ diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java index 4441e54f8ec..64c1a772ce2 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java @@ -25,6 +25,7 @@ * David McKnight (IBM) - [209660] check for changed encoding before using cached file * David McKnight (IBM) - [210812] for text transfer, need to tell editor to use local encoding * Xuan Chen (IBM) - [210816] Archive testcases throw ResourceException if they are run in batch + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -51,14 +52,18 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.files.ui.Activator; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.actions.SystemDownloadConflictAction; import org.eclipse.rse.internal.files.ui.resources.SystemFileNameHelper; import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -66,7 +71,6 @@ import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -1103,8 +1107,9 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP if (!remoteFile.exists()) { - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - message.makeSubstitution(remotePath, subsystem.getHost().getHostName()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, remotePath, subsystem.getHost().getHostName()); + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); + SystemMessageDialog dialog = new SystemMessageDialog(shell, message); dialog.open(); return; @@ -1139,8 +1144,9 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP download(shell); } - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DOWNLOAD_NO_WRITE); - message.makeSubstitution(remotePath, subsystem.getHost().getHostName()); + String msgTxt = NLS.bind(FileResources.MSG_DOWNLOAD_NO_WRITE, remotePath, subsystem.getHost().getHostName()); + String msgDetails = NLS.bind(FileResources.MSG_DOWNLOAD_NO_WRITE_DETAILS, remotePath, subsystem.getHost().getHostName()); + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.WARNING, msgTxt, msgDetails); SystemMessageDialog dialog = new SystemMessageDialog(shell, message); boolean answer = dialog.openQuestion(); @@ -1163,8 +1169,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP } else if (result == OPEN_IN_DIFFERENT_PERSPECTIVE) { - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR); - message.makeSubstitution(remotePath, subsystem.getHost().getHostName()); + String msgTxt = NLS.bind(FileResources.MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR, remotePath, subsystem.getHost().getHostName()); + String msgDetails = NLS.bind(FileResources.MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR_DETAILS, remotePath, subsystem.getHost().getHostName()); + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.WARNING, msgTxt, msgDetails); + SystemMessageDialog dialog = new SystemMessageDialog(shell, message); boolean answer = dialog.openQuestion(); @@ -1223,9 +1231,8 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP if (!remoteFile.exists()) { - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - message.makeSubstitution(remotePath, subsystem.getHost().getHostName()); - + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, remotePath, subsystem.getHost().getHostName()); + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); DisplayMessageDialog dd = new DisplayMessageDialog(message); Display.getDefault().syncExec(dd); @@ -1260,9 +1267,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP { // this could be because file doesn't exist download(monitor); } - - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DOWNLOAD_NO_WRITE); - message.makeSubstitution(remotePath, subsystem.getHost().getHostName()); + + String msgTxt = NLS.bind(FileResources.MSG_DOWNLOAD_NO_WRITE, remotePath, subsystem.getHost().getHostName()); + String msgDetails = NLS.bind(FileResources.MSG_DOWNLOAD_NO_WRITE_DETAILS, remotePath, subsystem.getHost().getHostName()); + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.WARNING, msgTxt, msgDetails); DisplayQuestionDialog dd = new DisplayQuestionDialog(message); Display.getDefault().syncExec(dd); @@ -1832,9 +1840,12 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP catch (InvocationTargetException e) { SystemBasePlugin.logError("Error in performSaveAs", e); //$NON-NLS-1$ - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); + String msgTxt = FileResources.MSG_ERROR_UNEXPECTED; + + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); SystemMessageDialog dialog = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), message); dialog.open(); + return true; } finally @@ -1859,9 +1870,12 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP catch (Exception e) { SystemBasePlugin.logError("Error in performSaveAs", e); //$NON-NLS-1$ - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); + String msgTxt = FileResources.MSG_ERROR_UNEXPECTED; + + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); SystemMessageDialog dialog = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), message); dialog.open(); + return true; } } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java index b827dddb8af..e8f8507483a 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java @@ -19,6 +19,7 @@ * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core * Martin Oberhuber (Wind River) - [199573] Fix potential threading issues in SystemTempFileListener * David McKnight (IBM) - [205297] Editor upload should not be on main thread + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -48,13 +49,11 @@ import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager; -import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.swt.widgets.Shell; @@ -164,8 +163,7 @@ public abstract class SystemTempFileListener implements IResourceChangeListener public IStatus runInUIThread(IProgressMonitor monitor) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SYNCHRONIZE_PROGRESS); - monitor.beginTask(msg.getLevelOneText(), _resources.size()); + monitor.beginTask(FileResources.MSG_SYNCHRONIZE_PROGRESS, _resources.size()); for (int i = 0; i < _resources.size(); i++) { Object resource = _resources.get(i); @@ -198,9 +196,8 @@ public abstract class SystemTempFileListener implements IResourceChangeListener filesToSync = (IFile[])_changedResources.toArray(new IFile[_changedResources.size()]); _changedResources.clear(); } - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SYNCHRONIZE_PROGRESS); - monitor.beginTask(msg.getLevelOneText(), IProgressMonitor.UNKNOWN); - setName(msg.getLevelOneText()); + monitor.beginTask(FileResources.MSG_SYNCHRONIZE_PROGRESS, IProgressMonitor.UNKNOWN); + setName(FileResources.MSG_SYNCHRONIZE_PROGRESS); for (int i = 0; i < filesToSync.length; i++) { synchronizeTempWithRemote(filesToSync[i], monitor); @@ -234,9 +231,9 @@ public abstract class SystemTempFileListener implements IResourceChangeListener filesToSync = (IFile[])_changedResources.toArray(new IFile[_changedResources.size()]); _changedResources.clear(); } - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SYNCHRONIZE_PROGRESS); - monitor.beginTask(msg.getLevelOneText(), IProgressMonitor.UNKNOWN); - setName(msg.getLevelOneText()); + + monitor.beginTask(FileResources.MSG_SYNCHRONIZE_PROGRESS, IProgressMonitor.UNKNOWN); + setName(FileResources.MSG_SYNCHRONIZE_PROGRESS); for (int i = 0; i < filesToSync.length; i++) { synchronizeTempWithRemote(filesToSync[i], monitor); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java index 760c694be81..0d889e3d82d 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java @@ -39,6 +39,7 @@ * David McKnight (IBM) - [143503] encoding and isBinary needs to be stored in the IFile properties * Xuan Chen (IBM) - [191370] [dstore] supertransfer zip not deleted when cancelling copy * Xuan Chen (IBM) - [210816] Archive testcases throw ResourceException if they are run in batch + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -70,6 +71,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemRegistry; @@ -85,6 +87,7 @@ import org.eclipse.rse.services.clientserver.SystemEncodingUtil; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.clientserver.archiveutils.ISystemArchiveHandler; import org.eclipse.rse.services.clientserver.archiveutils.VirtualChild; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.IFileService; @@ -100,7 +103,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog; @@ -398,10 +400,12 @@ public class UniversalFileTransferUtility IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i); // first check for existence - if (!srcFileOrFolder.exists()){ - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + if (!srcFileOrFolder.exists()){ + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); resultSet.setMessage(errorMessage); + } else { @@ -586,9 +590,11 @@ public class UniversalFileTransferUtility IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i); if (!srcFileOrFolder.exists()) { - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); resultSet.setMessage(errorMessage); + } else { @@ -743,8 +749,9 @@ public class UniversalFileTransferUtility public static Object downloadResourceToWorkspace(File srcFileOrFolder, IProgressMonitor monitor) { if (!srcFileOrFolder.exists()) { - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), "LOCALHOST"); //$NON-NLS-1$ + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), "LOCALHOST"); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); return errorMessage; } @@ -1023,8 +1030,9 @@ public class UniversalFileTransferUtility } if (!srcFileOrFolder.exists()) { - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName()); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); return errorMessage; } @@ -1232,9 +1240,12 @@ public class UniversalFileTransferUtility if (!targetFolder.canWrite()) { - SystemMessage errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR); - errorMsg.makeSubstitution(targetFS.getHostAliasName()); + String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; + String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); + + SystemMessage errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); resultSet.setMessage(errorMsg); + return resultSet; } @@ -1535,8 +1546,9 @@ public class UniversalFileTransferUtility if (!targetFolder.canWrite()) { - SystemMessage errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR); - errorMsg.makeSubstitution(targetFS.getHostAliasName()); + String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; + String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); + SystemMessage errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); return errorMsg; } @@ -2043,17 +2055,10 @@ public class UniversalFileTransferUtility if (shouldExtract) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXTRACT_PROGRESS); - msg.makeSubstitution(currentSource.getName()); - monitor.subTask(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_EXTRACT_PROGRESS, currentSource.getName()); + monitor.subTask(msgTxt); - /* DKM - should not be calling this - while (display.readAndDispatch()) { - //Process everything on event queue - } - */ - boolean canWrite = true; if (currentTarget != null) { diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java index 45bcddb7d64..37e7530c5a1 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java @@ -12,17 +12,20 @@ * * Contributors: * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.osgi.util.NLS; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -110,10 +113,12 @@ public class SaveAsForm extends SystemSelectRemoteFileOrFolderForm { //System.out.println("...saveasMbr null? "+ (saveasMbr==null)); if (saveasFile != null && saveasFile.exists()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UPLOAD_FILE_EXISTS); - msg.makeSubstitution(fileName); + String msgTxt = NLS.bind(FileResources.MSG_UPLOAD_FILE_EXISTS, fileName); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.WARNING, msgTxt); SystemMessageDialog dlg = new SystemMessageDialog(getShell(), msg); ok = dlg.openQuestionNoException(); + } } return ok; diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java index a454b70cf93..e0bc6c63008 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java @@ -12,26 +12,31 @@ * * Contributors: * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; import java.util.Vector; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.internal.files.ui.Activator; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.actions.SystemSelectFileTypesAction; import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystemConfiguration; import org.eclipse.rse.subsystems.files.core.util.ValidatorFileFilterString; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; @@ -502,7 +507,7 @@ public class SystemFileFilterStringEditPane { if (textTypes.getText().trim().length() == 0) { - errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_ERROR_NOFILETYPES); + errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.FILEMSG_ERROR_NOFILETYPES, FileResources.FILEMSG_ERROR_NOFILETYPES_DETAILS); } } controlInError = textFile; @@ -515,7 +520,8 @@ public class SystemFileFilterStringEditPane notUnique = true; if (notUnique) { - errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE).makeSubstitution(currFilterString); + String msgTxt = NLS.bind(FileResources.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE, currFilterString); + errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); } controlInError = textFile; } @@ -633,7 +639,7 @@ public class SystemFileFilterStringEditPane } // no path validator, so just use default path empty message else { - errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_EMPTY); + errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_VALIDATE_PATH_EMPTY, FileResources.MSG_VALIDATE_PATH_EMPTY_DETAILS); } } // KM: defect 53210 @@ -649,7 +655,7 @@ public class SystemFileFilterStringEditPane } // no path validator, so just use default path empty message else { - errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_EMPTY); + errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_VALIDATE_PATH_EMPTY, FileResources.MSG_VALIDATE_PATH_EMPTY_DETAILS); } } } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java index c2de81f807a..351653812d0 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods * David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect() + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; @@ -23,6 +24,7 @@ import java.util.Hashtable; import java.util.ResourceBundle; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; @@ -30,14 +32,13 @@ import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemPreferencesConstants; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemPreferencesManager; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.widgets.ISystemCombo; @@ -580,18 +581,16 @@ public class SystemQualifiedRemoteFolderCombo extends Composite ISystemProfile profile = sr.getSystemProfile(profileName); if (profile == null) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_PROFILE_NOTFOUND); - msg.makeSubstitution(profileName); - throw new Exception(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_PROFILE_NOTFOUND, profileName); + throw new Exception(msgTxt); } // turn connection name into connection object... IHost conn = RSECorePlugin.getTheSystemRegistry().getHost(profile,connName); if (conn == null) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_CONNECTION_NOTFOUND); - msg.makeSubstitution(connName); - throw new Exception(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_CONNECTION_NOTFOUND, connName); + throw new Exception(msgTxt); } // turn folder name into folder object... @@ -604,9 +603,8 @@ public class SystemQualifiedRemoteFolderCombo extends Composite if (filesubsystems.length == 0) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_CONNECTION_NOTFOUND);// hmm, what else to say? - msg.makeSubstitution(connName); - throw new Exception(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_CONNECTION_NOTFOUND, connName); + throw new Exception(msgTxt); } IRemoteFileSubSystem ss = (IRemoteFileSubSystem)filesubsystems[0]; // what else to do? if (!ss.isConnected()) @@ -620,14 +618,12 @@ public class SystemQualifiedRemoteFolderCombo extends Composite } } catch (InterruptedException exc) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED); - msg.makeSubstitution(conn.getHostName()); - throw new Exception(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_CONNECT_CANCELLED, conn.getHostName()); + throw new Exception(msgTxt); } catch (Exception exc) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED); - msg.makeSubstitution(conn.getHostName()); - throw new Exception(msg.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_CONNECT_FAILED, conn.getHostName()); + throw new Exception(msgTxt); } } if (ss.isConnected()) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java index 10edbb4de2c..82d156ae8bd 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; @@ -20,16 +21,18 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Map; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.rse.core.IRSESystemType; +import org.eclipse.rse.internal.files.ui.Activator; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.actions.SystemSelectFileTypesAction; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.view.SystemViewLabelAndContentProvider; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileRoot; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.swt.SWT; @@ -604,9 +607,8 @@ public class SystemSelectRemoteFilesForm extends Composite { if (msgLine != null) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED); - msg.makeSubstitution(exc); - msgLine.setErrorMessage(msg); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_EXCEPTION_OCCURRED, exc); + msgLine.setErrorMessage(msg); } else SystemMessageDialog.displayExceptionMessage(getShell(), exc); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/Activator.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/Activator.java index aed2a44a875..3b703720eb6 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/Activator.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/Activator.java @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [180519][api] declaratively register adapter factories * David McKnight (IBM) - [205820] create the temp files project (if not there) when files.ui is loaded + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui; @@ -42,6 +43,8 @@ public class Activator extends AbstractUIPlugin private static SystemUniversalTempFileListener _tempFileListener; + public final static String PLUGIN_ID = "org.eclipse.rse.files.ui"; //$NON-NLS-1$ + /** * The constructor. */ diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java index 2fa7cd8df20..0adab4d3b5e 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java @@ -355,6 +355,139 @@ public class FileResources extends NLS public static String RESID_PROPERTY_SEARCH_STATUS_INACTIVE_VALUE; + // messages + public static String MSG_ERROR_UNEXPECTED; + + public static String MSG_ERROR_FOLDER_NOTFOUND; + public static String MSG_ERROR_FILE_NOTFOUND; + public static String MSG_ERROR_FOLDERORFILE_NOTFOUND; + public static String MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED; + public static String MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED_DETAILS; + + // Remote editing messages + public static String MSG_DOWNLOAD_NO_WRITE; + public static String MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR; + public static String MSG_UPLOAD_FILE_EXISTS; + public static String MSG_DOWNLOAD_NO_WRITE_DETAILS; + public static String MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR_DETAILS; + + // file transfer messages + public static String MSG_DOWNLOAD_PROGRESS; + public static String MSG_UPLOAD_PROGRESS; + public static String MSG_SYNCHRONIZE_PROGRESS; + public static String MSG_EXTRACT_PROGRESS; + public static String MSG_PERCENT_DONE; + public static String MSG_DOWNLOADING_PROGRESS; + public static String MSG_UPLOADING_PROGRESS; + + // Remote File Exception Messages + public static String FILEMSG_SECURITY_ERROR; + public static String FILEMSG_IO_ERROR; + public static String FILEMSG_FOLDER_NOTEMPTY; + public static String FILEMSG_FOLDER_NOTFOUND; + public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE; + public static String FILEMSG_FILE_NOTFOUND; + + public static String FILEMSG_SECURITY_ERROR_DETAILS; + public static String FILEMSG_IO_ERROR_DETAILS; + public static String FILEMSG_FOLDER_NOTEMPTY_DETAILS; + public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS; + + + // -------------------------- + // UNIVERSAL FILE MESSAGES... + // -------------------------- + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES; + + public static String FILEMSG_DELETE_FILE_FAILED; + public static String FILEMSG_RENAME_FILE_FAILED; + public static String FILEMSG_CREATE_FILE_FAILED; + public static String FILEMSG_CREATE_FILE_FAILED_EXIST; + public static String FILEMSG_CREATE_FOLDER_FAILED; + public static String FILEMSG_CREATE_FOLDER_FAILED_EXIST; + public static String FILEMSG_CREATE_RESOURCE_NOTVISIBLE; + public static String FILEMSG_RENAME_RESOURCE_NOTVISIBLE; + public static String FILEMSG_ERROR_NOFILETYPES; + public static String FILEMSG_COPY_FILE_FAILED; + public static String FILEMSG_MOVE_FILE_FAILED; + public static String FILEMSG_MOVE_TARGET_EQUALS_SOURCE; + public static String FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE; + public static String FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE; + public static String FILEMSG_MOVE_FILTER_NOT_VALID; + + public static String FILEMSG_DELETE_FILE_FAILED_DETAILS; + public static String FILEMSG_RENAME_FILE_FAILED_DETAILS; + public static String FILEMSG_CREATE_FILE_FAILED_DETAILS; + public static String FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS; + public static String FILEMSG_CREATE_FOLDER_FAILED_DETAILS; + public static String FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS; + public static String FILEMSG_CREATE_RESOURCE_NOTVISIBLE_DETAILS; + public static String FILEMSG_RENAME_RESOURCE_NOTVISIBLE_DETAILS; + public static String FILEMSG_ERROR_NOFILETYPES_DETAILS; + public static String FILEMSG_COPY_FILE_FAILED_DETAILS; + public static String FILEMSG_MOVE_FILE_FAILED_DETAILS; + public static String FILEMSG_MOVE_TARGET_EQUALS_SOURCE_DETAILS; + public static String FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE_DETAILS; + public static String FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE_DETAILS; + public static String FILEMSG_MOVE_FILTER_NOT_VALID_DETAILS; + + public static String FILEMSG_MOVE_INTERRUPTED; + public static String FILEMSG_RENAME_INTERRUPTED; + public static String FILEMSG_DELETE_INTERRUPTED; + public static String FILEMSG_COPY_INTERRUPTED; + public static String FILEMSG_MOVE_INTERRUPTED_DETAILS; + public static String FILEMSG_RENAME_INTERRUPTED_DETAILS; + public static String FILEMSG_DELETE_INTERRUPTED_DETAILS; + public static String FILEMSG_COPY_INTERRUPTED_DETAILS; + + // cache preferences + public static String MSG_CACHE_UPLOAD_BEFORE_DELETE; + public static String MSG_CACHE_UNABLE_TO_SYNCH; + + public static String FILEMSG_DELETING; + + public static String MSG_ERROR_CONNECTION_NOTFOUND; + public static String MSG_ERROR_PROFILE_NOTFOUND; + public static String MSG_ERROR_CONNECTION_NOTFOUND_DETAILS; + public static String MSG_ERROR_PROFILE_NOTFOUND_DETAILS; + + public static String MSG_VALIDATE_PATH_EMPTY; + public static String MSG_VALIDATE_PATH_NOTUNIQUE; + public static String MSG_VALIDATE_PATH_NOTVALID; + public static String MSG_VALIDATE_PATH_EMPTY_DETAILS; + public static String MSG_VALIDATE_PATH_NOTUNIQUE_DETAILS; + public static String MSG_VALIDATE_PATH_NOTVALID_DETAILS; + + public static String MSG_CONNECT_FAILED; + public static String MSG_CONNECT_UNKNOWNHOST; + public static String MSG_CONNECT_CANCELLED; + + public static String MSG_EXCEPTION_OCCURRED; + + // remote search messages + public static String MSG_REMOTE_SEARCH_INVALID_REGEX; + public static String MSG_REMOTE_SEARCH_INVALID_REGEX_DETAILS; + + public static String MSG_COPY_PROGRESS; + + public static String MSG_EXPAND_FAILED; + public static String MSG_EXPAND_CANCELLED; + + // operation status + public static String MSG_OPERATION_RUNNING; + public static String MSG_OPERATION_FINISHED; + public static String MSG_OPERTION_STOPPED; + public static String MSG_OPERATION_DISCONNECTED; + + public static String MSG_CREATEFILEGENERIC_PROGRESS; + public static String MSG_CREATEFOLDERGENERIC_PROGRESS; + + // universal commands + public static String MSG_UCMD_INVOCATION_EMPTY; + static { // load message values from bundle file diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties index 1c599054cfb..a18a799d477 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties @@ -15,7 +15,7 @@ # David Dykstal (IBM) - 176488: adding some text for the cache limit checkbox # David McKnight(IBM) - [210142] for accessibility need transfer mode toggle button # David McKnight(IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files -# David McKnight (IBM) - [216252] [nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible +# David McKnight (IBM)- [216252] [nls] Resource s specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -46,7 +46,7 @@ FileEditorPreference_defaultLabel = (default) FileEditorPreference_contentTypesRelatedLink = See ''{0}'' for content-type based file associations. FileEditorPreference_isLocked = {0} (locked by ''{1}'' content type) -FileExtension_fileTypeMessage = Enter file type to add: (*.doc or report.doc for example) +FileExtension_fileTypeMessage =Enter file type to add: (*.doc or report.doc for example) FileExtension_fileTypeLabel = File &type: FileExtension_shellTitle = New File Type FileExtension_dialogTitle = Define a New File Type @@ -116,10 +116,10 @@ RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_LABEL=Default File Transfer Mo RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_TOOLTIP=Default mode of file transfer for unspecified file types ################################################################################### -############################ Remote Search ############################## +############################Remote Search############################## ################################################################################### RESID_SEARCH_STRING_LABEL_LABEL= Search string (leave empty for file search): -RESID_SEARCH_STRING_LABEL_TOOLTIP= String to be searched +RESID_SEARCH_STRING_LABEL_TOOLTIP=String to be searched RESID_SEARCH_STRING_COMBO_TOOLTIP= Enter or select search string RESID_SEARCH_CASE_BUTTON_LABEL= Case sensitive RESID_SEARCH_CASE_BUTTON_TOOLTIP= Specify whether case should be considered during search @@ -138,7 +138,7 @@ RESID_SEARCH_FILENAME_REGEX_LABEL= Regular expression RESID_SEARCH_FILENAME_REGEX_TOOLTIP= Specify whether file name pattern is a regular expression RESID_SEARCH_FOLDERNAME_LABEL_LABEL= Folder: RESID_SEARCH_FOLDERNAME_LABEL_TOOLTIP= Folder path -RESID_SEARCH_FOLDERNAME_COMBO_TOOLTIP= Identifies the folder in which to search. It is fully qualified including the connection name, as in connection:/path/folder +RESID_SEARCH_FOLDERNAME_COMBO_TOOLTIP= Identifies the folder in which to search. It is fully qualified including the connection name, as in connection:/path/folder RESID_SEARCH_FOLDERNAME_BROWSE_LABEL= Browse... RESID_SEARCH_FOLDERNAME_BROWSE_TOOLTIP= Opens a dialog to select a folder RESID_SEARCH_INCLUDE_ARCHIVES_LABEL= Search archive files @@ -163,16 +163,16 @@ RESID_SEARCH_STARTCOLUMNLABEL_TOOLTIP= Search between specified column and end o # Search dialog RESID_SEARCH_MESSAGE_SEARCHING= Searching... -RESID_SEARCH_MESSAGE_ONEMATCH= %1 match -RESID_SEARCH_MESSAGE_MULTIPLEMATCHES= %1 matches +RESID_SEARCH_MESSAGE_ONEMATCH= {0} match +RESID_SEARCH_MESSAGE_MULTIPLEMATCHES= {0} matches ################################################################################## -############################ Resource Conflict Dlgs ######################### +############################Resource Conflict Dlgs ######################### ################################################################################## RESID_CONFLICT_SAVE_TITLE= Save Conflict RESID_CONFLICT_SAVE_MESSAGE= This file has changed on the remote system since it was opened. RESID_CONFLICT_SAVE_OVERWRITEREMOTE= Overwrite the remote file. -RESID_CONFLICT_SAVE_REPLACELOCAL= Replace contents of editor with remote file. Pending changes will be lost. +RESID_CONFLICT_SAVE_REPLACELOCAL= Replace contents of editor with remote file. Pending changes will be lost. RESID_CONFLICT_SAVE_SAVETODIFFERENT= Save the contents of the editor to a different remote file. RESID_CONFLICT_DOWNLOAD_TITLE= Local Changes Pending @@ -214,7 +214,7 @@ RESID_SUPERTRANSFER_PREFS_TYPE_LABEL=Archive type RESID_SUPERTRANSFER_PREFS_TYPE_TOOLTIP=Select an archive type to use for the transfer ################################################################################## -############################ Compare menu item ############################# +############################Compare menu item############################# ################################################################################## ACTION_COMPAREWITH_EACH_LABEL= Each Other ACTION_COMPAREWITH_EACH_TOOLTIP= Compare remote resources to each other @@ -222,7 +222,7 @@ ACTION_COMPAREWITH_HISTORY_LABEL= Local History... ACTION_COMPAREWITH_HISTORY_TOOLTIP= Compare the local edition history of this resource ################################################################################## -############################ Replace menu item ############################# +############################Replace menu item############################# ################################################################################## ACTION_REPLACEWITH_HISTORY_LABEL= Local History... ACTION_REPLACEWITH_HISTORY_TOOLTIP= Replace the remote file with a previous edition from it's local history @@ -230,7 +230,7 @@ ACTION_REPLACEWITH_HISTORY_TOOLTIP= Replace the remote file with a previous edit ################################################################################## -############################ Project menu item ############################# +############################Project menu item############################# ################################################################################## RESID_OPEN_FROM_ASSOCIATED_PROJECT=Open from Associated Project (&1) @@ -343,3 +343,156 @@ RESID_PROPERTY_VIRTUALFILE_COMMENT_DESCRIPTION=The user-defined comment for this RESID_PROPERTY_SEARCH_STATUS_ACTIVE_VALUE=Running RESID_PROPERTY_SEARCH_STATUS_INACTIVE_VALUE=Finished + + +#MESSAGES +MSG_ERROR_UNEXPECTED=An unexpected error occurred. + +MSG_ERROR_FOLDER_NOTFOUND=Folder {0} not found on host {1} +MSG_ERROR_FILE_NOTFOUND=File {0} not found on host {1} +MSG_ERROR_FOLDERORFILE_NOTFOUND=File or folder {0} not found on host {1} +MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED=Archive Management is not supported by the current File subsystem's configuration. +MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED_DETAILS=In the properties for the File subsystem, choose a configuration that supports Archive Management. + +MSG_DOWNLOAD_NO_WRITE=You do not have write access to file {0} on {1}. Do you want to open the file in browse mode? +MSG_DOWNLOAD_NO_WRITE_DETAILS=You do not have write permission to the file {0} on {1}. You can open the file in browse (read-only) mode. If you want to edit the file, change file permissions to allow write access to the file. +MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR=You are currently editing file {0} on {1}. Do you want to open the file in browse mode? +MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR_DETAILS=You are allowed to edit a file in one editor only. You can, however, open the file in another editor for browsing. Browsing lets you view the file but does not allow you to edit its contents. +MSG_UPLOAD_FILE_EXISTS=File {0} already exists. Do you want to replace it? + +MSG_DOWNLOAD_PROGRESS=Downloading {0} +MSG_UPLOAD_PROGRESS=Uploading {0} +MSG_SYNCHRONIZE_PROGRESS=Synchronizing Resources... +MSG_EXTRACT_PROGRESS=Extracting {0} +MSG_PERCENT_DONE={0} of {1} complete ({2}) +MSG_DOWNLOADING_PROGRESS=Downloading resources... +MSG_UPLOADING_PROGRESS=Uploading resources... + +# REMOTE FILE SYSTEM EXCEPTION ERROR MESSAGES +FILEMSG_SECURITY_ERROR=Operation failed. Security violation +FILEMSG_SECURITY_ERROR_DETAILS=Message reported from file system: {0} + +FILEMSG_IO_ERROR=Operation failed. File system input or output error +FILEMSG_IO_ERROR_DETAILS=Message reported from file system: {0} + +FILEMSG_FOLDER_NOTEMPTY=Folder is not empty. Cannot delete +FILEMSG_FOLDER_NOTEMPTY_DETAILS=The operation failed. One possible reason is that the folder is not empty + +FILEMSG_FOLDER_NOTFOUND=Folder '{0}' not found + +FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE=Folder '{0}' not found. Would you like to create it? +FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS=The folder you specified does not exist. Select Yes to create it, No to cancel the operation +FILEMSG_FILE_NOTFOUND=File '{0}' not found + +# PATH VALIDATION +MSG_VALIDATE_PATH_EMPTY=Enter path +MSG_VALIDATE_PATH_EMPTY_DETAILS=You must specify a file system path. +MSG_VALIDATE_PATH_NOTUNIQUE=Path is not unique +MSG_VALIDATE_PATH_NOTUNIQUE_DETAILS=The path you specified is already in use. +MSG_VALIDATE_PATH_NOTVALID= Path syntax is not valid +MSG_VALIDATE_PATH_NOTVALID_DETAILS=The syntax of the path you specified is not valid. Enter a file system path that is valid for the remote operating system. + +# Universal File Messages +FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY=Enter file name pattern +FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE=Filter string '{0}' already exists in this filter +FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID =Filter string name pattern not valid +FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES =You must include files or folders or both + +FILEMSG_DELETE_FILE_FAILED=Deletion of the object {0} failed +FILEMSG_DELETE_FILE_FAILED_DETAILS=Either the object does not exist or you do not have enough authority to delete the object. If this is a folder, the folder may not be empty + +FILEMSG_RENAME_FILE_FAILED=Renaming of the object {0} failed +FILEMSG_RENAME_FILE_FAILED_DETAILS=Rename operation failed because, the object to rename does not exist, or the object with new object name already exists, or the user does not have enough authority to rename the object + +FILEMSG_CREATE_FILE_FAILED=No authority or file name not valid +FILEMSG_CREATE_FILE_FAILED_DETAILS=The file could not be created because of one of the following reasons:\n- the user does not have enough authority to create the file \n- the file name is not valid + +FILEMSG_CREATE_FILE_FAILED_EXIST=File already exists +FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS=The new file {0} already exists + +FILEMSG_CREATE_FOLDER_FAILED=Creation of the folder failed +FILEMSG_CREATE_FOLDER_FAILED_DETAILS=The folder {0} could not be created because of one of the following reasons:\n- the user does not have enough authority to create the folder \n- the folder name is not valid + +FILEMSG_CREATE_FOLDER_FAILED_EXIST= Folder already exists +FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS=The new folder {0} already exists + +FILEMSG_CREATE_RESOURCE_NOTVISIBLE=New resource will not be visible due to subsetting. Create it anyway? +FILEMSG_CREATE_RESOURCE_NOTVISIBLE_DETAILS=The name of the resource you are creating does not match the current filter criteria. If you select Yes to create the resource, it will not be visible within the current filter. + +FILEMSG_RENAME_RESOURCE_NOTVISIBLE=Resource will not be visible due to subsetting. Rename it anyway? +FILEMSG_RENAME_RESOURCE_NOTVISIBLE_DETAILS=The new name of the resource does not match the current filter criteria. If you select Yes to rename the resource, it will not be visible within the current filter. + +FILEMSG_ERROR_NOFILETYPES =No file types specified +FILEMSG_ERROR_NOFILETYPES_DETAILS=Either specify one or more file types, or select to subset by file name + +FILEMSG_COPY_FILE_FAILED=Copy of the file or folder {0} failed +FILEMSG_COPY_FILE_FAILED_DETAILS=The file system reported the copy operation failed. You may not have authority to the target folder, or it may be in use + +FILEMSG_MOVE_FILE_FAILED=Move of the file or folder {0} failed +FILEMSG_MOVE_FILE_FAILED_DETAILS=The file system reported the move operation failed. You may not have authority to the source folder or file, or you may not have authority to the target folder, or it may be in use + +FILEMSG_MOVE_TARGET_EQUALS_SOURCE=Target folder cannot equal source folder +FILEMSG_MOVE_TARGET_EQUALS_SOURCE_DETAILS=It is impossible to move a folder to itself. + +FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE = Target folder cannot equal parent of source file/folder. +FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE_DETAILS =A file or folder cannot be moved into the directory in which it exists. If you wish to rename the file, use the rename action. + +FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE =Target folder cannot descend from source folder +FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE_DETAILS=It is impossible to move a folder to one of its subfolders. + +FILEMSG_MOVE_FILTER_NOT_VALID = Selected filter is not a valid destination. +FILEMSG_MOVE_FILTER_NOT_VALID_DETAILS=Some filters, such as the Root or Drives filter, do not designate locations on the remote file system and cannot have files moved into them. + +FILEMSG_DELETING =Deleting {0}... + +MSG_ERROR_CONNECTION_NOTFOUND = Connection {0} not found +MSG_ERROR_CONNECTION_NOTFOUND_DETAILS=No connection named {0} currently exists< + +MSG_ERROR_PROFILE_NOTFOUND =Profile {0} not found +MSG_ERROR_PROFILE_NOTFOUND_DETAILS=No profile named {0} currently exists + +MSG_CONNECT_FAILED = Connect to {0} failed with an unexpected exception +MSG_CONNECT_UNKNOWNHOST = Connect failed. Host {0} not found or not responding +MSG_CONNECT_CANCELLED =Connect to {0} was canceled + +MSG_EXCEPTION_OCCURRED = An unexpected exception has occurred + +FILEMSG_MOVE_INTERRUPTED = Operation interrupted. Some objects have been moved. +FILEMSG_MOVE_INTERRUPTED_DETAILS = The following objects have been moved:\n{0} +FILEMSG_RENAME_INTERRUPTED =Operation interrupted. Some objects have been renamed. +FILEMSG_RENAME_INTERRUPTED_DETAILS= The following objects have been renamed:\n{0} +FILEMSG_DELETE_INTERRUPTED =Operation interrupted. Some objects have been deleted. +FILEMSG_DELETE_INTERRUPTED_DETAILS = The following objects have been deleted:\n{0} +FILEMSG_COPY_INTERRUPTED = Operation interrupted. Some objects have been copied to the destination. +FILEMSG_COPY_INTERRUPTED_DETAILS=The following objects have been copied:\n{0} + +# cache preferences +MSG_CACHE_UPLOAD_BEFORE_DELETE = One or more cached files have changes that have not been saved on the host. +MSG_CACHE_UNABLE_TO_SYNCH = Unable to synchronize cache changes to host. Operation canceled. + +# remote search messages +MSG_REMOTE_SEARCH_INVALID_REGEX = Regular expression is not valid. +MSG_REMOTE_SEARCH_INVALID_REGEX_DETAILS=The value {0} you entered is not a valid regular expression. + +MSG_COPY_PROGRESS = Copying '{0}' to '{1}' + +MSG_EXPAND_FAILED = Expand failed. Try again +MSG_EXPAND_CANCELLED = Expand canceled. Try again + +# operation status +MSG_OPERATION_RUNNING = {0} - Running +MSG_OPERATION_FINISHED = {0} - Finished +MSG_OPERTION_STOPPED = {0} - Canceled +MSG_OPERATION_DISCONNECTED = {0} - Disconnected + + +MSG_CREATEFILEGENERIC_PROGRESS = Creating file {0}... +MSG_CREATEFOLDERGENERIC_PROGRESS =Creating folder {0}... + +# universal commands +MSG_UCMD_INVOCATION_EMPTY = The invocation may not be blank + + + + + \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java index 8c47063a074..2f6dddf9f7c 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java @@ -18,6 +18,7 @@ * Kevin Doyle (IBM) - [196588] Move Dialog doesn't show Archives * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.actions; @@ -26,10 +27,12 @@ import java.util.Vector; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemRemoteChangeEvents; import org.eclipse.rse.core.filters.ISystemFilter; @@ -40,16 +43,18 @@ import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog; +import org.eclipse.rse.internal.files.ui.Activator; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.view.SystemView; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemActionViewerFilter; import org.eclipse.rse.ui.SystemBasePlugin; @@ -229,8 +234,9 @@ public class SystemCopyRemoteFileAction extends SystemBaseCopyAction ok = ss.copy(srcFileOrFolder, targetFolder, newName, null); if (!ok) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_FILE_FAILED); - msg.makeSubstitution(srcFileOrFolder.getName()); + String msgTxt = NLS.bind(FileResources.FILEMSG_COPY_FILE_FAILED, srcFileOrFolder.getName()); + String msgDetails = FileResources.FILEMSG_COPY_FILE_FAILED_DETAILS; + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); throw new SystemMessageException(msg); } else diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java index a0300c5e058..294ceedc811 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java @@ -19,6 +19,7 @@ * Kevin Doyle (IBM) - [199324] [nls] Move dialog SystemMessages should be added/updated * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread * Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.actions; @@ -29,16 +30,19 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemRemoteChangeEvents; import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.files.ui.Activator; +import org.eclipse.rse.internal.files.ui.FileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.actions.SystemBaseCopyAction; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -115,9 +119,13 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction { movedFileNamesList = movedFileNamesList + "\n" + (String)(movedFileNames.get(i)); //$NON-NLS-1$ } - SystemMessage thisMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_INTERRUPTED); - thisMessage.makeSubstitution(movedFileNamesList); + + String msgTxt = FileResources.FILEMSG_MOVE_INTERRUPTED; + String msgDetails = NLS.bind(FileResources.FILEMSG_MOVE_INTERRUPTED_DETAILS, movedFileNamesList); + + SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(shell, thisMessage); + status = Status.CANCEL_STATUS; } else @@ -194,8 +202,9 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction ok = ss.move(srcFileOrFolder, targetFolder, newName, monitor); if (!ok) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_FILE_FAILED); - msg.makeSubstitution(srcFileOrFolder.getName()); + String msgTxt = NLS.bind(FileResources.FILEMSG_MOVE_FILE_FAILED, srcFileOrFolder.getName()); + String msgDetails = FileResources.FILEMSG_MOVE_FILE_FAILED_DETAILS; + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); throw new SystemMessageException(msg); } else @@ -240,20 +249,32 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction if (selectedFolderPath.equals(selectedParentFile.getAbsolutePath())) { - if (targetEqualsParentSrcMsg == null) - targetEqualsParentSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE); + if (targetEqualsParentSrcMsg == null){ + targetEqualsParentSrcMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + FileResources.FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE, + FileResources.FILEMSG_MOVE_TARGET_EQUALS_PARENT_OF_SOURCE_DETAILS); + + + } return targetEqualsParentSrcMsg; } else if (selectedFolderPath.equals(selectedFile.getAbsolutePath())) { - if (targetEqualsSrcMsg == null) - targetEqualsSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_SOURCE); // todo: different msg + if (targetEqualsSrcMsg == null){ + targetEqualsSrcMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + FileResources.FILEMSG_MOVE_TARGET_EQUALS_SOURCE, + FileResources.FILEMSG_MOVE_TARGET_EQUALS_SOURCE_DETAILS); + } return targetEqualsSrcMsg; } else if (selectedFolder.isDescendantOf(selectedFile)) { - if (targetDescendsFromSrcMsg == null) - targetDescendsFromSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE); + if (targetDescendsFromSrcMsg == null){ + targetDescendsFromSrcMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + FileResources.FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE, + FileResources.FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE_DETAILS); + + } return targetDescendsFromSrcMsg; } } @@ -267,7 +288,10 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction // Drives and Root Filters which we can't Move files to. if (firstFilterString.equals("*") || firstFilterString.equals("/*")) { //$NON-NLS-1$ //$NON-NLS-2$ if (invalidFilterMsg == null) { - invalidFilterMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_FILTER_NOT_VALID); + invalidFilterMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + FileResources.FILEMSG_MOVE_FILTER_NOT_VALID, + FileResources.FILEMSG_MOVE_FILTER_NOT_VALID_DETAILS); + } return invalidFilterMsg; } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java index 8f6fc1618fa..b12dc9aa449 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.actions; @@ -34,9 +35,11 @@ import org.eclipse.rse.core.subsystems.SubSystem.SystemMessageDialogRunnable; import org.eclipse.rse.files.ui.dialogs.ISaveAsDialog; import org.eclipse.rse.files.ui.dialogs.SaveAsDialog; import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -44,7 +47,6 @@ import org.eclipse.rse.services.files.RemoteFileSecurityException; import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.actions.SystemBaseAction; @@ -99,12 +101,13 @@ public class SystemUploadConflictAction extends SystemBaseAction implements Runn catch (SystemMessageException e) { SystemBasePlugin.logError("Error in performSaveAs", e); //$NON-NLS-1$ - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); + + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_ERROR_UNEXPECTED); SystemMessageDialog dialog = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), message); SystemMessageDialogRunnable runnable = ((SubSystem)fs).new SystemMessageDialogRunnable(dialog); Display.getDefault().asyncExec(runnable); } - + try { // copy temp file to remote system @@ -372,8 +375,12 @@ public class SystemUploadConflictAction extends SystemBaseAction implements Runn else { enableOkButton(false); - _errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_EMPTY); + _errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, + FileResources.MSG_VALIDATE_PATH_EMPTY, + FileResources.MSG_VALIDATE_PATH_EMPTY_DETAILS); + setErrorMessage(_errorMessage); + } } else diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java index d0c6def139a..ae04d960f97 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.propertypages; @@ -28,6 +29,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; @@ -38,14 +40,15 @@ import org.eclipse.jface.preference.PreferencePage; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager; import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants; import org.eclipse.rse.internal.ui.GenericMessages; import org.eclipse.rse.internal.ui.view.SystemTableViewProvider; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.Mnemonics; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; @@ -607,16 +610,17 @@ public class SystemCachePreferencePage extends PreferencePage implements IWorkbe List dirtyEditors = new ArrayList(); if (!getDirtyReplicas(dirtyEditors)) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CACHE_UNABLE_TO_SYNCH); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_CACHE_UNABLE_TO_SYNCH); SystemMessageDialog dlg = new SystemMessageDialog(getShell(), msg); dlg.open(); + return false; } if (dirtyEditors.size() > 0) { AdaptableList input = new AdaptableList(); - for (int i = 0; i < dirtyEditors.size(); i++) + for (int i = 0; i < dirtyEditors.size(); i++) { ISystemEditableRemoteObject rmtObj = (ISystemEditableRemoteObject) dirtyEditors.get(i); input.add(rmtObj.getRemoteObject()); @@ -625,7 +629,7 @@ public class SystemCachePreferencePage extends PreferencePage implements IWorkbe WorkbenchContentProvider cprovider = new WorkbenchContentProvider(); SystemTableViewProvider lprovider = new SystemTableViewProvider(); - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CACHE_UPLOAD_BEFORE_DELETE); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_CACHE_UPLOAD_BEFORE_DELETE); ListSelectionDialog dlg = new ListSelectionDialog(getShell(), input, cprovider, lprovider, msg.getLevelOneText()); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java index b437c9b7be0..25afc319e9f 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java @@ -22,6 +22,7 @@ * Kevin Doyle (IBM) - [186125] Changing encoding of a file is not reflected when it was opened before * David McKnight (IBM) - [209660] use parent encoding as default, rather than system encoding * David McKnight (IBM) - [209703] apply encoding and updating remote file when apply on property page + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.files.ui.propertypages; @@ -33,14 +34,18 @@ import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.SystemResourceChangeEvent; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; import org.eclipse.rse.services.files.RemoteFileSecurityException; @@ -48,8 +53,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileEncodingManager; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; import org.eclipse.rse.ui.view.ISystemEditableRemoteObject; @@ -543,10 +546,14 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage } } catch (RemoteFileIOException exc) { - setMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IO_ERROR)); + String msgDetails = NLS.bind(FileResources.FILEMSG_IO_ERROR_DETAILS, exc.getMessage()); + setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.FILEMSG_IO_ERROR, msgDetails)); + } catch (RemoteFileSecurityException exc) { - setMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR)); + String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, exc.getMessage()); + setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.FILEMSG_SECURITY_ERROR, msgDetails)); + } catch (SystemMessageException e) { setMessage(e.getSystemMessage()); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java index 57f60922a4b..2c096620cb8 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java @@ -16,6 +16,7 @@ * Kevin Doyle (IBM) - [189430] Limited System Types displayed in Folder Dialog * Kevin Doyle (IBM) - [187427] Selecting an Archive will check Search Archives checkbox * Martin Oberhuber (Wind River) - [196936] Hide disabled system types + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.search; @@ -28,22 +29,26 @@ import java.util.LinkedList; import java.util.List; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.ui.view.search.SystemSearchUI; import org.eclipse.rse.internal.ui.view.search.SystemSearchViewPart; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.search.SystemSearchUtil; @@ -55,7 +60,6 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSyst import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.Mnemonics; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; @@ -671,9 +675,13 @@ public class SystemSearchPage extends DialogPage implements ISearchPage { if (searchString != null && searchString.length() != 0) { if (!util.isValidRegex(searchString)) { - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_REMOTE_SEARCH_INVALID_REGEX); - message.makeSubstitution(searchString); + + String msgTxt = FileResources.MSG_REMOTE_SEARCH_INVALID_REGEX; + String msgDetails = NLS.bind(FileResources.MSG_REMOTE_SEARCH_INVALID_REGEX_DETAILS, searchString); + + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(getShell(), message); + stringCombo.setFocus(); return false; } @@ -688,9 +696,12 @@ public class SystemSearchPage extends DialogPage implements ISearchPage { if (fileNameString != null && fileNameString.length() != 0) { if (!util.isValidRegex(fileNameString)) { - SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_REMOTE_SEARCH_INVALID_REGEX); - message.makeSubstitution(fileNameString); - SystemMessageDialog.displayErrorMessage(getShell(), message); + String msgTxt = FileResources.MSG_REMOTE_SEARCH_INVALID_REGEX; + String msgDetails = NLS.bind(FileResources.MSG_REMOTE_SEARCH_INVALID_REGEX_DETAILS, fileNameString); + + SystemMessage message = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + SystemMessageDialog.displayErrorMessage(getShell(), message); + fileNameCombo.setFocus(); return false; } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java index ad5081fd492..942725d77dc 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java @@ -74,6 +74,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.SystemResourceChangeEvent; @@ -94,6 +95,7 @@ import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile; import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.actions.SystemCompareFilesAction; import org.eclipse.rse.internal.files.ui.actions.SystemCompareWithEditionAction; @@ -117,6 +119,7 @@ import org.eclipse.rse.services.clientserver.StringCompare; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.IFilePermissionsService; @@ -143,7 +146,6 @@ import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemIconConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemMenuManager; @@ -226,8 +228,8 @@ public class SystemViewRemoteFileAdapter private static PropertyDescriptor[] archiveDescriptorArray = null; private static PropertyDescriptor[] virtualDescriptorArray = null; - static final SystemMessage _uploadMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UPLOADING_PROGRESS); - static final SystemMessage _downloadMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DOWNLOADING_PROGRESS); + static final String _uploadMessage = FileResources.MSG_UPLOADING_PROGRESS; + static final String _downloadMessage = FileResources.MSG_DOWNLOADING_PROGRESS; /** * Constructor @@ -748,13 +750,15 @@ public class SystemViewRemoteFileAdapter catch (InterruptedException exc) { children = new SystemMessageObject[1]; - children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED), ISystemMessageObject.MSGTYPE_CANCEL, element); - //System.out.println("Canceled."); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, FileResources.MSG_EXPAND_CANCELLED); + children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element); } catch (Exception exc) { children = new SystemMessageObject[1]; - children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED), ISystemMessageObject.MSGTYPE_ERROR, element); + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, FileResources.MSG_EXPAND_FAILED); + children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element); SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$ } // message already issued } @@ -1636,7 +1640,7 @@ public class SystemViewRemoteFileAdapter if (monitor != null) { - monitor.beginTask(_downloadMessage.getLevelOneText(), (int)totalByteSize); + monitor.beginTask(_downloadMessage, (int)totalByteSize); //monitor.done(); } @@ -1950,9 +1954,11 @@ public class SystemViewRemoteFileAdapter if (!targetFolder.canWrite()) { - SystemMessage errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR); - errorMsg.makeSubstitution(targetFS.getHostAliasName()); + String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; + String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); + SystemMessage errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); resultSet.setMessage(errorMsg); + return resultSet; } @@ -1975,7 +1981,7 @@ public class SystemViewRemoteFileAdapter if (monitor != null) { int size = (int)totalByteSize; - monitor.beginTask(_uploadMessage.getLevelOneText(), size); + monitor.beginTask(_uploadMessage, size); } // back to hierarchy resultSet = UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true); @@ -2003,13 +2009,14 @@ public class SystemViewRemoteFileAdapter } } } - //getMessage("RSEG1125").makeSubstitution(movedFileName)); + if (copiedFileNames != null) { - SystemMessage thisMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_INTERRUPTED); - thisMessage.makeSubstitution(copiedFileNames); + String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; + String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); + + SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); resultSet.setMessage(thisMessage); - //SystemMessageDialog.displayErrorMessage(shell, thisMessage); } } } @@ -2084,8 +2091,11 @@ public class SystemViewRemoteFileAdapter IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i); if (!srcFileOrFolder.exists()) { - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), srcFileOrFolder.getSystemConnection().getAliasName()); + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, + srcFileOrFolder.getAbsolutePath(), + srcFileOrFolder.getSystemConnection().getAliasName()); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); resultSet.setMessage(errorMessage); return resultSet; } @@ -2165,8 +2175,10 @@ public class SystemViewRemoteFileAdapter else { // need a failed message here - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_FILE_FAILED); - msg.makeSubstitution(srcFileOrFolder.getAbsolutePath()); + String msgTxt = NLS.bind(FileResources.FILEMSG_COPY_FILE_FAILED, srcFileOrFolder.getAbsolutePath()); + String msgDetails = FileResources.FILEMSG_COPY_FILE_FAILED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); resultSet.setMessage(msg); } } @@ -2191,8 +2203,10 @@ public class SystemViewRemoteFileAdapter //getMessage("RSEG1125").makeSubstitution(movedFileName)); if (copiedFileNames != null) { - SystemMessage thisMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_INTERRUPTED); - thisMessage.makeSubstitution(copiedFileNames); + String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; + String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); + + SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(shell, thisMessage); } else @@ -2264,9 +2278,13 @@ public class SystemViewRemoteFileAdapter thisObject = resultSet.get(i); copiedFileNames = copiedFileNames + "\n" + ((IRemoteFile)resultSet.get(i)).getName(); //$NON-NLS-1$ } - SystemMessage thisMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_INTERRUPTED); - thisMessage.makeSubstitution(copiedFileNames); + + String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; + String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); + + SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(shell, thisMessage); + } else { @@ -2329,8 +2347,12 @@ public class SystemViewRemoteFileAdapter if (!targetFolder.canWrite()) { - SystemMessage errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR); - errorMsg.makeSubstitution(targetFS.getHostAliasName()); + String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; + String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); + SystemMessage errorMsg = null; + + errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + return errorMsg; } @@ -2437,13 +2459,17 @@ public class SystemViewRemoteFileAdapter IRemoteFile srcFileOrFolder = (IRemoteFile) src; if (!srcFileOrFolder.exists()) { - SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND); - errorMessage.makeSubstitution(srcFileOrFolder.getAbsolutePath(), srcFileOrFolder.getSystemConnection().getAliasName()); - return errorMessage; + String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, + srcFileOrFolder.getAbsolutePath(), + srcFileOrFolder.getSystemConnection().getAliasName()); + + SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); + return errorMessage; } - SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS); - copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getAbsolutePath()); + String msgTxt = NLS.bind(FileResources.MSG_COPY_PROGRESS, srcFileOrFolder.getName(), targetFolder.getAbsolutePath()); + SystemMessage copyMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.INFO, msgTxt); + IRemoteFileSubSystem localFS = srcFileOrFolder.getParentRemoteFileSubSystem(); @@ -2678,7 +2704,11 @@ public class SystemViewRemoteFileAdapter catch (Exception exc) { ok = false; - SystemMessageDialog.displayErrorMessage(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_DELETE_FILE_FAILED).makeSubstitution(file.toString())); + String msgTxt = NLS.bind(FileResources.FILEMSG_DELETE_FILE_FAILED, file.toString()); + String msgDetails = FileResources.FILEMSG_DELETE_FILE_FAILED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + SystemMessageDialog.displayErrorMessage(shell, msg); } return ok; } @@ -2717,7 +2747,12 @@ public class SystemViewRemoteFileAdapter catch (Exception exc) { ok = false; - SystemMessageDialog.displayErrorMessage(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_DELETE_FILE_FAILED).makeSubstitution(file.toString())); + ok = false; + String msgTxt = NLS.bind(FileResources.FILEMSG_DELETE_FILE_FAILED, file.toString()); + String msgDetails = FileResources.FILEMSG_DELETE_FILE_FAILED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + SystemMessageDialog.displayErrorMessage(shell, msg); } } if (ss != null) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java index f795603eb3e..691fe9738ad 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.view; @@ -23,14 +24,14 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.services.clientserver.messages.SystemMessage; +import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.services.search.IHostSearchResultSet; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteSearchResult; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResultsContentsType; import org.eclipse.rse.ui.ISystemIconConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemMenuManager; import org.eclipse.rse.ui.view.AbstractSystemViewAdapter; @@ -102,25 +103,25 @@ public class SystemViewRemoteSearchResultSetAdapter extends AbstractSystemViewAd IHostSearchResultSet set = (IHostSearchResultSet)element; String name = set.getName(); - SystemMessage msg = null; + String msg = null; if (set.isRunning()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_RUNNING); + msg = FileResources.MSG_OPERATION_RUNNING; } else if (set.isFinished()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FINISHED); + msg = FileResources.MSG_OPERATION_FINISHED; } else if (set.isCancelled()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERTION_STOPPED); + msg = FileResources.MSG_OPERTION_STOPPED; } else if (set.isDisconnected()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_DISCONNECTED); + msg = FileResources.MSG_OPERATION_DISCONNECTED; } if (msg != null) { - msg.makeSubstitution(name); - return msg.getLevelOneText(); + msg = NLS.bind(msg, name); + return msg; } } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java index 94beab33725..94a1a40ea0e 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java @@ -15,6 +15,7 @@ * Rupen Mardirossian (IBM) - [187530] Commented out line 192, in order to stop logging of SystemMessageException * Martin Oberhuber (Wind River) - [204669] Fix ftp path concatenation on systems using backslash separator * Xuan Chen (IBM) - [209828] Need to move the Create operation to a job. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.wizards; @@ -27,6 +28,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemRemoteChangeEvents; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; @@ -36,8 +38,10 @@ import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -48,7 +52,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile; import org.eclipse.rse.ui.ISystemIconConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -105,13 +108,21 @@ public class SystemNewFileWizard { ok = false; SystemBasePlugin.logDebugMessage(CLASSNAME+ ":", " Creating remote file "+ absName + " failed with RemoteFileIOException " ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - msg = (RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_FILE_FAILED_EXIST)).makeSubstitution(absName); + String msgTxt = FileResources.FILEMSG_CREATE_FILE_FAILED; + String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_FILE_FAILED_DETAILS, absName); + + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(null, msg); } catch (RemoteFileSecurityException e) { ok = false; - msg = (RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_FILE_FAILED)).makeSubstitution(absName); + String msgTxt = FileResources.FILEMSG_CREATE_FILE_FAILED; + String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_FILE_FAILED_DETAILS, absName); + + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + + SystemBasePlugin.logDebugMessage(CLASSNAME+ ":", " Creating remote file "+ absName + " failed with RemoteFileSecurityException "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ SystemMessageDialog.displayErrorMessage(null, msg); } @@ -230,7 +241,8 @@ public class SystemNewFileWizard else */ { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_FOLDER_NOTFOUND); + String msgTxt = NLS.bind(FileResources.FILEMSG_FOLDER_NOTFOUND, parentFolder.getAbsolutePath()); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); msg.makeSubstitution(parentFolder.getAbsolutePath()); mainPage.setMessage(msg); return false; @@ -244,9 +256,9 @@ public class SystemNewFileWizard return false; } // ok, proceed with actual creation... - SystemMessage createMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CREATEFILEGENERIC_PROGRESS); - createMessage.makeSubstitution(name); - CreateNewFileJob createNewFileJob = new CreateNewFileJob(parentFolder, name, absName, createMessage.getLevelOneText()); + + String msgTxt = NLS.bind(FileResources.MSG_CREATEFILEGENERIC_PROGRESS, name); + CreateNewFileJob createNewFileJob = new CreateNewFileJob(parentFolder, name, absName, msgTxt); createNewFileJob.schedule(); } return ok; @@ -311,7 +323,10 @@ public class SystemNewFileWizard if (!meets) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_RESOURCE_NOTVISIBLE); + String msgTxt = FileResources.FILEMSG_CREATE_RESOURCE_NOTVISIBLE; + String msgDetails = FileResources.FILEMSG_CREATE_RESOURCE_NOTVISIBLE_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), msg); if (msgDlg.openQuestionNoException()) // ask user if they want to proceed meets = true; // they do, so pretend it meets the criteria diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java index a24596c96a2..c2a0588ca97 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * David Dykstal (IBM) - [188718] fix error messages showing up as info messages on wizard page * Xuan Chen (IBM) - [209828] Need to move the Create operation to a job. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.files.ui.wizards; @@ -22,9 +23,12 @@ import org.eclipse.core.resources.WorkspaceJob; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.internal.files.ui.Activator; import org.eclipse.rse.internal.files.ui.FileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -32,7 +36,6 @@ import org.eclipse.rse.services.files.RemoteFileSecurityException; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.ui.ISystemIconConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -88,13 +91,17 @@ public class SystemNewFolderWizard { ok = false; SystemBasePlugin.logDebugMessage(CLASSNAME+ ":", " Creating remote file "+ absName + " failed with RemoteFileIOException " ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - msg = (RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_FOLDER_FAILED_EXIST)).makeSubstitution(absName); + String msgTxt = FileResources.FILEMSG_CREATE_FILE_FAILED_EXIST; + String msgDetails = NLS.bind(FileResources.FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS, absName); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.displayErrorMessage(null, msg); } catch (RemoteFileSecurityException e) { ok = false; - msg = (RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_FOLDER_FAILED)).makeSubstitution(absName); + String msgTxt = FileResources.FILEMSG_CREATE_FOLDER_FAILED_EXIST; + String msgDetails = NLS.bind(FileResources.FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS, absName); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemBasePlugin.logDebugMessage(CLASSNAME+ ":", " Creating remote folder "+ absName + " failed with RemoteFileSecurityException "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ SystemMessageDialog.displayErrorMessage(null, msg); } @@ -212,8 +219,9 @@ public class SystemNewFolderWizard else */ { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_FOLDER_NOTFOUND); - msg.makeSubstitution(parentFolder.getAbsolutePath()); + String msgTxt = NLS.bind(FileResources.FILEMSG_FILE_NOTFOUND, parentFolder.getAbsolutePath()); + msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); + mainPage.setMessage(msg); return false; } @@ -227,9 +235,9 @@ public class SystemNewFolderWizard } // ok, proceed with actual creation... - SystemMessage createMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CREATEFOLDERGENERIC_PROGRESS); - createMessage.makeSubstitution(name); - CreateNewFolderJob createNewFolderJob = new CreateNewFolderJob(parentFolder, name, absName, createMessage.getLevelOneText()); + String msgTxt = NLS.bind(FileResources.MSG_CREATEFOLDERGENERIC_PROGRESS, name); + + CreateNewFolderJob createNewFolderJob = new CreateNewFolderJob(parentFolder, name, absName, msgTxt); createNewFolderJob.schedule(); } @@ -273,7 +281,10 @@ public class SystemNewFolderWizard } if (!meets) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_RESOURCE_NOTVISIBLE); + String msgTxt = FileResources.FILEMSG_CREATE_RESOURCE_NOTVISIBLE; + String msgDetails = FileResources.FILEMSG_CREATE_RESOURCE_NOTVISIBLE_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.WARNING, msgTxt, msgDetails); SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), msg); if (msgDlg.openQuestionNoException()) // ask user if they want to proceed meets = true; // they do, so pretend it meets the criteria diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java index 2925ffb2789..bc6b380abf8 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport; @@ -30,6 +30,53 @@ public class RemoteImportExportResources extends NLS { public static String WizardDataTransfer_overwriteNameAndPathQuestion; public static String WizardDataTransfer_exceptionMessage; public static String Question; + + + public static String FILEMSG_COPY_ROOT; + public static String FILEMSG_COPY_ROOT_DETAILS; + + public static String FILEMSG_IMPORT_ERROR; + public static String FILEMSG_IMPORT_PROBLEMS; + public static String FILEMSG_IMPORT_SELF; + public static String FILEMSG_IMPORT_SELF_DETAILS; + public static String FILEMSG_EXPORT_ERROR; + public static String FILEMSG_EXPORT_PROBLEMS; + public static String FILEMSG_NOT_WRITABLE; + public static String FILEMSG_NOT_WRITABLE_DETAILS; + + public static String FILEMSG_TARGET_EXISTS; + public static String FILEMSG_TARGET_EXISTS_DETAILS; + public static String FILEMSG_FOLDER_IS_FILE; + public static String FILEMSG_FOLDER_IS_FILE_DETAILS; + public static String FILEMSG_DESTINATION_CONFLICTING; + public static String FILEMSG_DESTINATION_CONFLICTING_DETAILS; + public static String FILEMSG_SOURCE_IS_FILE; + public static String FILEMSG_SOURCE_IS_FILE_DETAILS; + public static String FILEMSG_SOURCE_EMPTY; + public static String FILEMSG_SOURCE_EMPTY_DETAILS; + public static String FILEMSG_EXPORT_FAILED; + public static String FILEMSG_EXPORT_NONE_SELECTED; + public static String FILEMSG_EXPORT_NONE_SELECTED_DETAILS; + public static String FILEMSG_DESTINATION_EMPTY; + public static String FILEMSG_DESTINATION_EMPTY_DETAILS; + public static String FILEMSG_IMPORT_FAILED; + public static String FILEMSG_IMPORT_NONE_SELECTED; + public static String FILEMSG_IMPORT_NONE_SELECTED_DETAILS; + public static String FILEMSG_IMPORT_FILTERING; + + public static String FILEMSG_CREATE_FOLDER_FAILED; + public static String FILEMSG_CREATE_FOLDER_FAILED_DETAILS; + + // file import/export messages + public static String MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION; + public static String MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION; + public static String MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION_DETAILS; + public static String MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION_DETAILS; + + // Unexpected error message + public static String MSG_ERROR_UNEXPECTED; + + static { // load message values from bundle file NLS.initializeMessages(BUNDLE_NAME, RemoteImportExportResources.class); diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties index 9b4734c15d6..9febd968997 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties @@ -6,7 +6,7 @@ # http://www.eclipse.org/legal/epl-v10.html # # Contributors: -# IBM Corporation - initial API and implementation +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -37,3 +37,59 @@ WizardDataTransfer_existsQuestion = ''{0}'' already exists. Would you like to o WizardDataTransfer_overwriteNameAndPathQuestion = Overwrite ''{0}'' in folder ''{1}''? WizardDataTransfer_exceptionMessage = Error occurred during operation: {0} Question = Question + + +FILEMSG_COPY_ROOT = Can not copy root file system +FILEMSG_COPY_ROOT_DETAILS=The root is not something that can be copied + +FILEMSG_IMPORT_ERROR = Unable to import {0}: {1} +FILEMSG_IMPORT_PROBLEMS = Problems were encountered during import + +FILEMSG_IMPORT_SELF = Unable to import {0} +FILEMSG_IMPORT_SELF_DETAILS=The file cannot be copied onto itself +FILEMSG_EXPORT_ERROR = Error occurred while exporting {0}: {1} +FILEMSG_EXPORT_PROBLEMS = Problems were encountered during export +FILEMSG_NOT_WRITABLE = Cannot overwrite file {0} +FILEMSG_NOT_WRITABLE_DETAILS = The file does not have its write attribute set, so it cannot be written to + +FILEMSG_TARGET_EXISTS = Target folder does not exist. Would you like to create it? +FILEMSG_TARGET_EXISTS_DETAILS =Press Yes to create the folder {0}, No to cancel + +FILEMSG_FOLDER_IS_FILE =Target folder already exists, as a file +FILEMSG_FOLDER_IS_FILE_DETAILS=The remote resource {0} already exists, but as a file, not a folder + +FILEMSG_DESTINATION_CONFLICTING = Destination folder conflicts with location of {0} +FILEMSG_DESTINATION_CONFLICTING_DETAILS =You are attempting to export to the local file system, to a location that overlaps the resources being exported. + +FILEMSG_SOURCE_IS_FILE = Source is a file, not a folder +FILEMSG_SOURCE_IS_FILE_DETAILS=The remote resource {0} is a file, but a folder is required< + +FILEMSG_SOURCE_EMPTY = Enter or select a source folder +FILEMSG_SOURCE_EMPTY_DETAILS =You have left the source folder empty, but it must be set to continue. + +FILEMSG_EXPORT_FAILED =Export problems +FILEMSG_EXPORT_NONE_SELECTED = There are no resources currently selected for export +FILEMSG_EXPORT_NONE_SELECTED_DETAILS =Select resources to be exported and try again + +FILEMSG_DESTINATION_EMPTY = Please enter a destination folder +FILEMSG_DESTINATION_EMPTY_DETAILS = The destination folder is empty. You must select a destination folder. + +FILEMSG_IMPORT_FAILED = Import problems +FILEMSG_IMPORT_NONE_SELECTED = There are no resources currently selected for import +FILEMSG_IMPORT_NONE_SELECTED_DETAILS = Select resources to be imported and try again + +FILEMSG_IMPORT_FILTERING = Filtering selection...; + +FILEMSG_CREATE_FOLDER_FAILED = Creation of the folder failed +FILEMSG_CREATE_FOLDER_FAILED_DETAILS = The folder {0} could not be created because of one of the following reasons: + - the user does not have enough authority to create the folder + - the folder name is not valid + + +MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION = Unable to use connection. +MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION_DETAILS = Please correct, or select alternate connection. + +MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION =Unexpected exception received: {0}. +MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION_DETAILS =Please see error log for details. + +MSG_ERROR_UNEXPECTED = An unexpected error occurred. diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java index 804967b81b6..0b4f8195bdf 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -29,16 +30,16 @@ import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; import org.eclipse.rse.internal.importexport.RemoteImportExportResources; import org.eclipse.rse.internal.importexport.RemoteImportExportUtil; import org.eclipse.rse.internal.importexport.SystemImportExportResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -93,7 +94,10 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste private static final String STORE_CREATE_DESCRIPTION_FILE_ID = "RemoteExportWizard.STORE_CREATE_DESCRIPTION_FILE_ID"; //$NON-NLS-1$ private static final String STORE_DESCRIPTION_FILE_NAME_ID = "RemoteExportWizard.STORE_DESCRIPTION_FILE_NAME_ID"; //$NON-NLS-1$ //messages - private static final SystemMessage DESTINATION_EMPTY_MESSAGE = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_DESTINATION_EMPTY); //UniversalSystemPlugin.getString("IFSexport.destinationEmpty"); + private static final SystemMessage DESTINATION_EMPTY_MESSAGE = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, + RemoteImportExportResources.FILEMSG_DESTINATION_EMPTY, + RemoteImportExportResources.FILEMSG_DESTINATION_EMPTY_DETAILS); + /** * Create an instance of this class @@ -271,12 +275,18 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste */ protected boolean ensureDirectoryExists(File directory) { if (!directory.exists()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_TARGET_EXISTS); - msg.makeSubstitution(directory.getAbsolutePath()); + + String msgTxt = RemoteImportExportResources.FILEMSG_TARGET_EXISTS; + String msgDetails = NLS.bind(RemoteImportExportResources.FILEMSG_TARGET_EXISTS_DETAILS, directory.getAbsolutePath()); + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog dlg = new SystemMessageDialog(getContainer().getShell(), msg); if (!dlg.openQuestionNoException()) return false; if (!directory.mkdirs()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_CREATE_FOLDER_FAILED); + msgTxt = RemoteImportExportResources.FILEMSG_CREATE_FOLDER_FAILED; + msgDetails = NLS.bind(RemoteImportExportResources.FILEMSG_CREATE_FOLDER_FAILED_DETAILS, directory.getAbsolutePath()); + + msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); msg.makeSubstitution(directory.getAbsolutePath()); setErrorMessage(msg); giveFocusToDestination(); @@ -295,8 +305,11 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste */ protected boolean ensureTargetIsValid(File targetDirectory) { if (targetDirectory.exists() && !targetDirectory.isDirectory()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SOURCE_IS_FILE); - msg.makeSubstitution(targetDirectory.getAbsolutePath()); + String msgTxt = RemoteImportExportResources.FILEMSG_SOURCE_IS_FILE; + String msgDetails = NLS.bind(RemoteImportExportResources.FILEMSG_SOURCE_IS_FILE_DETAILS, targetDirectory.getAbsolutePath()); + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + setErrorMessage(msg); giveFocusToDestination(); return false; @@ -326,8 +339,8 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste } IStatus status = op.getStatus(); if (!status.isOK()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_EXPORT_FAILED); - msg.makeSubstitution(status); + String msgTxt = NLS.bind(RemoteImportExportResources.FILEMSG_EXPORT_FAILED, status); + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); SystemMessageDialog dlg = new SystemMessageDialog(getContainer().getShell(), msg); dlg.openWithDetails(); return false; @@ -368,7 +381,11 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste ret = executeExportOperation(new RemoteFileExportOperation(data, this)); return ret; } - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_EXPORT_NONE_SELECTED); + + String msgTxt = RemoteImportExportResources.FILEMSG_EXPORT_NONE_SELECTED; + String msgDetails = RemoteImportExportResources.FILEMSG_EXPORT_NONE_SELECTED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); setErrorMessage(msg); return false; } @@ -508,7 +525,9 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste protected boolean isDestinationFolder() { boolean ret = destinationFolder != null; if (!ret) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION); + String msgTxt = RemoteImportExportResources.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION; + String msgDetails = RemoteImportExportResources.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION_DETAILS; + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.show(getShell(), msg); } return ret; @@ -637,8 +656,10 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste } String conflictingContainer = getConflictingContainerNameFor(destinationValue); if (conflictingContainer != null) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_DESTINATION_CONFLICTING); - msg.makeSubstitution(conflictingContainer); + String msgTxt = NLS.bind(RemoteImportExportResources.FILEMSG_DESTINATION_CONFLICTING, conflictingContainer); + String msgDetails = RemoteImportExportResources.FILEMSG_DESTINATION_CONFLICTING_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); setErrorMessage(msg); giveFocusToDestination(); return false; @@ -836,8 +857,9 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste if (msgLine != null) msgLine.setErrorMessage(exc); else { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); - msg.makeSubstitution(exc); + String msgTxt = RemoteImportExportResources.MSG_ERROR_UNEXPECTED; + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, exc); + pendingErrorMessage = msg; super.setErrorMessage(msg.getLevelOneText()); } diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java index a319e2f08b3..704c967a689 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -23,12 +24,12 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.action.IAction; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; import org.eclipse.rse.internal.importexport.RemoteImportExportProblemDialog; import org.eclipse.rse.internal.importexport.RemoteImportExportResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.ui.PlatformUI; @@ -138,8 +139,10 @@ public class RemoteFileExportActionDelegate extends RemoteFileImportExportAction status = new Status(IStatus.OK, RemoteImportExportPlugin.getDefault().getBundle().getSymbolicName(), 0, "", e); //$NON-NLS-1$ } if (!status.isOK()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_EXPORT_FAILED); - msg.makeSubstitution(status); + String msgTxt = NLS.bind(RemoteImportExportResources.FILEMSG_EXPORT_FAILED, status); + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); + SystemMessageDialog dlg = new SystemMessageDialog(getShell(), msg); dlg.openWithDetails(); return null; diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java index 1fe1fa313d9..31624f14eb9 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java @@ -10,6 +10,7 @@ * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core * David McKnight (IBM) - [191479] refreshing destination directory after export + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -33,12 +34,14 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.SystemResourceChangeEvent; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; +import org.eclipse.rse.internal.importexport.RemoteImportExportResources; import org.eclipse.rse.internal.importexport.RemoteImportExportUtil; import org.eclipse.rse.internal.importexport.SystemImportExportResources; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -224,9 +227,9 @@ class RemoteFileExportOperation implements IRunnableWithProgress { try { targetFile = new UniFilePlus(Utilities.getIRemoteFile(conn, fullPath.toString())); } catch (NullPointerException e) { + String msg = NLS.bind(RemoteImportExportResources.FILEMSG_EXPORT_ERROR, fullPath, RemoteImportExportResources.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION); + // Assume that communication has failed. - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_EXPORT_ERROR, - new Object[] { fullPath, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION).getLevelOneText(), e }).toString(); errorTable.add(new Status(IStatus.ERROR, RemoteImportExportPlugin.getDefault().getBundle().getSymbolicName(), 0, msg, e)); throw e; } @@ -238,7 +241,7 @@ class RemoteFileExportOperation implements IRunnableWithProgress { return; } if (!targetFile.canWrite()) { - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_NOT_WRITABLE, targetFile.getAbsolutePath()).toString(); + String msg = NLS.bind(RemoteImportExportResources.FILEMSG_NOT_WRITABLE, targetFile.getAbsolutePath()); errorTable.add(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, null)); monitor.worked(1); return; @@ -378,7 +381,7 @@ class RemoteFileExportOperation implements IRunnableWithProgress { public IStatus getStatus() { IStatus[] errors = new IStatus[errorTable.size()]; errorTable.toArray(errors); - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_EXPORT_PROBLEMS).getLevelOneText(); + String msg = RemoteImportExportResources.FILEMSG_EXPORT_PROBLEMS; return new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, errors, msg, null); } diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java index 4b2e820d252..9edbcab8636 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -23,12 +24,12 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.action.IAction; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; import org.eclipse.rse.internal.importexport.RemoteImportExportProblemDialog; import org.eclipse.rse.internal.importexport.RemoteImportExportResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.ui.PlatformUI; @@ -138,8 +139,8 @@ public class RemoteFileImportActionDelegate extends RemoteFileImportExportAction status = new Status(IStatus.OK, RemoteImportExportPlugin.getDefault().getBundle().getSymbolicName(), 0, "", e); //$NON-NLS-1$ } if (!status.isOK()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_FAILED); - msg.makeSubstitution(status); + String msgTxt = NLS.bind(RemoteImportExportResources.FILEMSG_IMPORT_FAILED, status); + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); SystemMessageDialog dlg = new SystemMessageDialog(getShell(), msg); dlg.openWithDetails(); return null; diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java index b7116e8b482..11bbf6f3132 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -35,6 +36,7 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; +import org.eclipse.rse.internal.importexport.RemoteImportExportResources; import org.eclipse.rse.internal.importexport.RemoteImportExportUtil; import org.eclipse.rse.internal.importexport.SystemImportExportResources; import org.eclipse.rse.services.files.RemoteFileIOException; @@ -416,7 +418,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation { IStatus[] errors = new IStatus[errorTable.size()]; errorTable.toArray(errors); // IFS: - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_PROBLEMS).getLevelOneText(); + String msg = RemoteImportExportResources.FILEMSG_IMPORT_PROBLEMS; return new MultiStatus(RemoteImportExportPlugin.getDefault().getBundle().getSymbolicName(), IStatus.OK, errors, msg, null); } @@ -509,7 +511,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation { // If we don't have a parent then we have selected the // file systems root. Roots can't copied (at least not // under windows). - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_COPY_ROOT).toString(); + String msg = RemoteImportExportResources.FILEMSG_COPY_ROOT; errorTable.add(new Status(IStatus.INFO, RemoteImportExportPlugin.getDefault().getBundle().getSymbolicName(), 0, msg, null)); continue; } diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java index 9f3de6bd639..f1b3d60c67e 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java @@ -9,6 +9,7 @@ * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -37,16 +38,16 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.window.Window; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction; import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; import org.eclipse.rse.internal.importexport.RemoteImportExportResources; import org.eclipse.rse.internal.importexport.RemoteImportExportUtil; import org.eclipse.rse.internal.importexport.SystemImportExportResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -114,7 +115,11 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen private static final String STORE_CREATE_DESCRIPTION_FILE_ID = "RemoteImportWizardPage1.STORE_CREATE_DESCRIPTION_FILE_ID"; //$NON-NLS-1$ private static final String STORE_DESCRIPTION_FILE_NAME_ID = "RemoteImportWizardPage1.STORE_DESCRIPTION_FILE_NAME_ID"; //$NON-NLS-1$ // messages - protected static final SystemMessage SOURCE_EMPTY_MESSAGE = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SOURCE_EMPTY); + protected static final SystemMessage SOURCE_EMPTY_MESSAGE = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, + IStatus.ERROR, + RemoteImportExportResources.FILEMSG_SOURCE_EMPTY, + RemoteImportExportResources.FILEMSG_SOURCE_EMPTY_DETAILS); + /** * Creates an instance of this class @@ -411,8 +416,10 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen */ protected boolean ensureSourceIsValid() { if (((File) sourceDirectory).isDirectory()) return true; - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_FOLDER_IS_FILE); - msg.makeSubstitution(((File) sourceDirectory).getAbsolutePath()); + String msgTxt = RemoteImportExportResources.FILEMSG_FOLDER_IS_FILE; + String msgDetails = NLS.bind(RemoteImportExportResources.FILEMSG_FOLDER_IS_FILE_DETAILS, ((File)sourceDirectory).getAbsolutePath()); + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); setErrorMessage(msg); sourceNameField.setFocus(); return false; @@ -432,8 +439,9 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen } IStatus status = op.getStatus(); if (!status.isOK()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_FAILED); - msg.makeSubstitution(status); + String msgTxt = NLS.bind(RemoteImportExportResources.FILEMSG_IMPORT_FAILED, status); + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); + SystemMessageDialog dlg = new SystemMessageDialog(getContainer().getShell(), msg); dlg.openWithDetails(); return false; @@ -481,7 +489,10 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen boolean ret = executeImportOperation(new RemoteFileImportOperation(data, FileSystemStructureProvider.INSTANCE, this)); return ret; } - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_NONE_SELECTED); + String msgTxt = RemoteImportExportResources.FILEMSG_IMPORT_NONE_SELECTED; + String msgDetails = RemoteImportExportResources.FILEMSG_IMPORT_NONE_SELECTED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); setErrorMessage(msg); return false; } @@ -956,7 +967,8 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(final IProgressMonitor monitor) throws InterruptedException { - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_FILTERING).getLevelOneText(); + + String msg = RemoteImportExportResources.FILEMSG_IMPORT_FILTERING; monitor.beginTask(msg, IProgressMonitor.UNKNOWN); getSelectedResources(filter, monitor); } @@ -1028,7 +1040,7 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(final IProgressMonitor monitor) throws InterruptedException { - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IMPORT_FILTERING).getLevelOneText(); + String msg = RemoteImportExportResources.FILEMSG_IMPORT_FILTERING; monitor.beginTask(msg, IProgressMonitor.UNKNOWN); getSelectedResources(filter, monitor); } @@ -1318,8 +1330,9 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen if (msgLine != null) msgLine.setErrorMessage(exc); else { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); - msg.makeSubstitution(exc); + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, + RemoteImportExportResources.MSG_ERROR_UNEXPECTED, exc); pendingErrorMessage = msg; } } diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/Utilities.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/Utilities.java index bfbc65dfe64..a58f1860a0d 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/Utilities.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/Utilities.java @@ -9,20 +9,24 @@ * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [180562][api] dont implement IRemoteImportExportConstants * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.internal.importexport.IRemoteImportExportConstants; +import org.eclipse.rse.internal.importexport.RemoteImportExportPlugin; +import org.eclipse.rse.internal.importexport.RemoteImportExportResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.swt.widgets.Shell; @@ -89,7 +93,11 @@ public class Utilities { if (sc == null) { // invalid connection ret = false; - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION); + + String msgTxt = RemoteImportExportResources.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION; + String msgDetails = RemoteImportExportResources.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.show(s, msg); //displayMessage(s, ISystemMessages.MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION, true); } @@ -204,11 +212,11 @@ public class Utilities { } } else { o = new Object[] { e.getLocalizedMessage() == null ? e.toString() : e.getLocalizedMessage() }; - logExceptionError(ISystemMessages.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION, o, e); + logExceptionError(NLS.bind(RemoteImportExportResources.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION, o), e); if (s != null) { - //displayMessage(s, ISystemMessages.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION, o, false); - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION); - msg.makeSubstitution(o[0]); + String msgTxt = NLS.bind(RemoteImportExportResources.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION, o[0]); + String msgDetails = RemoteImportExportResources.MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION_DETAILS; + SystemMessage msg = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); SystemMessageDialog.show(s, msg); } } @@ -224,15 +232,9 @@ public class Utilities { return s; } - public static void logExceptionError(String msgId, Throwable exception) { - String msg = msgId + " " + RSEUIPlugin.getPluginMessage(msgId).getLevelOneText(); //$NON-NLS-1$ - SystemBasePlugin.logError(msg, exception); + public static void logExceptionError(String msgTxt, Throwable exception) { + SystemBasePlugin.logError(msgTxt, exception); } - public static void logExceptionError(String msgId, Object[] subs, Throwable exception) { - SystemMessage sysMsg = RSEUIPlugin.getPluginMessage(msgId); - sysMsg.makeSubstitution(subs); - String msg = msgId + " " + sysMsg.getLevelOneText(); //$NON-NLS-1$ - SystemBasePlugin.logError(msg, exception); - } + } diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java index 3ffcc28ab4c..75130065b9a 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [180519][api] declaratively register rse.processes.ui adapter factories + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.processes.ui; @@ -31,6 +32,9 @@ import org.osgi.framework.BundleContext; * The main plugin class to be used in the desktop. */ public class ProcessesPlugin extends SystemBasePlugin { + + public static final String PLUGIN_ID = "org.eclipse.rse.processes.ui"; + //The shared instance. private static ProcessesPlugin plugin; //Resource bundle. diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java index 3e41e9fae45..14b99eeeaf8 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.processes.ui; @@ -84,6 +84,13 @@ public class SystemProcessesResources extends NLS public static String RESID_REMOTE_PROCESSES_EXECUTABLE_LABEL; public static String RESID_REMOTE_PROCESSES_EXECUTABLE_TOOLTIP; + public static String MSG_OPERATION_FAILED; + public static String MSG_OPERATION_CANCELLED; + public static String MSG_EXPAND_FAILED; + + public static String MSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE; + + static { // load message values from bundle file NLS.initializeMessages(BUNDLE_NAME, SystemProcessesResources.class); diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties index a48e18653d1..17b4dfd2276 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties @@ -12,7 +12,7 @@ # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # # Contributors: -# {Name} (company) - description of contribution. +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -80,3 +80,11 @@ RESID_KILL_COLHDG_PID=Process ID #============================================================= RESID_REMOTE_PROCESSES_EXECUTABLE_LABEL=Executable RESID_REMOTE_PROCESSES_EXECUTABLE_TOOLTIP=Name of executable + +# generic messages +MSG_OPERATION_FAILED = Operation failed with exception '{0}' +MSG_OPERATION_CANCELLED = Operation canceled. +MSG_EXPAND_FAILED = Expand failed. Try again + +MSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE= Filter string '{0}' already exists in this filter + diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java index 247316d0270..6e6525e6e3e 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.processes.ui.actions; @@ -24,11 +25,13 @@ import java.util.List; import java.util.Vector; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.SystemResourceChangeEvent; @@ -38,13 +41,13 @@ import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.processes.ui.ProcessesPlugin; import org.eclipse.rse.internal.processes.ui.SystemProcessesResources; import org.eclipse.rse.internal.processes.ui.dialogs.SystemKillDialog; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; import org.eclipse.rse.ui.ISystemContextMenuConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.actions.SystemBaseAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction; @@ -327,9 +330,9 @@ public class SystemKillProcessAction extends SystemBaseDialogAction implements I String msg = exc.getMessage(); if ((msg == null) || (exc instanceof ClassCastException)) msg = exc.getClass().getName(); - SystemMessageDialog msgDlg = - new SystemMessageDialog(shell, - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED).makeSubstitution(msg)); + SystemMessage smsg = new SimpleSystemMessage(ProcessesPlugin.PLUGIN_ID, IStatus.ERROR, + NLS.bind(SystemProcessesResources.MSG_OPERATION_FAILED, msg)); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, smsg); msgDlg.setException(exc); msgDlg.open(); } @@ -354,7 +357,8 @@ public class SystemKillProcessAction extends SystemBaseDialogAction implements I */ protected void showOperationCancelledMessage(Shell shell) { - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED)); + SystemMessage msg = new SimpleSystemMessage(ProcessesPlugin.PLUGIN_ID, IStatus.CANCEL, SystemProcessesResources.MSG_OPERATION_CANCELLED); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); msgDlg.open(); } diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java index c3af45a62fe..4ba09e45950 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.processes.ui.view; @@ -22,6 +23,7 @@ package org.eclipse.rse.internal.processes.ui.view; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.rse.core.model.ISystemMessageObject; @@ -30,14 +32,16 @@ import org.eclipse.rse.core.model.SystemMessageObject; import org.eclipse.rse.core.model.SystemRemoteResourceSet; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.processes.ui.ProcessesPlugin; +import org.eclipse.rse.internal.processes.ui.SystemProcessesResources; import org.eclipse.rse.internal.processes.ui.actions.SystemKillProcessAction; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; +import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants; import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteTypes; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; import org.eclipse.rse.ui.ISystemContextMenuConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemMenuManager; @@ -187,7 +191,8 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter catch (Exception exc) { children = new SystemMessageObject[1]; - children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED), ISystemMessageObject.MSGTYPE_ERROR, element); + SystemMessage msg = new SimpleSystemMessage(ProcessesPlugin.PLUGIN_ID, IStatus.ERROR, SystemProcessesResources.MSG_EXPAND_FAILED); + children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element); SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$ } return children; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java index 9bbf0246e6f..20bb812a706 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java @@ -12,24 +12,26 @@ * * Contributors: * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.processes.ui; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.processes.ui.ProcessesPlugin; import org.eclipse.rse.internal.processes.ui.SystemProcessesResources; import org.eclipse.rse.internal.processes.ui.view.SystemProcessStatesContentProvider; import org.eclipse.rse.internal.ui.SystemResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.processes.HostProcessFilterImpl; import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystemConfiguration; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.actions.SystemTestFilterStringAction; @@ -495,7 +497,8 @@ public class SystemProcessFilterStringEditPane extends notUnique = true; if (notUnique) { - errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE).makeSubstitution(currFilterString); + + errorMessage = new SimpleSystemMessage(ProcessesPlugin.PLUGIN_ID, IStatus.ERROR, NLS.bind(SystemProcessesResources.MSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE, currFilterString)); } controlInError = txtExeName; } diff --git a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java index f26927c1e91..28948db3d5c 100644 --- a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java +++ b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java @@ -70,6 +70,7 @@ * Kevin Doyle (IBM) - [208778] [efs][api] RSEFileStore#getOutputStream() does not support EFS#APPEND * David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files * Martin Oberhuber (Wind River) - [216351] Improve cancellation of SystemFetchOperation for files + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.services.files.ftp; @@ -106,7 +107,6 @@ import org.eclipse.rse.services.clientserver.FileTypeMatcher; import org.eclipse.rse.services.clientserver.IMatcher; import org.eclipse.rse.services.clientserver.NamePatternMatcher; import org.eclipse.rse.services.clientserver.PathUtility; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.AbstractFileService; @@ -331,14 +331,9 @@ public class FTPService extends AbstractFileService implements IFileService, IFT } return s; } catch(UnsupportedEncodingException e) { - try { - //SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),"Please specify a different encoding in host properties."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - //throw new RemoteFileIOException(new SystemMessageException(msg)); - throw new SystemMessageException(msg); - } catch(IndicatorException ind) { - throw new RemoteFileIOException(e); - } + SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + throw new SystemMessageException(msg); + } } diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java index ad4bca4c4b6..7037902e5c1 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java @@ -22,6 +22,7 @@ * Kevin Doyle (IBM) - [211374] [ssh] New File on SSH has unnecessary space in its contents * David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files * Martin Oberhuber (Wind River) - [216343] immediate link targets and canonical paths for Sftp + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.files; @@ -64,7 +65,6 @@ import org.eclipse.rse.services.clientserver.FileTypeMatcher; import org.eclipse.rse.services.clientserver.IMatcher; import org.eclipse.rse.services.clientserver.NamePatternMatcher; import org.eclipse.rse.services.clientserver.PathUtility; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.AbstractFileService; @@ -229,14 +229,12 @@ public class SftpFileService extends AbstractFileService implements IFileService //FIXME bug 204705: this does not work properly for commands like ls(), due to a Jsch bug return quoteForJsch(recoded); } catch(UnsupportedEncodingException e) { - try { + //SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),"Please specify a different encoding in host properties."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //throw new RemoteFileIOException(new SystemMessageException(msg)); throw new SystemMessageException(msg); - } catch(IndicatorException ind) { - throw makeSystemMessageException(e); - } + } } diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java new file mode 100644 index 00000000000..39cc8ef06be --- /dev/null +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java @@ -0,0 +1,107 @@ +/******************************************************************************** + * Copyright (c) 2008 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight. + * + * Contributors: + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible + ********************************************************************************/ +package org.eclipse.rse.services.clientserver.messages; + +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.eclipse.core.runtime.IStatus; + +public class SimpleSystemMessage extends SystemMessage { + + /** + * alternative to message number for ids? + */ + private String _pluginId; + + /** + * Constructor for messages that use explicit strings and severities rather than + * parsing a message file. This is part of the work to migrate away from the message + * file stuff. + * + * @param pluginId the id of the originating plugin + * @param severity using IStatus severities + * @param msg the message text + */ + public SimpleSystemMessage(String pluginId, int severity, String msg) { + this(pluginId, severity, msg, (String)null); + } + + /** + * Constructor for messages that use explicit strings and severities rather than + * parsing a message file. This is part of the work to migrate away from the message + * file stuff. + * + * @param pluginId the id of the originating plugin + * @param severity using IStatus severities + * @param msg the message text + * @param msgDetails the message details + */ + public SimpleSystemMessage(String pluginId, int severity, String msg, String msgDetails) { + super("RSE", "G", "-", severityToIndicator(severity), msg, msgDetails); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ + + _pluginId = pluginId; + } + + /** + * Constructor for messages that use explicit strings and severities rather than + * parsing a message file. This is part of the work to migrate away from the message + * file stuff. + * + * @param pluginId the id of the originating plugin + * @param severity using IStatus severities + * @param msg the message text + * @param e an exception to convert into details + */ + public SimpleSystemMessage(String pluginId, int severity, String msg, Throwable e) { + super("RSE", "G", "-", severityToIndicator(severity), msg, throwableToDetails(e)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + _pluginId = pluginId; + + } + + private static String throwableToDetails(Throwable e){ + // transform exception stack into a string + StringWriter excWriter = new StringWriter(); + e.printStackTrace(new PrintWriter(excWriter)); + String dmsg = e.toString(); + if ((dmsg == null) || (e instanceof ClassCastException)) dmsg = e.getClass().getName(); + String msgDetails = dmsg + "\n" + excWriter.toString(); //$NON-NLS-1$ + return msgDetails; + } + + private static char severityToIndicator(int severity){ + char ind = COMPLETION; + if ((severity & IStatus.CANCEL) != 0){ + ind = UNEXPECTED; + } + else if ((severity & IStatus.ERROR) != 0){ + ind = ERROR; + } + else if ((severity & IStatus.INFO) != 0){ + ind = INFORMATION; + } + else if ((severity & IStatus.OK) != 0){ + ind = COMPLETION; + } + else if ((severity & IStatus.WARNING) != 0){ + ind = WARNING; + } + return ind; + } + + public String getFullMessageID() { + return _pluginId + ":" + getIndicator(); + } + +} diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java index 09903905ce3..1657e818ba7 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] SystemMessages using RSEStatus *******************************************************************************/ package org.eclipse.rse.services.clientserver.messages; @@ -51,6 +51,9 @@ public class SystemMessage * Unexpected message indicator (same as warning but will log exception & stack in message log) */ public static final char UNEXPECTED = 'U'; + + + // Private variables private char subPrefix = '%'; @@ -58,7 +61,10 @@ public class SystemMessage private String level1NS, level2NS; // level 1 & 2 with NO substitution made private String level1WS, level2WS; // level 1 & 2 with substitutions made. private String component, subComponent; - private String messageNumber; + + + private String messageNumber; + private int numSubs = -1; private Object[] subs = null; @@ -73,20 +79,30 @@ public class SystemMessage * @param number a string that gives the 4 digit message number * @param l1 Level 1 text that describes the error * @param l2 Level 2 text that describes any recovery actions or further details - * @throws IndicatorException if a message is attempted to be constructed with an invalid indicator. */ - public SystemMessage(String comp, String sub, String number, char ind, String l1, String l2) throws IndicatorException { + public SystemMessage(String comp, String sub, String number, char ind, String l1, String l2) { component = comp.toUpperCase(); subComponent = sub.toUpperCase(); messageNumber = number.toUpperCase(); - setIndicator(ind); - level1NS = l1.trim(); - level2NS = l2.trim(); - level1WS = l1.trim(); - level2WS = l2.trim(); - + try { + setIndicator(ind); + } + catch (IndicatorException e) + { + indicator = UNEXPECTED; + } + if (l1 != null){ + level1NS = l1.trim(); + level1WS = l1.trim(); + } + if (l2 != null){ + level2NS = l2.trim(); + level2WS = l2.trim(); + } } + + /** * Use this method to override the default indicator of the message * @param ind the new indicator. See constants for values. @@ -122,19 +138,6 @@ public class SystemMessage return messageNumber; } - /** - * @return the component of this message. - */ - public String getComponent() { - return component; - } - - /** - * @return the subcomponent of this message. - */ - public String getSubComponent() { - return subComponent; - } /** * Use this method to retrieve the unique number of substitution variables @@ -190,34 +193,8 @@ public class SystemMessage return component + subComponent + messageNumber + indicator; } - /** - * Use this method to retrieve 'long' message ID format: - * Component + SubComponent + Number. - * The long message ID is used for retrieving messages from a message file. - * @return String - the long message ID - **/ - public String getLongMessageID() { - return component + subComponent + messageNumber; - } - - /** - * Use this method to retrieve 'standard' message ID format: - * Component + Number - * @return String - the full message ID - **/ - public String getMessageID() { - return component + messageNumber; - } - - /** - * Tests if this message has a long id equal to the one supplied in the argument. - * @param messageId the long message id to compare against. - * @return a boolean indicating if the message ids are equal. - */ - public boolean hasLongID(String messageId) { - return getLongMessageID().equals(messageId); - } + /** * Use this method to set substitution value %1. *
Generally toString() is used on the substitution objects, but there is @@ -481,11 +458,6 @@ public class SystemMessage */ protected Object clone() throws CloneNotSupportedException { - try { - return new SystemMessage(component, subComponent, messageNumber, indicator, level1NS, level2NS); - } - catch (IndicatorException e) { - return null; - } + return new SystemMessage(component, subComponent, messageNumber, indicator, level1NS, level2NS); } } diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java index ef0bd43c0b9..ecf6b538fab 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.services.clientserver.messages; @@ -56,15 +56,6 @@ public class SystemMessageException extends Exception return msg; } - /** - * Tests if the SystemMessage encapsulated by this exception has a long id equal to the - * argument. - * @param longMessageID the String containing the message id to test. - * @return true if the long message id of the message is equal to the supplied message id. - */ - public boolean hasLongID(String longMessageID) { - return getSystemMessage().hasLongID(longMessageID); - } /** * Set the SystemMessage being wrapped diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java index c1b6c434912..1643b0b2ca8 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java @@ -13,11 +13,11 @@ * * Contributors: * Martin Oberhuber (Wind River) - [216351] Improve cancellation of SystemFetchOperation for files + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.services.files; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; /** @@ -53,10 +53,8 @@ public class RemoteFileCancelledException extends RemoteFileException { private static SystemMessage getMyMessage() { String l1 = "Operation cancelled."; //$NON-NLS-1$ String l2 = ""; //$NON-NLS-1$ - try { - myMessage = new SystemMessage("RSE", "G", "1067", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } catch (IndicatorException e) { - } + myMessage = new SystemMessage("RSE", "G", "1067", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return myMessage; } diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java index f56386e90fa..e52f8701b0b 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java @@ -12,12 +12,11 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.services.files; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; /** @@ -62,10 +61,8 @@ public class RemoteFileIOException extends RemoteFileException { private static SystemMessage getMyMessage() { String l1 = "Operation failed. File system input or output error"; //$NON-NLS-1$ String l2 = "Message reported from file system: %1"; //$NON-NLS-1$ - try { - myMessage = new SystemMessage("RSE", "F", "1002", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } catch (IndicatorException e) { - } + myMessage = new SystemMessage("RSE", "F", "1002", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return myMessage; } diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java index 8662f70e2ac..793bee67920 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java @@ -12,12 +12,11 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.services.files; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; /** @@ -61,10 +60,8 @@ public class RemoteFileSecurityException extends RemoteFileException { if (myMessage == null) { String l1 = "Operation failed. Security violation"; //$NON-NLS-1$ String l2 = "Message reported from file system: %1"; //$NON-NLS-1$ - try { - myMessage = new SystemMessage("RSE", "F", "1001", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } catch (IndicatorException e) { - } + myMessage = new SystemMessage("RSE", "F", "1001", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } return myMessage; } diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java index 0b88588e1ba..9d0b81c9836 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java @@ -12,12 +12,11 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.services.files; -import org.eclipse.rse.services.clientserver.messages.IndicatorException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; /** @@ -61,10 +60,8 @@ public class RemoteFolderNotEmptyException extends RemoteFileException { if (myMessage == null) { String l1 = "Folder is not empty. Cannot delete"; //$NON-NLS-1$ String l2 = "The operation failed. One possible reason is that the folder is not empty"; //$NON-NLS-1$ - try { - myMessage = new SystemMessage("RSE", "F", "1003", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } catch (IndicatorException e) { - } + myMessage = new SystemMessage("RSE", "F", "1003", SystemMessage.ERROR, l1, l2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } return myMessage; } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.java index 087238cad10..c8c2ab6f020 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.java @@ -87,6 +87,12 @@ public class ShellResources extends NLS public static String RESID_PROPERTY_SHELL_STATUS_ACTIVE_VALUE; public static String RESID_PROPERTY_SHELL_STATUS_INACTIVE_VALUE; + // universal commands + public static String MSG_UCMD_INVOCATION_EMPTY; + + public static String MSG_OPERATION_RUNNING; + public static String MSG_OPERATION_FINISHED; + static { diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.properties b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.properties index 72061d40641..3e875823d4d 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.properties +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.properties @@ -89,3 +89,10 @@ RESID_PROPERTY_SHELL_CONTEXT_TOOLTIP=Current context within the shell RESID_PROPERTY_SHELL_STATUS_ACTIVE_VALUE=Running RESID_PROPERTY_SHELL_STATUS_INACTIVE_VALUE=Finished +# universal commands +MSG_UCMD_INVOCATION_EMPTY = The invocation may not be blank + +MSG_OPERATION_RUNNING = {0} - Running +MSG_OPERATION_FINISHED = {0} - Finished + + diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java index 7c2ce755602..ddb32c52a95 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java @@ -16,7 +16,8 @@ * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect() - * Kevin Doyle (IBM) - [187083] Launch Shell action available on folders inside virtual files + * Kevin Doyle (IBM) - [187083] Launch Shell action available on folders inside virtual files + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.actions; @@ -44,6 +45,7 @@ import org.eclipse.rse.internal.shells.ui.view.SystemCommandsUI; import org.eclipse.rse.internal.shells.ui.view.SystemCommandsViewPart; import org.eclipse.rse.services.clientserver.PathUtility; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.shells.ui.RemoteCommandHelpers; @@ -52,7 +54,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; import org.eclipse.rse.ui.ISystemIconConstants; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.actions.SystemBaseAction; @@ -296,7 +297,8 @@ public class SystemCommandAction extends SystemBaseAction if (theNewName.length() == 0) { - _errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UCMD_INVOCATION_EMPTY); + String msgTxt = ShellResources.MSG_UCMD_INVOCATION_EMPTY; + _errorMessage = new SimpleSystemMessage(ShellsUIPlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); } if (_errorMessage != null) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java index 9eb8efd62ce..727a8dc3c8c 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java @@ -19,6 +19,7 @@ * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Kevin Doyle (IBM) - [212940] Duplicate Help Context Identifiers + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -35,12 +36,12 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.shells.ui.ShellResources; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.view.SystemTableViewProvider; import org.eclipse.rse.services.clientserver.PathUtility; -import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.shells.ui.view.CommandEntryViewerConfiguration; import org.eclipse.rse.shells.ui.view.SystemCommandEditor; import org.eclipse.rse.shells.ui.view.SystemCommandsView; @@ -49,10 +50,8 @@ import org.eclipse.rse.subsystems.shells.core.model.ISystemOutputRemoteTypes; import org.eclipse.rse.subsystems.shells.core.model.RemoteOutput; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; -import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemThemeConstants; import org.eclipse.rse.ui.RSEUIPlugin; -import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction; import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction; import org.eclipse.rse.ui.view.ISystemViewElementAdapter; @@ -494,19 +493,18 @@ FocusListener IRemoteCommandShell command = (IRemoteCommandShell) object; String title = command.getType(); - SystemMessage msg = null; + String msgTxt = null; if (!command.isActive()) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FINISHED); + msgTxt = NLS.bind(ShellResources.MSG_OPERATION_FINISHED, title); } else { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_RUNNING); + msgTxt = NLS.bind(ShellResources.MSG_OPERATION_RUNNING, title); } - msg.makeSubstitution(title); - _title = msg.getLevelOneText(); -// _tabFolderPage.setText(_title); + _title = msgTxt; + } } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/Activator.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/Activator.java index fb943b6da7f..8bdc4b9c035 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/Activator.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/Activator.java @@ -14,6 +14,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [180519][api] declaratively register adapter factories * Martin Oberhuber (wind River) - [203105] Decouple recursive plugin activation of UI adapters + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; @@ -32,6 +33,8 @@ public class Activator extends AbstractUIPlugin { //The shared instance. private static Activator plugin; + public static final String PLUGIN_ID = "org.eclipse.rse.subsystems.files.core"; + /** * The constructor. */ diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java index 392700eb933..937f37a25ed 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; @@ -175,6 +175,32 @@ public class SystemFileResources extends NLS public static String RESID_JOB_SEARCH_NAME; public static String RESID_JOB_DECORATEFILES_NAME; + + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID; + public static String FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES; + public static String MSG_VALIDATE_NAME_EMPTY; + public static String MSG_VALIDATE_NAME_NOTUNIQUE; + public static String MSG_VALIDATE_NAME_NOTVALID; + + public static String MSG_CONNECT_FAILED; + public static String MSG_OPERATION_CANCELLED; + + public static String FILEMSG_FOLDER_NOTEMPTY; + public static String FILEMSG_FOLDER_NOTEMPTY_DETAILS; + public static String FILEMSG_FOLDER_NOTFOUND; + public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE; + public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS; + public static String FILEMSG_FILE_NOTFOUND; + + public static String MSG_ERROR_UNEXPECTED; + + public static String MSG_FOLDER_UNREADABLE; + + public static String MSG_FILE_CANNOT_BE_SAVED; + public static String MSG_FILE_CANNOT_BE_SAVED_DETAILS; + static { // load message values from bundle file NLS.initializeMessages(BUNDLE_NAME, SystemFileResources.class); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties index c6489e04f17..c8c43cb506d 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties @@ -12,7 +12,7 @@ # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # # Contributors: -# {Name} (company) - description of contribution. +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -214,3 +214,38 @@ WIDGET_BROWSE_TOOLTIP=Browse for folder path RESID_JOB_SEARCH_NAME=Search RESID_JOB_DECORATEFILES_NAME=Decorate Files + + +FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY = Enter file name pattern +FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE= Filter string '{0}' already exists in this filter +FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID = Filter string name pattern not valid +FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES = You must include files or folders or both + +MSG_VALIDATE_NAME_EMPTY = Enter name +MSG_VALIDATE_NAME_EMPTY_DETAILS = You must enter a name in the field where the cursor is positioned. +MSG_VALIDATE_NAME_NOTUNIQUE= Name in use +MSG_VALIDATE_NAME_NOTUNIQUE_DETAILS = This name is already used by another resource. Enter a unique name. + +MSG_VALIDATE_NAME_NOTVALID = Name not valid +MSG_VALIDATE_NAME_NOTVALID_DETAILS =The name entered does not have valid syntax + +MSG_CONNECT_FAILED = Connect to {0} failed with an unexpected exception +MSG_OPERATION_CANCELLED = Operation canceled. + +FILEMSG_FOLDER_NOTEMPTY = Folder is not empty. Cannot delete +FILEMSG_FOLDER_NOTEMPTY_DETAILS =The operation failed. One possible reason is that the folder is not empty + +FILEMSG_FOLDER_NOTFOUND = Folder '{0}' not found +FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE = Folder '{0}' not found. Would you like to create it? +FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS = The folder you specified does not exist. Select Yes to create it, No to cancel the operation +FILEMSG_FILE_NOTFOUND = File '{0}' not found + + +MSG_ERROR_UNEXPECTED = An unexpected error occurred. + +MSG_FOLDER_UNREADABLE = Folder {0} is not readable. Cannot expand + +MSG_FILE_CANNOT_BE_SAVED= File {0} can not be saved on {1}. You do not have write access to the file.> +MSG_FILE_CANNOT_BE_SAVED_DETAILS= Change file permissions to ensure you have write access to the file. + + diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index eb8a8dc09a1..6321ceea0c3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -30,6 +30,7 @@ * David Dykstal (IBM) - [197036] pulling up subsystem switch logic * David Dykstal (IBM) - [217556] remove service subsystem types * Martin Oberhuber (Wind River) - [219098][api] FileServiceSubSystem should not be final + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.servicesubsystem; @@ -41,7 +42,9 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemRemoteChangeEvents; import org.eclipse.rse.core.events.SystemRemoteChangeEvent; @@ -50,10 +53,13 @@ import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; +import org.eclipse.rse.internal.subsystems.files.core.Activator; +import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; import org.eclipse.rse.services.clientserver.PathUtility; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.clientserver.archiveutils.AbsoluteVirtualPath; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.IFileService; @@ -68,8 +74,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileContext; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; /** @@ -221,7 +225,7 @@ public class FileServiceSubSystem extends RemoteFileSubSystem implements IFileSe if (userHome == null){ // with 207095, it's possible that we could be trying to get user home when not connected - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.MSG_ERROR_UNEXPECTED); throw new SystemMessageException(msg); } return userHome; @@ -500,7 +504,8 @@ public class FileServiceSubSystem extends RemoteFileSubSystem implements IFileSe if (parent != null && !parent.canRead()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); + String msgTxt = NLS.bind(SystemFileResources.MSG_FOLDER_UNREADABLE, parentPath); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.INFO, msgTxt); throw new SystemMessageException(msg); } @@ -577,7 +582,10 @@ public class FileServiceSubSystem extends RemoteFileSubSystem implements IFileSe if (!destination.canWrite()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage("RSEF5003").makeSubstitution(remoteFileName, getHostName()); //$NON-NLS-1$ + String msgTxt = NLS.bind(SystemFileResources.MSG_FILE_CANNOT_BE_SAVED, remoteFileName, getHostName()); + String msgDetails = SystemFileResources.MSG_FILE_CANNOT_BE_SAVED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); throw new SystemMessageException(msg); } getFileService().upload(new File(source), remoteParentPath, remoteFileName, isBinary, encoding, hostEncoding, monitor); @@ -658,7 +666,10 @@ public class FileServiceSubSystem extends RemoteFileSubSystem implements IFileSe if (!destination.canWrite()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage("RSEF5003").makeSubstitution(remoteFileNames[i], getHostName()); //$NON-NLS-1$ + String msgTxt = NLS.bind(SystemFileResources.MSG_FILE_CANNOT_BE_SAVED, remoteFileNames[i], getHostName()); + String msgDetails = SystemFileResources.MSG_FILE_CANNOT_BE_SAVED_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); throw new SystemMessageException(msg); } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index 2eb76d4dbdd..073f5fe4d6c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -23,6 +23,7 @@ * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems * David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants * David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.subsystems; @@ -44,8 +45,10 @@ import java.util.Vector; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.filters.ISystemFilterString; @@ -60,10 +63,13 @@ import org.eclipse.rse.core.subsystems.IRemoteContainer; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; import org.eclipse.rse.core.subsystems.SubSystem; +import org.eclipse.rse.internal.subsystems.files.core.Activator; +import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; import org.eclipse.rse.services.clientserver.FileTypeMatcher; import org.eclipse.rse.services.clientserver.IClientServerConstants; import org.eclipse.rse.services.clientserver.IMatcher; import org.eclipse.rse.services.clientserver.NamePatternMatcher; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.IFileService; @@ -71,8 +77,6 @@ import org.eclipse.rse.services.search.IHostSearchResult; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.propertypages.SystemSubSystemPropertyPageCore; import org.eclipse.swt.widgets.Composite; @@ -702,8 +706,8 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi // otherwise return message saying parent could not be found else if (parent != null && !parentExists) { children = new SystemMessageObject[1]; - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_FOLDER_NOTFOUND); - msg.makeSubstitution(parent.getAbsolutePath()); + String msgTxt = NLS.bind(SystemFileResources.FILEMSG_FILE_NOTFOUND, parent.getAbsolutePath()); + SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, null); } } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java index 232ca3fe4f4..4a8dcfc54e8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java @@ -13,6 +13,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [cleanup] fix javadoc. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.util; @@ -20,11 +21,13 @@ import java.util.Vector; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.rse.internal.subsystems.files.core.Activator; +import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; import org.eclipse.rse.services.clientserver.NamePatternMatcher; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.validators.ValidatorFileName; import org.eclipse.rse.ui.validators.ValidatorFolderName; import org.eclipse.rse.ui.validators.ValidatorUniqueString; @@ -98,9 +101,9 @@ public class ValidatorFileFilterString private void init() { //setErrorMessages(RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY), - setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE), - RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID)); + setErrorMessages(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.MSG_VALIDATE_NAME_EMPTY), + new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE), + new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID)); isFileName = isFolderName = true; } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java index 8f7eccf8725..0e25fb86899 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java @@ -13,16 +13,19 @@ * * Contributors: * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.util; import java.util.Vector; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.rse.internal.subsystems.files.core.Activator; +import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.validators.ValidatorFileName; import org.eclipse.rse.ui.validators.ValidatorFolderName; import org.eclipse.rse.ui.validators.ValidatorUniqueString; @@ -75,11 +78,11 @@ public class ValidatorFileUniqueName //shell.setCursor(busyCursor); org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor); - setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE), - isFolder ? RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID) : - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID) - ); + setErrorMessages(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.MSG_VALIDATE_NAME_EMPTY), + new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.MSG_VALIDATE_NAME_NOTUNIQUE), + isFolder ? new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE) : + new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, SystemFileResources.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID)); + try { IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().list(parentFolder, null); diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java index 8257c05b3d6..c8ccabb3660 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [181066] NLS missing messages with DAEMON and Shells + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.internal.subsystems.shells.core; @@ -30,6 +31,10 @@ public class ShellStrings extends NLS public static String RSESubSystemOperation_Send_command_to_Shell_message; public static String RSESubSystemOperation_Refresh_Output; + public static String MSG_CONNECT_FAILED; + public static String MSG_OPERATION_CANCELLED; + + static { // load message values from bundle file diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties index 24df89a72a5..d674278f2be 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties @@ -12,7 +12,7 @@ # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # # Contributors: -# {Name} (company) - description of contribution. +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -25,3 +25,7 @@ RSESubSystemOperation_Run_command_message = Run command RSESubSystemOperation_Run_Shell_message = Run Shell RSESubSystemOperation_Send_command_to_Shell_message = Send command to Shell RSESubSystemOperation_Refresh_Output = Refresh Output + +MSG_CONNECT_FAILED = Connect to {0} failed with an unexpected exception +MSG_OPERATION_CANCELLED = Operation canceled. + diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java index 43b88e4fefd..802438be73f 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ********************************************************************************/ package org.eclipse.rse.subsystems.shells.core.subsystems; @@ -28,6 +29,7 @@ import java.util.StringTokenizer; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.SystemResourceChangeEvent; @@ -47,8 +49,6 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; @@ -92,8 +92,11 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd public boolean checkForCancel(IProgressMonitor monitor) { if ((monitor != null) && monitor.isCanceled()) - throw new OperationCanceledException(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED) - .getLevelOneText()); + { + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + + throw new OperationCanceledException(msgTxt); + } return false; } @@ -1010,8 +1013,11 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd msg = getRunningMessage(_cmd); if (!implicitConnect(false, mon, msg, totalWorkUnits)) - throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution( - getHostName()).getLevelOneText()); + { + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + + throw new Exception(msgTxt); + } runOutputs = internalRunCommand(_cmd, _runContext, _runInterpret, mon); } } @@ -1041,9 +1047,11 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd String msg = null; int totalWorkUnits = IProgressMonitor.UNKNOWN; - if (!implicitConnect(false, mon, msg, totalWorkUnits)) - throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution( - getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputs = new Object[] { internalRunShell(_runContext, mon) @@ -1077,8 +1085,11 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd int totalWorkUnits = IProgressMonitor.UNKNOWN; if (!implicitConnect(false, mon, msg, totalWorkUnits)) - throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution( - getHostName()).getLevelOneText()); + { + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + + throw new Exception(msgTxt); + } internalCancelShell(_runContext, mon); } } @@ -1116,9 +1127,11 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd msg = getRunningMessage(_cmd); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) - throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution( - getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + + throw new Exception(msgTxt); + } internalSendCommandToShell(_cmd, _runContext, mon); } } @@ -1149,9 +1162,10 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd String msg = null; int totalWorkUnits = IProgressMonitor.UNKNOWN; - if (!implicitConnect(false, mon, msg, totalWorkUnits)) - throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution( - getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(ShellStrings.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } internalRemoveShell(_runContext); } } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.java index b9f7a4768e6..efbfa1d79a2 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.internal.ui; @@ -68,6 +68,12 @@ public class GenericMessages extends NLS public static String FilteredPreferenceDialog_PreferenceSaveFailed; public static String RSEQuery_task; + + public static String Error; + public static String Question; + public static String Warning; + public static String Information; + static { // load message values from bundle file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.properties index 255ce132486..91d2281e034 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.properties +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.properties @@ -12,7 +12,7 @@ # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # # Contributors: -# {Name} (company) - description of contribution. +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -60,3 +60,8 @@ PropertyDialog_noPropertyMessage = Properties PropertyDialog_propertyMessage = Properties for {0} RSEQuery_task = RSE Query + +Error=Error +Question=Question +Warning=Warning +Information=Information diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java index 14892ddcfce..57522d0dda3 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [187115] force SystemMessageDialog always into Display thread * Martin Oberhuber (Wind River) - [189272] exception when canceling ssh connect * David McKnight (IBM) - [216596] determine whether to show yes/no or just okay + * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible *******************************************************************************/ package org.eclipse.rse.ui.messages; @@ -30,8 +31,10 @@ import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.window.Window; +import org.eclipse.rse.internal.ui.GenericMessages; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.services.clientserver.messages.IndicatorException; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.ISystemMessages; @@ -168,7 +171,7 @@ public class SystemMessageDialog extends ErrorDialog implements Listener { public SystemMessageDialog(Shell parentShell, SystemMessage message) { this(parentShell, - message.getFullMessageID(), + (message instanceof SimpleSystemMessage) ? getStatusTitle(message) : message.getFullMessageID(), message.getLevelOneText(), (new MultiStatus(SystemBasePlugin.getBaseDefault().getSymbolicName(), IStatus.OK, "", new Exception(""))), //$NON-NLS-1$ //$NON-NLS-2$ 0xFFFFF); @@ -187,6 +190,24 @@ public class SystemMessageDialog extends ErrorDialog implements Listener { this.displayMask = displayMask; setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); } + + private static String getStatusTitle(SystemMessage message) { + String title = null; + // setup image + if (message.getIndicator()==SystemMessage.INFORMATION || + message.getIndicator()==SystemMessage.COMPLETION) + title = GenericMessages.Information; + else if (message.getIndicator()==SystemMessage.INQUIRY) + //imageName=DLG_IMG_QUESTION; + title = GenericMessages.Question; + else if (message.getIndicator()==SystemMessage.ERROR || + message.getIndicator()==SystemMessage.UNEXPECTED) + title = GenericMessages.Error; + else if (message.getIndicator()==SystemMessage.WARNING) + title = GenericMessages.Warning; + return title; + } + private void initImage(SystemMessage message) { diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index 43ac2d055a4..bd093e9ee24 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -56,6 +56,7 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.events.ISystemModelChangeEvent; @@ -81,6 +82,8 @@ import org.eclipse.rse.internal.core.model.ISystemProfileOperation; import org.eclipse.rse.internal.core.model.SystemModelChangeEvent; import org.eclipse.rse.internal.core.model.SystemProfileManager; import org.eclipse.rse.internal.ui.GenericMessages; +import org.eclipse.rse.internal.ui.subsystems.SubSystemResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.ISystemMessages; @@ -524,13 +527,14 @@ public abstract class SubSystem extends RSEModelObject else if (e instanceof InterruptedException) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED); - msg.makeSubstitution(getHost().getAliasName()); + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_CANCELLED, getHost().getAliasName()); + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.CANCEL, msgTxt); throw new SystemMessageException(msg); } else { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED); + String msgTxt = SubSystemResources.MSG_DISCONNECT_FAILED; + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); throw new SystemMessageException(msg); } } @@ -1299,9 +1303,9 @@ public abstract class SubSystem extends RSEModelObject String excMsg = e.getMessage(); if ((excMsg == null) || (excMsg.length()==0)) excMsg = "Exception " + e.getClass().getName(); //$NON-NLS-1$ - SystemMessage sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED); - sysMsg.makeSubstitution(excMsg); - return new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID, IStatus.OK, sysMsg.getLevelOneText(), e); + String msgTxt = NLS.bind(SubSystemResources.MSG_OPERATION_FAILED, excMsg); + + return new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID, IStatus.OK, msgTxt, e); } } @@ -1344,9 +1348,8 @@ public abstract class SubSystem extends RSEModelObject String excMsg = exc.getMessage(); if ((excMsg == null) || (excMsg.length()==0)) excMsg = "Exception " + exc.getClass().getName(); //$NON-NLS-1$ - SystemMessage sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED); - sysMsg.makeSubstitution(excMsg); - return new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID, IStatus.OK, sysMsg.getLevelOneText(), exc); + String msgTxt = NLS.bind(SubSystemResources.MSG_OPERATION_FAILED, excMsg); + return new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID, IStatus.OK, msgTxt, exc); } } } @@ -1375,7 +1378,10 @@ public abstract class SubSystem extends RSEModelObject msg = getResolvingMessage(_filterString); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputs = internalResolveFilterString(_filterString, mon); } } @@ -1406,7 +1412,10 @@ public abstract class SubSystem extends RSEModelObject msg = getResolvingMessage(_filterString); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputs = internalResolveFilterStrings(_filterStrings, mon); } } @@ -1444,7 +1453,10 @@ public abstract class SubSystem extends RSEModelObject } msg = getResolvingMessage(_filterString); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputs = internalResolveFilterString(_parent, _filterString, mon); } } @@ -1476,7 +1488,10 @@ public abstract class SubSystem extends RSEModelObject msg = getQueryingMessage(_key); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputStrings = new String[] {internalGetProperty(_subject, _key, mon)}; } } @@ -1510,7 +1525,10 @@ public abstract class SubSystem extends RSEModelObject int totalWorkUnits = IProgressMonitor.UNKNOWN; msg = getSettingMessage(_key); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputs = new Object[] {internalSetProperty(_subject, _key, _value, mon)}; } } @@ -1541,7 +1559,10 @@ public abstract class SubSystem extends RSEModelObject int totalWorkUnits = IProgressMonitor.UNKNOWN; msg = getQueryingMessage(); - if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(false, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } runOutputStrings = internalGetProperties(_subject, _keys, mon); } } @@ -1613,7 +1634,10 @@ public abstract class SubSystem extends RSEModelObject msg = SubSystemConfiguration.getConnectingMessage(getHostName(), getConnectorService().getPort()); SystemBasePlugin.logInfo(msg); - if (!implicitConnect(true, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText()); + if (!implicitConnect(true, mon, msg, totalWorkUnits)){ + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, getHostName()); + throw new Exception(msgTxt); + } internalConnect(mon); ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); @@ -2289,14 +2313,18 @@ public abstract class SubSystem extends RSEModelObject String hostName = host.getAliasName(); ISystemProfile profile = getSystemProfile(); if (registry.getHost(profile, hostName) == null) { // connection no longer exists - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTION_DELETED); - msg.makeSubstitution(hostName); + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECTION_DELETED, hostName); + + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); throw new SystemMessageException(msg); } // yantzi: artemis 6.0, offline support if (isOffline()) { - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OFFLINE_CANT_CONNECT); - msg.makeSubstitution(hostName); + String msgTxt = NLS.bind(SubSystemResources.MSG_OFFLINE_CANT_CONNECT, hostName); + String msgDetails = SubSystemResources.MSG_OFFLINE_CANT_CONNECT_DETAILS; + + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); + throw new SystemMessageException(msg); } //DY operation = OPERATION_CONNECT; diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index 1bea0da65df..067a10a68c3 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -39,8 +39,10 @@ import java.util.Iterator; import java.util.List; import java.util.Vector; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.events.ISystemModelChangeEvents; @@ -70,11 +72,11 @@ import org.eclipse.rse.internal.core.filters.SystemFilterStartHere; import org.eclipse.rse.internal.core.model.SystemProfileManager; import org.eclipse.rse.internal.ui.SystemPropertyResources; import org.eclipse.rse.internal.ui.SystemResources; +import org.eclipse.rse.internal.ui.subsystems.SubSystemResources; import org.eclipse.rse.logging.Logger; import org.eclipse.rse.services.IService; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemPreferencesManager; import org.eclipse.rse.ui.messages.SystemMessageDialog; @@ -1736,8 +1738,9 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration { IHost conn = ss.getHost(); String connectionName = conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$ - SystemMessage sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED); - sysMsg.makeSubstitution(missingPoolMgrName, connectionName); + + String msgTxt = NLS.bind(SubSystemResources.MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED, missingPoolMgrName, connectionName); + SystemMessage sysMsg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt); SystemBasePlugin.logWarning(sysMsg.getFullMessageID() + ": " + sysMsg.getLevelOneText()); //$NON-NLS-1$ if (brokenReferenceWarningsIssued.get(missingPoolMgrName) == null) { @@ -2630,36 +2633,32 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration */ public static String getConnectingMessage(String hostName, int port) { - SystemMessage msg = null; + String msgTxt = null; if (port > 0) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTWITHPORT_PROGRESS); - msg.makeSubstitution(hostName, Integer.toString(port)); + msgTxt = NLS.bind(SubSystemResources.MSG_CONNECTWITHPORT_PROGRESS, hostName, Integer.toString(port)); } else - { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_PROGRESS); - msg.makeSubstitution(hostName); + { msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_PROGRESS, hostName); } - return msg.getLevelOneText(); + return msgTxt; } /** * Helper method to return the message "Disconnecting from &1..." */ public static String getDisconnectingMessage(String hostName, int port) { - SystemMessage msg = null; + String msgTxt = null; if (port > 0) { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECTWITHPORT_PROGRESS); - msg.makeSubstitution(hostName, Integer.toString(port)); + msgTxt = NLS.bind(SubSystemResources.MSG_DISCONNECTWITHPORT_PROGRESS, hostName, Integer.toString(port)); } else { - msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_DISCONNECT_PROGRESS); - msg.makeSubstitution(hostName); + msgTxt = NLS.bind(SubSystemResources.MSG_DISCONNECT_PROGRESS, hostName); + } - return msg.getLevelOneText(); + return msgTxt; } /** diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.java new file mode 100644 index 00000000000..01c252f07b0 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.java @@ -0,0 +1,64 @@ +/******************************************************************************** + * Copyright (c) 2008 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ +package org.eclipse.rse.internal.ui.subsystems; + +import org.eclipse.osgi.util.NLS; + +public class SubSystemResources extends NLS { + + private static String BUNDLE_NAME = "org.eclipse.rse.internal.ui.subsystems";//$NON-NLS-1$ + + public static String MSG_CONNECT_CANCELLED; + public static String MSG_CONNECT_PROGRESS; + public static String MSG_CONNECTWITHPORT_PROGRESS; + public static String MSG_CONNECT_FAILED; + public static String MSG_CONNECT_UNKNOWNHOST; + + public static String MSG_DISCONNECT_PROGRESS; + public static String MSG_DISCONNECTWITHPORT_PROGRESS; + public static String MSG_DISCONNECT_FAILED; + public static String MSG_DISCONNECT_CANCELLED; + + public static String MSG_OPERATION_FAILED; + public static String MSG_OPERATION_CANCELLED; + + public static String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED; + public static String MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED; + + // Connection doesn't exist + public static String MSG_CONNECTION_DELETED; + public static String MSG_CONNECTION_DELETED_DETAILS; + + // yantzi: artemis 6.0, offline messages + public static String MSG_OFFLINE_CANT_CONNECT; + public static String MSG_OFFLINE_CANT_CONNECT_DETAILS; + + public static String MSG_RESOLVE_PROGRESS; + + public static String MSG_QUERY_PROGRESS; + public static String MSG_QUERY_PROPERTIES_PROGRESS; + + public static String MSG_SET_PROGRESS; + public static String MSG_SET_PROPERTIES_PROGRESS; + + public static String MSG_RUN_PROGRESS; + + public static String MSG_COPY_PROGRESS; + + + static { + // load message values from bundle file + NLS.initializeMessages(BUNDLE_NAME, SubSystemResources.class); + } +} diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.properties b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.properties new file mode 100644 index 00000000000..4b66beddcbe --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemResources.properties @@ -0,0 +1,53 @@ +############################################################################### +# Copyright (c) 2008 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Initial Contributors: +# The following IBM employees contributed to the Remote System Explorer +# component that contains this file: David McKnight. +# +# Contributors: +# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible +############################################################################### + +# NLS_MESSAGEFORMAT_VAR +# NLS_ENCODING=UTF-8 + +MSG_CONNECT_PROGRESS = Connecting to {0} +MSG_CONNECTWITHPORT_PROGRESS = Connecting to {0} at port {1} +MSG_CONNECT_FAILED = Connect to {0} failed with an unexpected exception +MSG_CONNECT_UNKNOWNHOST = Connect failed. Host {0} not found or not responding +MSG_CONNECT_CANCELLED = Connect to {0} was canceled + +MSG_DISCONNECT_PROGRESS = Disconnecting from {0} +MSG_DISCONNECTWITHPORT_PROGRESS = Disconnecting from {0} at port {1} +MSG_DISCONNECT_FAILED = Disconnect from {0} failed with exception +MSG_DISCONNECT_CANCELLED = Disconnect from {0} was canceled + +MSG_OPERATION_FAILED = Operation failed with exception '{0}' +MSG_OPERATION_CANCELLED = Operation canceled. + +MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = Warning. Profile '{0}' should be made active. Active connection '{1}' contains a reference to it. +MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED = Warning. Profile '{0}' should be active. Active connection '{1}' contains a reference to it. + +# Connection doesn't exist +MSG_CONNECTION_DELETED = Connection named {0} does not exist. +MSG_CONNECTION_DELETED_DETAILS =Connection may have been renamed or deleted. + +MSG_OFFLINE_CANT_CONNECT = The connection {0} is currently offline and cannot be connected. +MSG_OFFLINE_CANT_CONNECT_DETAILS =You have performed an action which requires a live connection to the remote system. Switch the connection to online and perform the action again. To switch the connection online, right click on the connection {0} and select the Work Offline action. + +MSG_RESOLVE_PROGRESS = Resolving {0} + +MSG_QUERY_PROGRESS = Querying {0} +MSG_QUERY_PROPERTIES_PROGRESS = Querying properties + +MSG_SET_PROGRESS = Setting {0} +MSG_SET_PROPERTIES_PROGRESS = Setting properties + +MSG_RUN_PROGRESS = Running {0} +MSG_COPY_PROGRESS = Copying '{0}' to '{1}' +