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 19fb3ecb0d5..61ee9d26146 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,12 +22,12 @@ 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.osgi.util.NLS; import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants; import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.IRemoteServerLauncher; @@ -481,8 +481,8 @@ public class RexecDstoreServer implements IServerLauncher } if (timeout == 0) { - 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[] {""}); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, signonInfo.getHostname()); + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, ""); SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; @@ -564,14 +564,14 @@ 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 ){ - 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}); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, signonInfo.getHostname()); + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, hostMessage); SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; } else { - 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}); + String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED, ""+rexecPort, signonInfo.getHostname()); + String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED_DETAILS, hostMessage); SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails); _errorMessage = msg; @@ -842,7 +842,7 @@ public class RexecDstoreServer implements IServerLauncher if (monitor != null) { - String cmsg = MessageFormat.format(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, new Object[] {clientConnection.getPort()}); + String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); monitor.subTask(cmsg); } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSECoreRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSECoreRegistry.java index 7a4fa21baa4..8e8d9be80f7 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSECoreRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSECoreRegistry.java @@ -13,10 +13,10 @@ * Contributors: * Uwe Stieber (Wind River) - Added system types provider extension. * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.internal.core; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; @@ -27,6 +27,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.IRSECoreRegistry; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemTypeProvider; @@ -157,11 +158,11 @@ public class RSECoreRegistry implements IRSECoreRegistry { accessedSystemTypeCache.put(type.getName(), type); String message = "Successfully registered RSE system type ''{0}'' (id = ''{1}'')."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { type.getLabel(), type.getId() }); + message = NLS.bind(message, type.getLabel(), type.getId()); RSECorePlugin.getDefault().getLogger().logInfo(message); } else { String message = "RSE system type contribution skipped. Non-unique system type id (plugin: {0}, id: {1})."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { element.getContributor().getName(), type.getId()}); + message = NLS.bind(message, element.getContributor().getName(), type.getId()); RSECorePlugin.getDefault().getLogger().logWarning(message); } } @@ -188,18 +189,18 @@ public class RSECoreRegistry implements IRSECoreRegistry { accessedSystemTypeCache.put(type.getName(), type); String message = "Successfully registered RSE system type ''{0}'' (id = ''{1}'')."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { type.getLabel(), type.getId() }); + message = NLS.bind(message, type.getLabel(), type.getId() ); RSECorePlugin.getDefault().getLogger().logInfo(message); } else { String message = "RSE system type contribution skipped. Non-unique system type id (plugin: {0}, id: {1})."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { element.getContributor().getName(), type.getId()}); + message = NLS.bind(message, element.getContributor().getName(), type.getId()); RSECorePlugin.getDefault().getLogger().logWarning(message); } } } } catch (CoreException e) { String message = "RSE system types provider failed creation (plugin: {0}, id: {1})."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { element.getContributor().getName(), element.getDeclaringExtension().getSimpleIdentifier()}); + message = NLS.bind(message, element.getContributor().getName(), element.getDeclaringExtension().getSimpleIdentifier()); RSECorePlugin.getDefault().getLogger().logError(message, e); } } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFMetatdataJob.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFMetatdataJob.java index bec9ef659ba..768da518649 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFMetatdataJob.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFMetatdataJob.java @@ -13,17 +13,17 @@ * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * David Dykstal (IBM) - [188863] created out of SaveRSEDOMJob + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.internal.persistence; -import java.text.MessageFormat; - import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.internal.core.RSECoreMessages; import org.eclipse.rse.persistence.IRSEPersistenceProvider; @@ -50,7 +50,7 @@ public class PFMetatdataJob extends Job { public PFMetatdataJob(RSEDOM dom, IRSEPersistenceProvider provider) { super("Saving Profile"); //$NON-NLS-1$ - String title = MessageFormat.format(RSECoreMessages.SaveRSEDOMJob_SavingProfileJobName, new Object[] { dom.getName() }); + String title = NLS.bind(RSECoreMessages.SaveRSEDOMJob_SavingProfileJobName, dom.getName()); setName(title); setRule(new SerializingRule()); _dom = dom; diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceJob.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceJob.java index 68176126785..2afacaad5f5 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceJob.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceJob.java @@ -13,17 +13,17 @@ * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * David Dykstal (IBM) - [188863] created out of SaveRSEDOMJob + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.internal.persistence; -import java.text.MessageFormat; - import org.eclipse.core.resources.ResourcesPlugin; 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.RSECorePlugin; import org.eclipse.rse.internal.core.RSECoreMessages; import org.eclipse.rse.persistence.IRSEPersistenceProvider; @@ -41,7 +41,7 @@ public class PFWorkspaceJob extends WorkspaceJob { public PFWorkspaceJob(RSEDOM dom, IRSEPersistenceProvider provider) { super("Saving Profile"); //$NON-NLS-1$ - String title = MessageFormat.format(RSECoreMessages.SaveRSEDOMJob_SavingProfileJobName, new Object[] { dom.getName() }); + String title = NLS.bind(RSECoreMessages.SaveRSEDOMJob_SavingProfileJobName, dom.getName()); setName(title); setRule(ResourcesPlugin.getWorkspace().getRoot()); _dom = dom; diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/compare/SystemCompareInput.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/compare/SystemCompareInput.java index 3722f33916e..642bda00154 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/compare/SystemCompareInput.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/compare/SystemCompareInput.java @@ -15,7 +15,6 @@ ********************************************************************************/ package org.eclipse.rse.files.ui.compare; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; @@ -38,6 +37,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.ui.view.ISystemEditableRemoteObject; import org.eclipse.swt.widgets.Composite; @@ -160,7 +160,7 @@ public class SystemCompareInput extends CompareEditorInput String title; String format = Utilities.getString("ResourceCompare.twoWay.title"); //$NON-NLS-1$ - title = MessageFormat.format(format, new String[] {_leftResource.getName(), _rightResource.getName()}); + title = NLS.bind(format, _leftResource.getName(), _rightResource.getName()); setTitle(title); } catch (Exception e) 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 942725d77dc..e90c977b1f6 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 @@ -45,11 +45,11 @@ * David McKnight (IBM) - [189873] DownloadJob changed to DownloadAndOpenJob * 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] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.files.ui.view; import java.io.File; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; @@ -1428,7 +1428,7 @@ public class SystemViewRemoteFileAdapter ((IHostFilePermissionsContainer)rFile.getHostFile()).setPermissions(new PendingHostFilePermissions()); } - Job deferredFetch = new Job(MessageFormat.format(FileResources.MESSAGE_GETTING_PERMISSIONS, new Object[] {file.getAbsolutePath()})) + Job deferredFetch = new Job(NLS.bind(FileResources.MESSAGE_GETTING_PERMISSIONS, file.getAbsolutePath())) { public IStatus run(IProgressMonitor monitor){ try 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 0b4f8195bdf..e3547960d0f 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 @@ -9,12 +9,12 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; import java.io.File; import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; import java.util.Iterator; import java.util.List; @@ -702,7 +702,7 @@ class RemoteExportWizardPage1 extends WizardExportResourcesPage implements Liste String fileExtension = location.getFileExtension(); // ensure that file extension is valid if (fileExtension == null || !fileExtension.equals(Utilities.EXPORT_DESCRIPTION_EXTENSION)) { - setErrorMessage(MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_INVALID_EXTENSION, new Object[] { Utilities.EXPORT_DESCRIPTION_EXTENSION })); + setErrorMessage(NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_INVALID_EXTENSION, Utilities.EXPORT_DESCRIPTION_EXTENSION )); return false; } } 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 704c967a689..8e69931678a 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 @@ -9,11 +9,11 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; @@ -105,7 +105,7 @@ public class RemoteFileExportActionDelegate extends RemoteFileImportExportAction // do not save settings again exportData.setSaveSettings(false); } catch (CoreException ex) { - String message = MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_READ, new Object[] { description.getFullPath(), ex.getStatus().getMessage() }); + String message = NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_READ, description.getFullPath(), ex.getStatus().getMessage()); addToStatus(readStatus, message, ex); return null; } finally { @@ -117,7 +117,7 @@ public class RemoteFileExportActionDelegate extends RemoteFileImportExportAction reader.close(); } } catch (CoreException ex) { - String message = MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_CLOSE, new Object[] { description.getFullPath() }); + String message = NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_CLOSE, description.getFullPath()); addToStatus(readStatus, message, ex); } } 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 9edbcab8636..e1815ee1c18 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 @@ -9,11 +9,11 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; @@ -105,7 +105,7 @@ public class RemoteFileImportActionDelegate extends RemoteFileImportExportAction // do not save settings again importData.setSaveSettings(false); } catch (CoreException ex) { - String message = MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_READ, new Object[] { description.getFullPath(), ex.getStatus().getMessage() }); + String message = NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_READ, description.getFullPath(), ex.getStatus().getMessage()); addToStatus(readStatus, message, ex); return null; } finally { @@ -117,7 +117,7 @@ public class RemoteFileImportActionDelegate extends RemoteFileImportExportAction reader.close(); } } catch (CoreException ex) { - String message = MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_CLOSE, new Object[] { description.getFullPath() }); + String message = NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_CLOSE, description.getFullPath()); addToStatus(readStatus, message, ex); } } diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileOverwriteQuery.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileOverwriteQuery.java index 0af506255d6..22077ca104d 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileOverwriteQuery.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileOverwriteQuery.java @@ -8,14 +8,14 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; -import java.text.MessageFormat; - import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.internal.importexport.RemoteImportExportResources; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.swt.widgets.Display; @@ -52,11 +52,11 @@ public class RemoteFileOverwriteQuery implements IOverwriteQuery { //and there are at least 2 segments. if (path.getFileExtension() == null || path.segmentCount() < 2) { //TODO internal class used - messageString = MessageFormat.format(RemoteImportExportResources.WizardDataTransfer_existsQuestion, new String[] { pathString }); + messageString = NLS.bind(RemoteImportExportResources.WizardDataTransfer_existsQuestion, pathString ); } else { // TODO internal class used - messageString = MessageFormat.format(RemoteImportExportResources.WizardDataTransfer_overwriteNameAndPathQuestion, new String[] { path.lastSegment(), - path.removeLastSegments(1).toOSString() }); + messageString = NLS.bind(RemoteImportExportResources.WizardDataTransfer_overwriteNameAndPathQuestion, path.lastSegment(), + path.removeLastSegments(1).toOSString() ); } Shell shell = SystemBasePlugin.getActiveWorkbenchShell(); // TODO internal class used 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 f1b3d60c67e..79b799ba718 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 @@ -10,12 +10,12 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; import java.io.File; import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Hashtable; @@ -1165,7 +1165,7 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen String fileExtension = location.getFileExtension(); // ensure that file extension is valid if (fileExtension == null || !fileExtension.equals(Utilities.IMPORT_DESCRIPTION_EXTENSION)) { - setErrorMessage(MessageFormat.format(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_INVALID_EXTENSION, new Object[] { Utilities.IMPORT_DESCRIPTION_EXTENSION })); + setErrorMessage(NLS.bind(RemoteImportExportResources.IMPORT_EXPORT_ERROR_DESCRIPTION_INVALID_EXTENSION, Utilities.IMPORT_DESCRIPTION_EXTENSION)); return false; } } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java index 1e59f406f41..d87f0a55400 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java @@ -34,6 +34,7 @@ * David McKnight (IBM) - [209704] added supportsEncodingConversion() * Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations * David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -46,7 +47,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -59,6 +59,7 @@ import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.core.model.DataStoreAttributes; import org.eclipse.dstore.core.model.DataStoreResources; import org.eclipse.dstore.core.model.IDataStoreProvider; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; import org.eclipse.rse.dstore.universal.miners.UniversalByteStreamHandler; import org.eclipse.rse.internal.services.dstore.ServiceResources; @@ -595,7 +596,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer monitor.worked(bytesRead); - String str = MessageFormat.format(_percentMsg, new Object[] {totalSentBuf, totalBuf, percentBuf}); + String str = NLS.bind(_percentMsg, new Object[] {totalSentBuf, totalBuf, percentBuf}); monitor.subTask(str); isCancelled = monitor.isCanceled(); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java index eb80426e990..f5ba2d60561 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 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 @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes * David McKnight (IBM) - [162195] new APIs for upload multi and download multi * David McKnight (IBM) - [197480] eliminating UI dependencies + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.services.dstore.util; @@ -21,7 +22,6 @@ package org.eclipse.rse.services.dstore.util; import java.io.File; -import java.text.MessageFormat; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.dstore.core.model.DE; @@ -29,6 +29,7 @@ import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.extra.DomainEvent; import org.eclipse.dstore.extra.IDomainListener; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; import org.eclipse.rse.internal.services.dstore.ServiceResources; import org.eclipse.rse.services.clientserver.messages.SystemMessage; @@ -165,7 +166,7 @@ public class DownloadListener implements IDomainListener percentBuf.append(percent); percentBuf.append("%"); //$NON-NLS-1$ - String str = MessageFormat.format(_percentMsg, new Object[] {current, total, percentBuf}); + String str = NLS.bind(_percentMsg, new Object[] {current, total, percentBuf}); _monitor.subTask(str); 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 28948db3d5c..1626edbac1c 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 @@ -71,6 +71,7 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.internal.services.files.ftp; @@ -85,7 +86,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -99,6 +99,7 @@ import org.apache.commons.net.ftp.FTPReply; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.core.model.IPropertySet; import org.eclipse.rse.internal.services.files.ftp.parser.IFTPClientConfigFactory; import org.eclipse.rse.internal.services.files.ftp.parser.IFTPClientConfigProxy; @@ -1528,7 +1529,7 @@ public class FTPService extends AbstractFileService implements IFileService, IFT fWorkToDate += count; Long workToDateKB = new Long(fWorkToDate / 1024L); Double workPercent = new Double(fWorkPercentFactor * fWorkToDate); - String subDesc = MessageFormat.format( + String subDesc = NLS.bind( FTPServiceResources.FTP_File_Service_Monitor_Format, new Object[] { workToDateKB, fMaxWorkKB, workPercent 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 7037902e5c1..e187d941263 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 @@ -23,6 +23,7 @@ * 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 + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.files; @@ -36,7 +37,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.Vector; @@ -684,7 +684,7 @@ public class SftpFileService extends AbstractFileService implements IFileService fWorkToDate += count; Long workToDateKB = new Long(fWorkToDate / 1024L); Double workPercent = new Double(fWorkPercentFactor * fWorkToDate); - String subDesc = MessageFormat.format( + String subDesc = NLS.bind( SshServiceResources.SftpFileService_Msg_Progress, new Object[] { workToDateKB, fMaxWorkKB, workPercent diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java index 392c056c1f8..0821f48d0bf 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -12,13 +12,12 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.ui.view; -import java.text.MessageFormat; - import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.events.KeyAdapter; @@ -140,7 +139,7 @@ public class SystemComboBoxCellEditor extends CellEditor } else { // try to insert the current value into the error message. setErrorMessage( - MessageFormat.format(getErrorMessage(), new Object[] {items[selection]})); + NLS.bind(getErrorMessage(), items[selection])); } fireApplyEditorValue(); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemInheritableTextCellEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemInheritableTextCellEditor.java index 0e73b5d5908..e0266970933 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemInheritableTextCellEditor.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemInheritableTextCellEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2007 IBM Corporation and others. + * Copyright (c) 2002, 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 @@ -12,14 +12,13 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.internal.ui.view; -import java.text.MessageFormat; - import org.eclipse.core.runtime.Assert; import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.ui.widgets.InheritableEntryField; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusAdapter; @@ -325,7 +324,7 @@ public class SystemInheritableTextCellEditor if (!newValidState) { // try to insert the current value into the error message. - setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] {value})); + setErrorMessage(NLS.bind(getErrorMessage(), value)); } valueChanged(oldValidState, newValidState); } @@ -511,7 +510,7 @@ public class SystemInheritableTextCellEditor if (!newValidState) { // try to insert the current value into the error message. - setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] {value})); + setErrorMessage(NLS.bind(getErrorMessage(), value)); } valueChanged(oldValidState, newValidState); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java index a3832cbfada..b9f8923fd72 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java @@ -28,88 +28,25 @@ package org.eclipse.rse.ui; */ public interface ISystemMessages { - //public static final String PLUGIN_ID ="org.eclipse.rse.ui"; - //public static final String PREFIX = PLUGIN_ID+"."; - // Resource Bundle ids - //public static final String RESID_PREFIX = PREFIX+"ui."; - // Messages - //public static final String MSG_PREFIX = RESID_PREFIX+"msg."; - //public static final String MSG_TITLE = MSG_PREFIX + "Title"; - //public static final String MSG_TITLEWARNING = MSG_PREFIX + "TitleWarning"; - //public static final String MSG_TITLEINFORMATION = MSG_PREFIX + "TitleInformation"; - //public static final String MSG_TITLECONFIRMATION = MSG_PREFIX + "TitleConfirmation"; - - //public static final String MSG_CREATE_PROJECT_ERROR = "RSEG1002"; //MSG_PREFIX + "CreateProjectFailed"; - - //public static final String MSG_VALIDATE_PREFIX = MSG_PREFIX + "Validate."; - //public static final String MSG_UNDERCONSTRUCTION = "RSEG1001"; - - public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002"; //$NON-NLS-1$ - - public static final String MSG_CONFIRM_ENABLE_CLASSIC_HELP = "RSEG1400"; //$NON-NLS-1$ - public static final String MSG_ERROR_ENABLE_CLASSIC_HELP = "RSEG1401"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008"; //$NON-NLS-1$ + /***************************************************/ + /* Unused messages (that may still be usable + /***************************************************/ public static final String MSG_VALIDATE_RENAME_EMPTY = "RSEG1012"; //MSG_VALIDATE_PREFIX + "ReName.Required"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique"; //$NON-NLS-1$ public static final String MSG_VALIDATE_RENAME_NOTVALID = "RSEG1011"; //MSG_VALIDATE_PREFIX + "ReName.NotValid"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FOLDERNAME_NOTVALID = "RSEG1018"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILENAME_NOTVALID = "RSEG1019"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041"; //$NON-NLS-1$ public static final String MSG_VALIDATE_CONNECTIONNAME_NOTVALID = "RSEG1023"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_ENTRY_EMPTY = "RSEG1029"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_ENTRY_NOTUNIQUE= "RSEG1030"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_ENTRY_NOTVALID = "RSEG1031"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTVALID = "RSEG1039"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERNAME_NOTVALID = "RSEG1044"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PASSWORD_EXPIRED = "RSEG1036"; //MSG_VALIDATE_PREFIX + "PasswordExpired"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PASSWORD_INVALID = "RSEG1297"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERSTRING_NOTUNIQUE= "RSEG1046"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERSTRING_NOTVALID = "RSEG1047"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERSTRING_DUPLICATES = "RSEG1048"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS = "RSEG1049"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172"; //$NON-NLS-1$ - - public static final String MSG_CONFIRM_DELETE = "RSEG1052"; //$NON-NLS-1$ + public static final String MSG_CONFIRM_DELETEREMOTE = "RSEG1130"; //$NON-NLS-1$ public static final String MSG_CONFIRM_DELETEPROFILE = "RSEG1053"; //$NON-NLS-1$ - public static final String MSG_CONFIRM_CHANGES = "RSEG1201"; //$NON-NLS-1$ + public static final String MSG_CONFIRM_CHANGES_CANCELABLE = "RSEG1202"; //$NON-NLS-1$ //public static final String MSG_CONNECT_PREFIX = MSG_PREFIX + "Connect."; @@ -119,7 +56,6 @@ public interface ISystemMessages public static final String MSG_CONNECT_UNKNOWNHOST = "RSEG1057"; //MSG_CONNECT_PREFIX + "UnknownHost"; //$NON-NLS-1$ public static final String MSG_CONNECT_CANCELLED = "RSEG1058"; //MSG_CONNECT_PREFIX + "Cancelled"; //$NON-NLS-1$ - public static final String MSG_CONNECT_DAEMON_FAILED = "RSEG1242"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_CONNECT_DAEMON_FAILED_EXCEPTION = "RSEG1243"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_CONNECT_SSL_EXCEPTION = "RSEC2307"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$ @@ -130,28 +66,21 @@ public interface ISystemMessages public static final String MSG_INITIALIZING_SERVER= "RSEC2313"; //$NON-NLS-1$ public static final String MSG_PORT_OUT_RANGE = "RSEC2316"; //$NON-NLS-1$ + //public static final String MSG_DISCONNECT_PREFIX = MSG_PREFIX + "Disconnect."; public static final String MSG_DISCONNECT_PROGRESS = "RSEG1059"; //MSG_DISCONNECT_PREFIX + "Disconnecting"; //$NON-NLS-1$ public static final String MSG_DISCONNECTWITHPORT_PROGRESS = "RSEG1060"; //MSG_DISCONNECT_PREFIX + "DisconnectingWithPort"; //$NON-NLS-1$ public static final String MSG_DISCONNECT_FAILED = "RSEG1061"; // MSG_DISCONNECT_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_DISCONNECT_CANCELLED = "RSEG1062"; //MSG_DISCONNECT_PREFIX + "Cancelled"; //$NON-NLS-1$ - //public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save."; - public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_RESTORE_FAILED = "RSEG1051"; //$NON-NLS-1$ public static final String MSG_SAVE_CHANGES_PENDING = "RSEG1201"; //$NON-NLS-1$ - //public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception."; - public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$ - public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$ - public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$ public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving"; //$NON-NLS-1$ - + //public static final String MSG_RESOLVE_PREFIX = MSG_PREFIX + "Resolve."; public static final String MSG_RESOLVE_PROGRESS = "RSEG1070"; //$NON-NLS-1$ - //public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query."; - public static final String MSG_QUERY_PROGRESS = "RSEG1095"; //$NON-NLS-1$ public static final String MSG_QUERY_PROPERTIES_PROGRESS = "RSEG1096"; //$NON-NLS-1$ //public static final String MSG_SET_PREFIX = MSG_PREFIX + "Set."; @@ -161,18 +90,9 @@ public interface ISystemMessages //public static final String MSG_RUN_PREFIX = MSG_PREFIX + "Run."; public static final String MSG_RUN_PROGRESS = "RSEG1071"; //$NON-NLS-1$ - //public static final String MSG_COPY_PREFIX = MSG_PREFIX + "Copy."; - public static final String MSG_COPY_PROGRESS = "RSEG1072"; //$NON-NLS-1$ - public static final String MSG_COPYCONNECTION_PROGRESS = "RSEG1073"; //$NON-NLS-1$ - public static final String MSG_COPYCONNECTIONS_PROGRESS = "RSEG1074"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERPOOLS_PROGRESS = "RSEG1075"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERPOOL_PROGRESS = "RSEG1076"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERS_PROGRESS = "RSEG1077"; //$NON-NLS-1$ - public static final String MSG_COPYFILTER_PROGRESS = "RSEG1078"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERSTRINGS_PROGRESS="RSEG1079"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERSTRING_PROGRESS ="RSEG1080"; //$NON-NLS-1$ public static final String MSG_COPYSUBSYSTEMS_PROGRESS = "RSEG1081"; //$NON-NLS-1$ + public static final String MSG_DOWNLOAD_PROGRESS = "RSEG1280"; //$NON-NLS-1$ public static final String MSG_UPLOAD_PROGRESS = "RSEG1281"; //$NON-NLS-1$ public static final String MSG_SYNCHRONIZE_PROGRESS = "RSEG1282"; //$NON-NLS-1$ @@ -181,57 +101,24 @@ public interface ISystemMessages public static final String MSG_DOWNLOADING_PROGRESS = "RSEG1295"; //$NON-NLS-1$ public static final String MSG_UPLOADING_PROGRESS = "RSEG1296"; //$NON-NLS-1$ - public static final String MSG_COPYFILTERPOOL_COMPLETE = "RSEG1082"; //$NON-NLS-1$ - - //public static final String MSG_MOVE_PREFIX = MSG_PREFIX + "Move."; public static final String MSG_MOVE_PROGRESS = "RSEG1083"; // "moving %1 to %2" //$NON-NLS-1$ - public static final String MSG_MOVECONNECTION_PROGRESS = "RSEG1084"; //$NON-NLS-1$ - public static final String MSG_MOVECONNECTIONS_PROGRESS = "RSEG1085"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERPOOLS_PROGRESS = "RSEG1086"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERPOOL_PROGRESS = "RSEG1087"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERS_PROGRESS = "RSEG1088"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTER_PROGRESS = "RSEG1089"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091"; //$NON-NLS-1$ - public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092"; //$NON-NLS-1$ - - public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115"; //$NON-NLS-1$ - public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116"; //$NON-NLS-1$ - public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117"; //$NON-NLS-1$ - public static final String MSG_MOVETHINGGENERIC_PROGRESS = "RSEG1118"; //$NON-NLS-1$ - public static final String MSG_RENAMEGENERIC_PROGRESS = "RSEG1142"; //$NON-NLS-1$ + public static final String MSG_CREATEFILEGENERIC_PROGRESS = "RSEG1143"; //$NON-NLS-1$ public static final String MSG_CREATEFOLDERGENERIC_PROGRESS = "RSEG1144"; //$NON-NLS-1$ + public static final String MSG_SAVING_PROGRESS = "RSEG1119"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$ - public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$ - - public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$ - public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122"; //$NON-NLS-1$ public static final String MSG_FOLDER_INUSE = "RSEG1150"; // defect 42138 //$NON-NLS-1$ public static final String MSG_FILE_INUSE = "RSEG1151"; // defect 42332 //$NON-NLS-1$ - public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503 //$NON-NLS-1$ - public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161"; //$NON-NLS-1$ - public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162"; //$NON-NLS-1$ - - //public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation."; - public static final String MSG_OPERATION_FAILED = "RSEG1066"; //$NON-NLS-1$ - public static final String MSG_OPERATION_CANCELLED = "RSEG1067"; //$NON-NLS-1$ - //public static final String MSG_LOADING_PREFIX = MSG_PREFIX + "Loading."; public static final String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = "RSEG1068"; //$NON-NLS-1$ public static final String MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED = "RSEG1069"; //$NON-NLS-1$ - public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$ - public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$ - public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$ // universal find files @@ -241,18 +128,13 @@ public interface ISystemMessages // universal commands public static final String MSG_UCMD_INVOCATION_EMPTY = "RSEG1260"; //$NON-NLS-1$ + // operation status public static final String MSG_OPERATION_RUNNING = "RSEG1255"; //$NON-NLS-1$ public static final String MSG_OPERATION_FINISHED = "RSEG1256"; //$NON-NLS-1$ public static final String MSG_OPERTION_STOPPED = "RSEG1257"; //$NON-NLS-1$ public static final String MSG_OPERATION_DISCONNECTED = "RSEG1258"; //$NON-NLS-1$ - public static final String MSG_ENCODING_NOT_SUPPORTED = "RSEG1244"; //$NON-NLS-1$ - - - // -------------------------- - // UNIVERSAL FILE MESSAGES... - // -------------------------- public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY = "RSEF1011"; //$NON-NLS-1$ public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE= "RSEF1007"; //$NON-NLS-1$ public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID = "RSEF1008"; //$NON-NLS-1$ @@ -274,9 +156,150 @@ public interface ISystemMessages public static final String FILEMSG_MOVE_FILTER_NOT_VALID = "RSEF1313"; //$NON-NLS-1$ public static final String FILEMSG_DELETING = "RSEF1315"; //$NON-NLS-1$ public static final String FILEMSG_MOVE_INTERRUPTED = "RSEG1245"; //$NON-NLS-1$ + + public static final String FILEMSG_COPY_INTERRUPTED = "RSEG1248"; //$NON-NLS-1$ + + + /***************************************************/ + /* End of Unused messages (that may still be usable + /***************************************************/ + + + public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FOLDERNAME_NOTVALID = "RSEG1018"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILENAME_NOTVALID = "RSEG1019"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_ENTRY_EMPTY = "RSEG1029"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_ENTRY_NOTUNIQUE= "RSEG1030"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_ENTRY_NOTVALID = "RSEG1031"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERSTRING_NOTUNIQUE= "RSEG1046"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERSTRING_NOTVALID = "RSEG1047"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERSTRING_DUPLICATES = "RSEG1048"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS = "RSEG1049"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172"; //$NON-NLS-1$ + + public static final String MSG_CONFIRM_DELETE = "RSEG1052"; //$NON-NLS-1$ + public static final String MSG_CONFIRM_CHANGES = "RSEG1201"; //$NON-NLS-1$ + + + + + //public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save."; + public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed"; //$NON-NLS-1$ + + //public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception."; + public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$ + public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$ + public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$ + + + //public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query."; + public static final String MSG_QUERY_PROGRESS = "RSEG1095"; //$NON-NLS-1$ + + //public static final String MSG_COPY_PREFIX = MSG_PREFIX + "Copy."; + public static final String MSG_COPY_PROGRESS = "RSEG1072"; //$NON-NLS-1$ + public static final String MSG_COPYCONNECTION_PROGRESS = "RSEG1073"; //$NON-NLS-1$ + public static final String MSG_COPYCONNECTIONS_PROGRESS = "RSEG1074"; //$NON-NLS-1$ + public static final String MSG_COPYFILTERPOOLS_PROGRESS = "RSEG1075"; //$NON-NLS-1$ + public static final String MSG_COPYFILTERPOOL_PROGRESS = "RSEG1076"; //$NON-NLS-1$ + public static final String MSG_COPYFILTERS_PROGRESS = "RSEG1077"; //$NON-NLS-1$ + public static final String MSG_COPYFILTER_PROGRESS = "RSEG1078"; //$NON-NLS-1$ + public static final String MSG_COPYFILTERSTRINGS_PROGRESS="RSEG1079"; //$NON-NLS-1$ + public static final String MSG_COPYFILTERSTRING_PROGRESS ="RSEG1080"; //$NON-NLS-1$ + + public static final String MSG_COPYFILTERPOOL_COMPLETE = "RSEG1082"; //$NON-NLS-1$ + + //public static final String MSG_MOVE_PREFIX = MSG_PREFIX + "Move."; + public static final String MSG_MOVECONNECTION_PROGRESS = "RSEG1084"; //$NON-NLS-1$ + public static final String MSG_MOVECONNECTIONS_PROGRESS = "RSEG1085"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERPOOLS_PROGRESS = "RSEG1086"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERPOOL_PROGRESS = "RSEG1087"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERS_PROGRESS = "RSEG1088"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTER_PROGRESS = "RSEG1089"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091"; //$NON-NLS-1$ + public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092"; //$NON-NLS-1$ + + + public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115"; //$NON-NLS-1$ + public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116"; //$NON-NLS-1$ + public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117"; //$NON-NLS-1$ + public static final String MSG_MOVETHINGGENERIC_PROGRESS = "RSEG1118"; //$NON-NLS-1$ + public static final String MSG_RENAMEGENERIC_PROGRESS = "RSEG1142"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$ + public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$ + + public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$ + + + public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503 //$NON-NLS-1$ + public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161"; //$NON-NLS-1$ + public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162"; //$NON-NLS-1$ + + //public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation."; + public static final String MSG_OPERATION_FAILED = "RSEG1066"; //$NON-NLS-1$ + public static final String MSG_OPERATION_CANCELLED = "RSEG1067"; //$NON-NLS-1$ + + + public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$ + public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$ + + + public static final String MSG_ENCODING_NOT_SUPPORTED = "RSEG1244"; //$NON-NLS-1$ + + + // -------------------------- + // UNIVERSAL FILE MESSAGES... + // -------------------------- public static final String FILEMSG_RENAME_INTERRUPTED = "RSEG1246"; //$NON-NLS-1$ public static final String FILEMSG_DELETE_INTERRUPTED = "RSEG1247"; //$NON-NLS-1$ - public static final String FILEMSG_COPY_INTERRUPTED = "RSEG1248"; //$NON-NLS-1$ + + + + /******/ + // ------------------------- // IMPORT/EXPORT MESSAGES... diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java index f4761cae78a..4a1cbd18f5b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2006,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 @@ -11,13 +11,12 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind ********************************************************************************/ package org.eclipse.rse.ui.operations; -import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; @@ -25,6 +24,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.osgi.util.NLS; public class Policy { @@ -74,7 +74,7 @@ public class Policy { */ public static String bind(String key, Object[] args) { try { - return MessageFormat.format(bind(key), args); + return NLS.bind(bind(key), args); } catch (MissingResourceException e) { return key; } catch (NullPointerException e) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardRegistry.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardRegistry.java index 5f21000b76d..99b3e6cf939 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Wind River Systems, Inc. and others. + * Copyright (c) 2007,2008 Wind River Systems, Inc. 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 @@ -8,16 +8,17 @@ * Contributors: * Uwe Stieber (Wind River) - initial API and implementation. * Javier Montalvo Orus (Symbian) - [174992] default wizard hides special ones + * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind *******************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; -import java.text.MessageFormat; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IConfigurationElement; 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.ui.RSEUIPlugin; @@ -126,7 +127,7 @@ public class RSENewConnectionWizardRegistry extends RSEAbstractWizardRegistry { descriptor = candidate; } else { String message = "Duplicated new connection wizard registration for system type ''{0}'' (wizard id = {1})."; //$NON-NLS-1$ - message = MessageFormat.format(message, new Object[] { id, candidate.getId()}); + message = NLS.bind(message, id, candidate.getId()); RSECorePlugin.getDefault().getLogger().logWarning(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 a8eb64a5aa8..409fd9bba32 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 @@ -86,7 +86,6 @@ 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; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.dialogs.SystemPromptDialog; @@ -1715,8 +1714,9 @@ public abstract class SubSystem extends RSEModelObject if (!supportsCaching()) { // offline and no caching support so throw exception - SystemMessage sMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OFFLINE_CANT_CONNECT); - sMsg.makeSubstitution(getHost().getAliasName()); + String msgTxt = NLS.bind(SubSystemResources.MSG_OFFLINE_CANT_CONNECT,getHost().getAliasName()); + String msgDetails = SubSystemResources.MSG_OFFLINE_CANT_CONNECT_DETAILS; + SystemMessage sMsg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.INFO, msgTxt, msgDetails); throw new SystemMessageException(sMsg); } @@ -1806,10 +1806,8 @@ public abstract class SubSystem extends RSEModelObject */ protected void showConnectCancelledMessage(Shell shell, String hostName, int port) { - //SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell, RSEUIPlugin.getResourceBundle(), - // ISystemMessages.MSG_CONNECT_CANCELLED, hostName); - SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED); - msg.makeSubstitution(hostName); + String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_CANCELLED, hostName); + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.CANCEL, msgTxt); SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); msgDlg.open(); } @@ -1820,12 +1818,10 @@ public abstract class SubSystem extends RSEModelObject */ 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)); + String msgTxt = NLS.bind(SubSystemResources.MSG_DISCONNECT_FAILED, hostName); + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.CANCEL, msgTxt, exc); + + SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg); msgDlg.setException(exc); msgDlg.open(); } @@ -1836,10 +1832,10 @@ public abstract class SubSystem extends RSEModelObject */ 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)); + String msgTxt = NLS.bind(SubSystemResources.MSG_DISCONNECT_CANCELLED, hostName); + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.CANCEL, msgTxt); + + SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg); msgDlg.open(); } @@ -1849,43 +1845,46 @@ public abstract class SubSystem extends RSEModelObject */ protected static String getResolvingMessage(String filterString) { - String msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_RESOLVE_PROGRESS).makeSubstitution(filterString).getLevelOneText(); - return msg; + String msgTxt = NLS.bind(SubSystemResources.MSG_RESOLVE_PROGRESS, filterString); + return msgTxt; } /** * Helper method to return the message "Running command &1..." */ protected static String getRunningMessage(String cmd) { - return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_RUN_PROGRESS).makeSubstitution(cmd).getLevelOneText(); + String msgTxt = NLS.bind(SubSystemResources.MSG_RUN_PROGRESS, cmd); + return msgTxt; } /** * Helper method to return the message "Querying &1..." */ protected static String getQueryingMessage(String key) { - return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_QUERY_PROGRESS).makeSubstitution(key).getLevelOneText(); + String msgTxt = NLS.bind(SubSystemResources.MSG_QUERY_PROGRESS, key); + return msgTxt; } /** * Helper method to return the message "Setting &1..." */ protected static String getSettingMessage(String key) { - return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SET_PROGRESS).makeSubstitution(key).getLevelOneText(); + String msgTxt = NLS.bind(SubSystemResources.MSG_SET_PROGRESS, key); + return msgTxt; } /** * Helper method to return the message "Querying properties..." */ protected static String getQueryingMessage() { - return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_QUERY_PROPERTIES_PROGRESS).getLevelOneText(); + return SubSystemResources.MSG_QUERY_PROPERTIES_PROGRESS; } /** * Helper method to return the message "Setting properties..." */ protected static String getSettingMessage() { - return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SET_PROPERTIES_PROGRESS).getLevelOneText(); + return SubSystemResources.MSG_SET_PROPERTIES_PROGRESS; } /** @@ -1907,8 +1906,10 @@ public abstract class SubSystem extends RSEModelObject String excMsg = exc.getMessage(); if ((excMsg == null) || (excMsg.length()==0)) excMsg = "Exception " + exc.getClass().getName(); //$NON-NLS-1$ - sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED); - sysMsg.makeSubstitution(excMsg); + + String msgTxt = NLS.bind(SubSystemResources.MSG_OPERATION_FAILED, excMsg); + + sysMsg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, exc); SystemMessageDialog msgDlg = new SystemMessageDialog(shell, sysMsg); @@ -1925,7 +1926,9 @@ public abstract class SubSystem extends RSEModelObject */ protected void showOperationCancelledMessage(Shell shell) { - SystemMessageDialog msgDlg = new SystemMessageDialog(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED)); + String msgTxt = SubSystemResources.MSG_OPERATION_CANCELLED; + SystemMessage msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.CANCEL, msgTxt); + SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); msgDlg.open(); } diff --git a/rse/plugins/org.eclipse.rse.ui/systemmessages.xml b/rse/plugins/org.eclipse.rse.ui/systemmessages.xml index c8172369fde..6dd02a0ab5c 100644 --- a/rse/plugins/org.eclipse.rse.ui/systemmessages.xml +++ b/rse/plugins/org.eclipse.rse.ui/systemmessages.xml @@ -806,15 +806,7 @@ Kevin Doyle (IBM) - [160769] Added message for invalid filter when moving files In the properties for the File subsystem, choose a configuration that supports Archive Management. - - - This action will take a few minutes. Proceed? - This action uncompresses a large number of HTML files from a zip file. It will take awhile, and require sufficient disk space. Press Yes to continue, No to cancel. - - - Classic help already enabled. - The HTML files for the CODE and VisualAge RPG help have already been uncompressed. - +