### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.files.ui Index: src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java,v retrieving revision 1.5 diff -u -r1.5 SystemViewRemoteSearchResultSetAdapter.java --- src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java 15 May 2007 23:53:55 -0000 1.5 +++ src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteSearchResultSetAdapter.java 19 Feb 2008 20:50:11 -0000 @@ -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.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 @@ 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; } } Index: src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java,v retrieving revision 1.67 diff -u -r1.67 SystemViewRemoteFileAdapter.java --- src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java 12 Feb 2008 23:42:29 -0000 1.67 +++ src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java 19 Feb 2008 20:50:11 -0000 @@ -74,6 +74,7 @@ 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.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.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.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 @@ 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 @@ 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 @@ if (monitor != null) { - monitor.beginTask(_downloadMessage.getLevelOneText(), (int)totalByteSize); + monitor.beginTask(_downloadMessage, (int)totalByteSize); //monitor.done(); } @@ -1950,9 +1954,11 @@ 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 @@ 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 @@ } } } - //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 @@ 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 @@ 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 @@ //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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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) Index: src/org/eclipse/rse/internal/files/ui/Activator.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/Activator.java,v retrieving revision 1.5 diff -u -r1.5 Activator.java --- src/org/eclipse/rse/internal/files/ui/Activator.java 12 Oct 2007 21:02:32 -0000 1.5 +++ src/org/eclipse/rse/internal/files/ui/Activator.java 19 Feb 2008 20:50:06 -0000 @@ -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 @@ private static SystemUniversalTempFileListener _tempFileListener; + public final static String PLUGIN_ID = "org.eclipse.rse.files.ui"; //$NON-NLS-1$ + /** * The constructor. */ Index: src/org/eclipse/rse/internal/files/ui/FileResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties,v retrieving revision 1.16 diff -u -r1.16 FileResources.properties --- src/org/eclipse/rse/internal/files/ui/FileResources.properties 12 Feb 2008 23:42:29 -0000 1.16 +++ src/org/eclipse/rse/internal/files/ui/FileResources.properties 19 Feb 2008 20:50:07 -0000 @@ -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_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_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=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_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 @@ # 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 @@ -184,7 +184,7 @@ #============================================================== # REMOTE FILE SYSTEM CACHE PREFERENCE PAGE #============================================================= -RESID_PREF_CACHE_DESCRIPTION=When RSE is used for editing, the remote files are cached. Use this page to clear or limit the size of the file cache. +RESID_PREF_CACHE_DESCRIPTION=When RSE is used for editing, the remote files are cached.Use this page to clear or limit the size of the file cache. RESID_PREF_CACHE_CLEAR=Clear Cached Files RESID_PREF_CACHE_CLEAR_LABEL=&Clear cached files RESID_PREF_CACHE_CLEAR_TOOLTIP=Delete remote files that have been cached in the local workspace @@ -214,7 +214,7 @@ 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_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 @@ ################################################################################## -############################ Project menu item ############################# +############################Project menu item############################# ################################################################################## RESID_OPEN_FROM_ASSOCIATED_PROJECT=Open from Associated Project (&1) @@ -343,3 +343,164 @@ 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: +- the user does not have enough authority to create the file +- 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: +- the user does not have enough authority to create the folder +- 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: +{0} +FILEMSG_RENAME_INTERRUPTED =Operation interrupted. Some objects have been renamed. +FILEMSG_RENAME_INTERRUPTED_DETAILS= The following objects have been renamed: +{0} +FILEMSG_DELETE_INTERRUPTED =Operation interrupted. Some objects have been deleted. +FILEMSG_DELETE_INTERRUPTED_DETAILS = The following objects have been deleted: +{0} +FILEMSG_COPY_INTERRUPTED = Operation interrupted. Some objects have been copied to the destination. +FILEMSG_COPY_INTERRUPTED_DETAILS=The following objects have been copied: +{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 Index: src/org/eclipse/rse/internal/files/ui/FileResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java,v retrieving revision 1.13 diff -u -r1.13 FileResources.java --- src/org/eclipse/rse/internal/files/ui/FileResources.java 12 Feb 2008 23:42:29 -0000 1.13 +++ src/org/eclipse/rse/internal/files/ui/FileResources.java 19 Feb 2008 20:50:06 -0000 @@ -355,6 +355,139 @@ 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 Index: src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java,v retrieving revision 1.17 diff -u -r1.17 SystemFilePropertyPage.java --- src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java 12 Feb 2008 23:42:28 -0000 1.17 +++ src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java 19 Feb 2008 20:50:08 -0000 @@ -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 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.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 @@ } } 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()); Index: src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java,v retrieving revision 1.10 diff -u -r1.10 SystemCachePreferencePage.java --- src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java 25 May 2007 13:07:19 -0000 1.10 +++ src/org/eclipse/rse/internal/files/ui/propertypages/SystemCachePreferencePage.java 19 Feb 2008 20:50:08 -0000 @@ -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.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.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 @@ 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 @@ 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()); Index: src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java,v retrieving revision 1.11 diff -u -r1.11 SystemUploadConflictAction.java --- src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java 25 May 2007 13:07:16 -0000 1.11 +++ src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java 19 Feb 2008 20:50:08 -0000 @@ -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.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.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 @@ 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 @@ 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 Index: src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java,v retrieving revision 1.13 diff -u -r1.13 SystemCopyRemoteFileAction.java --- src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java 14 Nov 2007 17:56:55 -0000 1.13 +++ src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java 19 Feb 2008 20:50:07 -0000 @@ -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 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.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 @@ 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 Index: src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java,v retrieving revision 1.11 diff -u -r1.11 SystemMoveRemoteFileAction.java --- src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java 19 Dec 2007 03:04:45 -0000 1.11 +++ src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java 19 Feb 2008 20:50:07 -0000 @@ -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.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 @@ { 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 @@ 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 @@ 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 @@ // 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; } Index: src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java,v retrieving revision 1.9 diff -u -r1.9 SystemNewFileWizard.java --- src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java 15 Nov 2007 19:25:46 -0000 1.9 +++ src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFileWizard.java 19 Feb 2008 20:50:12 -0000 @@ -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.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.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.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 @@ { 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 @@ 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 @@ 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 @@ 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 Index: src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java,v retrieving revision 1.6 diff -u -r1.6 SystemNewFolderWizard.java --- src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java 15 Nov 2007 19:25:46 -0000 1.6 +++ src/org/eclipse/rse/internal/files/ui/wizards/SystemNewFolderWizard.java 19 Feb 2008 20:50:12 -0000 @@ -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.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.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 @@ { 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 @@ 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 @@ } // 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 @@ } 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 Index: src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java,v retrieving revision 1.12 diff -u -r1.12 SystemSearchPage.java --- src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java 18 Jul 2007 12:45:32 -0000 1.12 +++ src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java 19 Feb 2008 20:50:09 -0000 @@ -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.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.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 @@ 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 @@ 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; } Index: src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java,v retrieving revision 1.4 diff -u -r1.4 SystemFileFilterStringEditPane.java --- src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java 15 May 2007 23:53:55 -0000 1.4 +++ src/org/eclipse/rse/files/ui/widgets/SystemFileFilterStringEditPane.java 19 Feb 2008 20:50:05 -0000 @@ -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 @@ { 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 @@ 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 @@ } // 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 @@ } // 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); } } } Index: src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java,v retrieving revision 1.5 diff -u -r1.5 SaveAsForm.java --- src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java 15 May 2007 23:53:55 -0000 1.5 +++ src/org/eclipse/rse/files/ui/widgets/SaveAsForm.java 19 Feb 2008 20:50:05 -0000 @@ -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 @@ //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; Index: src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java,v retrieving revision 1.18 diff -u -r1.18 SystemQualifiedRemoteFolderCombo.java --- src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java 5 Nov 2007 15:55:18 -0000 1.18 +++ src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java 19 Feb 2008 20:50:05 -0000 @@ -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.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.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 @@ 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 @@ 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 @@ } } 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()) Index: src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java,v retrieving revision 1.10 diff -u -r1.10 SystemSelectRemoteFilesForm.java --- src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java 25 Apr 2007 20:24:12 -0000 1.10 +++ src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFilesForm.java 19 Feb 2008 20:50:06 -0000 @@ -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.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 @@ { 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); Index: src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java,v retrieving revision 1.74 diff -u -r1.74 UniversalFileTransferUtility.java --- src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 5 Feb 2008 20:03:21 -0000 1.74 +++ src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 19 Feb 2008 20:50:04 -0000 @@ -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.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.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.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 @@ 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 @@ 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 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 @@ } 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 @@ 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 @@ 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 @@ 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) { Index: src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java,v retrieving revision 1.23 diff -u -r1.23 SystemTempFileListener.java --- src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java 24 Oct 2007 14:57:56 -0000 1.23 +++ src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java 19 Feb 2008 20:50:03 -0000 @@ -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.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 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 @@ 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 @@ 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); Index: src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java,v retrieving revision 1.51 diff -u -r1.51 SystemEditableRemoteFile.java --- src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java 12 Feb 2008 23:42:29 -0000 1.51 +++ src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java 19 Feb 2008 20:50:02 -0000 @@ -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.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.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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ { // 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 @@ 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 @@ 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; } } #P org.eclipse.rse.connectorservice.telnet Index: src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties,v retrieving revision 1.2 diff -u -r1.2 TelnetConnectorResources.properties --- src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties 11 May 2007 13:02:14 -0000 1.2 +++ src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.properties 19 Feb 2008 20:50:13 -0000 @@ -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 @@ 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 Index: src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java,v retrieving revision 1.3 diff -u -r1.3 TelnetConnectorResources.java --- src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java 16 May 2007 11:59:40 -0000 1.3 +++ src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorResources.java 19 Feb 2008 20:50:13 -0000 @@ -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 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; } Index: src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.telnet/src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java,v retrieving revision 1.14 diff -u -r1.14 TelnetConnectorService.java --- src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java 4 Jul 2007 16:21:45 -0000 1.14 +++ src/org/eclipse/rse/internal/connectorservice/telnet/TelnetConnectorService.java 19 Feb 2008 20:50:13 -0000 @@ -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 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.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 @@ //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 @@ // 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 @@ // 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 @@ // 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(); } } #P org.eclipse.rse.subsystems.files.core Index: src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java,v retrieving revision 1.7 diff -u -r1.7 ValidatorFileFilterString.java --- src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java 3 Apr 2007 07:45:53 -0000 1.7 +++ src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileFilterString.java 19 Feb 2008 20:50:16 -0000 @@ -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 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 @@ 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; } Index: src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java,v retrieving revision 1.10 diff -u -r1.10 ValidatorFileUniqueName.java --- src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java 31 Oct 2007 21:02:49 -0000 1.10 +++ src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java 19 Feb 2008 20:50:16 -0000 @@ -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 @@ //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); Index: src/org/eclipse/rse/internal/subsystems/files/core/Activator.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/Activator.java,v retrieving revision 1.2 diff -u -r1.2 Activator.java --- src/org/eclipse/rse/internal/subsystems/files/core/Activator.java 12 Sep 2007 20:38:00 -0000 1.2 +++ src/org/eclipse/rse/internal/subsystems/files/core/Activator.java 19 Feb 2008 20:50:14 -0000 @@ -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 @@ //The shared instance. private static Activator plugin; + public static final String PLUGIN_ID = "org.eclipse.rse.subsystems.files"; + /** * The constructor. */ Index: src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java,v retrieving revision 1.2 diff -u -r1.2 SystemFileResources.java --- src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java 31 May 2007 18:59:43 -0000 1.2 +++ src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.java 19 Feb 2008 20:50:14 -0000 @@ -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 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); Index: src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties,v retrieving revision 1.2 diff -u -r1.2 SystemFileResources.properties --- src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties 31 May 2007 18:59:43 -0000 1.2 +++ src/org/eclipse/rse/internal/subsystems/files/core/SystemFileResources.properties 19 Feb 2008 20:50:14 -0000 @@ -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 @@ 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. + + Index: src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java,v retrieving revision 1.51 diff -u -r1.51 RemoteFileSubSystem.java --- src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java 12 Feb 2008 23:06:55 -0000 1.51 +++ src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java 19 Feb 2008 20:50:16 -0000 @@ -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 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.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.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 @@ // 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); } } Index: src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java,v retrieving revision 1.61 diff -u -r1.61 FileServiceSubSystem.java --- src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java 15 Feb 2008 14:49:51 -0000 1.61 +++ src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java 19 Feb 2008 20:50:15 -0000 @@ -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.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.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.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 @@ 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 @@ 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 @@ 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 @@ 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); } #P org.eclipse.rse.connectorservice.dstore Index: src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties,v retrieving revision 1.2 diff -u -r1.2 ConnectorServiceResources.properties --- src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties 5 Jun 2007 10:42:59 -0000 1.2 +++ src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties 19 Feb 2008 20:50:18 -0000 @@ -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} + + + + + Index: src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java,v retrieving revision 1.6 diff -u -r1.6 RexecDstoreServer.java --- src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java 5 Nov 2007 21:16:03 -0000 1.6 +++ src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java 19 Feb 2008 20:50:18 -0000 @@ -22,8 +22,10 @@ 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.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 @@ } 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 @@ 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 @@ 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 Index: src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java,v retrieving revision 1.3 diff -u -r1.3 ConnectorServiceResources.java --- src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java 5 Jun 2007 10:42:58 -0000 1.3 +++ src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java 19 Feb 2008 20:50:18 -0000 @@ -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 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); Index: src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java,v retrieving revision 1.2 diff -u -r1.2 Activator.java --- src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java 15 May 2007 23:53:27 -0000 1.2 +++ src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java 19 Feb 2008 20:50:18 -0000 @@ -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 @@ //The shared instance. private static Activator plugin; + public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$ + /** * The constructor. */ Index: src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java,v retrieving revision 1.56 diff -u -r1.56 DStoreConnectorService.java --- src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java 12 Feb 2008 23:42:22 -0000 1.56 +++ src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java 19 Feb 2008 20:50:18 -0000 @@ -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 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.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.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 @@ // 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 @@ /** * @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 @@ { 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 @@ 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 @@ 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 @@ { 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 @@ 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 @@ { 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 @@ { 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 @@ 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 @@ 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 @@ } 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 @@ { 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 @@ { 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 @@ } 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 @@ 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 @@ } // 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 @@ 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 @@ } 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 @@ { 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 @@ 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 @@ 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 @@ { 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 @@ 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); + } } + Index: src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java,v retrieving revision 1.12 diff -u -r1.12 ConnectionStatusListener.java --- src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java 5 Nov 2007 21:16:04 -0000 1.12 +++ src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java 19 Feb 2008 20:50:18 -0000 @@ -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 @@ { 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 @@ */ 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 @@ */ 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 #P org.eclipse.rse.shells.ui Index: src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java,v retrieving revision 1.11 diff -u -r1.11 SystemCommandAction.java --- src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java 5 Feb 2008 21:59:32 -0000 1.11 +++ src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java 19 Feb 2008 20:50:20 -0000 @@ -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.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.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 @@ 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) Index: src/org/eclipse/rse/internal/shells/ui/ShellResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.properties,v retrieving revision 1.5 diff -u -r1.5 ShellResources.properties --- src/org/eclipse/rse/internal/shells/ui/ShellResources.properties 12 Feb 2008 23:41:47 -0000 1.5 +++ src/org/eclipse/rse/internal/shells/ui/ShellResources.properties 19 Feb 2008 20:50:20 -0000 @@ -89,3 +89,10 @@ 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 + + Index: src/org/eclipse/rse/internal/shells/ui/ShellResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/ShellResources.java,v retrieving revision 1.5 diff -u -r1.5 ShellResources.java --- src/org/eclipse/rse/internal/shells/ui/ShellResources.java 12 Feb 2008 23:41:47 -0000 1.5 +++ src/org/eclipse/rse/internal/shells/ui/ShellResources.java 19 Feb 2008 20:50:20 -0000 @@ -87,6 +87,12 @@ 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 { Index: src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java,v retrieving revision 1.11 diff -u -r1.11 CommandsViewPage.java --- src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java 14 Dec 2007 20:55:59 -0000 1.11 +++ src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java 19 Feb 2008 20:50:20 -0000 @@ -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.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.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 @@ 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; + } } #P org.eclipse.rse.connectorservice.ssh Index: src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties,v retrieving revision 1.1 diff -u -r1.1 SshConnectorResources.properties --- src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties 15 Feb 2007 09:19:03 -0000 1.1 +++ src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.properties 19 Feb 2008 20:50:21 -0000 @@ -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 @@ 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 + + Index: src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java,v retrieving revision 1.1 diff -u -r1.1 SshConnectorResources.java --- src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java 15 Feb 2007 09:19:03 -0000 1.1 +++ src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorResources.java 19 Feb 2008 20:50:21 -0000 @@ -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 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; + } Index: src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java,v retrieving revision 1.17 diff -u -r1.17 SshConnectorService.java --- src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java 25 Jan 2008 12:43:40 -0000 1.17 +++ src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java 19 Feb 2008 20:50:21 -0000 @@ -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 @@ 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.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.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 @@ //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 @@ // 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 @@ 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(); } } #P org.eclipse.rse.services.files.ftp Index: src/org/eclipse/rse/internal/services/files/ftp/FTPService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java,v retrieving revision 1.51 diff -u -r1.51 FTPService.java --- src/org/eclipse/rse/internal/services/files/ftp/FTPService.java 23 Jan 2008 22:35:22 -0000 1.51 +++ src/org/eclipse/rse/internal/services/files/ftp/FTPService.java 19 Feb 2008 20:50:22 -0000 @@ -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.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 @@ } 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); + } } #P org.eclipse.rse.subsystems.shells.core Index: src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java,v retrieving revision 1.2 diff -u -r1.2 ShellStrings.java --- src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java 5 Apr 2007 08:17:47 -0000 1.2 +++ src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.java 19 Feb 2008 20:50:23 -0000 @@ -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 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 Index: src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties,v retrieving revision 1.2 diff -u -r1.2 ShellStrings.properties --- src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties 5 Jun 2007 11:03:34 -0000 1.2 +++ src/org/eclipse/rse/internal/subsystems/shells/core/ShellStrings.properties 19 Feb 2008 20:50:23 -0000 @@ -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_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. + Index: src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java,v retrieving revision 1.19 diff -u -r1.19 RemoteCmdSubSystem.java --- src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java 5 Nov 2007 21:08:25 -0000 1.19 +++ src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java 19 Feb 2008 20:50:23 -0000 @@ -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 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.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 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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); } } #P org.eclipse.rse.services.ssh Index: src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java,v retrieving revision 1.37 diff -u -r1.37 SftpFileService.java --- src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java 12 Feb 2008 23:58:15 -0000 1.37 +++ src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java 19 Feb 2008 20:50:24 -0000 @@ -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.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 @@ //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); - } + } } #P org.eclipse.rse.importexport Index: src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java,v retrieving revision 1.4 diff -u -r1.4 RemoteImportWizardPage1.java --- src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java 1 Jun 2007 19:13:01 -0000 1.4 +++ src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java 19 Feb 2008 20:50:27 -0000 @@ -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.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 @@ 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 @@ */ 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 @@ } 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 @@ 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 @@ }; 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 @@ }; 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 @@ 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; } } Index: src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java,v retrieving revision 1.3 diff -u -r1.3 RemoteFileImportOperation.java --- src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java 15 May 2007 23:53:43 -0000 1.3 +++ src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java 19 Feb 2008 20:50:27 -0000 @@ -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.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 @@ 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 @@ // 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; } Index: src/org/eclipse/rse/internal/importexport/files/Utilities.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/Utilities.java,v retrieving revision 1.5 diff -u -r1.5 Utilities.java --- src/org/eclipse/rse/internal/importexport/files/Utilities.java 15 May 2007 23:53:43 -0000 1.5 +++ src/org/eclipse/rse/internal/importexport/files/Utilities.java 19 Feb 2008 20:50:27 -0000 @@ -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 @@ 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 @@ } } 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 @@ 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); - } + } Index: src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java,v retrieving revision 1.3 diff -u -r1.3 RemoteFileImportActionDelegate.java --- src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java 15 May 2007 23:53:43 -0000 1.3 +++ src/org/eclipse/rse/internal/importexport/files/RemoteFileImportActionDelegate.java 19 Feb 2008 20:50:26 -0000 @@ -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.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 @@ 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; Index: src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java,v retrieving revision 1.3 diff -u -r1.3 RemoteFileExportActionDelegate.java --- src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java 15 May 2007 23:53:43 -0000 1.3 +++ src/org/eclipse/rse/internal/importexport/files/RemoteFileExportActionDelegate.java 19 Feb 2008 20:50:26 -0000 @@ -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.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 @@ 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; Index: src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java,v retrieving revision 1.5 diff -u -r1.5 RemoteFileExportOperation.java --- src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java 29 Jun 2007 16:25:02 -0000 1.5 +++ src/org/eclipse/rse/internal/importexport/files/RemoteFileExportOperation.java 19 Feb 2008 20:50:26 -0000 @@ -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.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 @@ 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 @@ 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 @@ 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); } Index: src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java,v retrieving revision 1.6 diff -u -r1.6 RemoteExportWizardPage1.java --- src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java 15 May 2007 23:53:43 -0000 1.6 +++ src/org/eclipse/rse/internal/importexport/files/RemoteExportWizardPage1.java 19 Feb 2008 20:50:26 -0000 @@ -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.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 @@ 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 @@ */ 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 @@ */ 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 @@ } 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 @@ 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 @@ 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 @@ } 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 @@ 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()); } Index: src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java,v retrieving revision 1.1 diff -u -r1.1 RemoteImportExportResources.java --- src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java 11 Apr 2007 19:57:23 -0000 1.1 +++ src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.java 19 Feb 2008 20:50:25 -0000 @@ -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 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); Index: src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties,v retrieving revision 1.1 diff -u -r1.1 RemoteImportExportResources.properties --- src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties 11 Apr 2007 19:57:22 -0000 1.1 +++ src/org/eclipse/rse/internal/importexport/RemoteImportExportResources.properties 19 Feb 2008 20:50:25 -0000 @@ -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_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. #P org.eclipse.rse.services Index: src/org/eclipse/rse/services/files/RemoteFileIOException.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java,v retrieving revision 1.3 diff -u -r1.3 RemoteFileIOException.java --- src/org/eclipse/rse/services/files/RemoteFileIOException.java 5 Jun 2007 10:37:07 -0000 1.3 +++ src/org/eclipse/rse/services/files/RemoteFileIOException.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ 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; } Index: src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java,v retrieving revision 1.3 diff -u -r1.3 RemoteFolderNotEmptyException.java --- src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java 5 Jun 2007 10:37:07 -0000 1.3 +++ src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ 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; } Index: src/org/eclipse/rse/services/files/RemoteFileSecurityException.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java,v retrieving revision 1.4 diff -u -r1.4 RemoteFileSecurityException.java --- src/org/eclipse/rse/services/files/RemoteFileSecurityException.java 5 Jun 2007 10:37:07 -0000 1.4 +++ src/org/eclipse/rse/services/files/RemoteFileSecurityException.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ 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; } Index: src/org/eclipse/rse/services/files/RemoteFileCancelledException.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java,v retrieving revision 1.5 diff -u -r1.5 RemoteFileCancelledException.java --- src/org/eclipse/rse/services/files/RemoteFileCancelledException.java 23 Jan 2008 22:35:25 -0000 1.5 +++ src/org/eclipse/rse/services/files/RemoteFileCancelledException.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ 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; } Index: clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java,v retrieving revision 1.2 diff -u -r1.2 SystemMessageException.java --- clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java 16 Aug 2006 16:31:36 -0000 1.2 +++ clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessageException.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ 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 Index: clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java,v retrieving revision 1.6 diff -u -r1.6 SystemMessage.java --- clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java 5 Jun 2007 10:37:08 -0000 1.6 +++ clientserver/org/eclipse/rse/services/clientserver/messages/SystemMessage.java 19 Feb 2008 20:50:29 -0000 @@ -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 @@ * 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 @@ 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 @@ * @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 @@ 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 @@ 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 @@ */ 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); } } Index: clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java =================================================================== RCS file: clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java diff -N clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ clientserver/org/eclipse/rse/services/clientserver/messages/SimpleSystemMessage.java 1 Jan 1970 00:00:00 -0000 @@ -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(); + } + +} #P org.eclipse.rse.ui Index: UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java,v retrieving revision 1.13 diff -u -r1.13 SystemMessageDialog.java --- UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java 12 Feb 2008 23:06:33 -0000 1.13 +++ UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java 19 Feb 2008 20:50:30 -0000 @@ -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.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 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 @@ 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) { Index: UI/org/eclipse/rse/internal/ui/GenericMessages.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.java,v retrieving revision 1.2 diff -u -r1.2 GenericMessages.java --- UI/org/eclipse/rse/internal/ui/GenericMessages.java 5 Jun 2007 11:36:53 -0000 1.2 +++ UI/org/eclipse/rse/internal/ui/GenericMessages.java 19 Feb 2008 20:50:30 -0000 @@ -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 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 Index: UI/org/eclipse/rse/internal/ui/GenericMessages.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/GenericMessages.properties,v retrieving revision 1.2 diff -u -r1.2 GenericMessages.properties --- UI/org/eclipse/rse/internal/ui/GenericMessages.properties 5 Jun 2007 11:36:53 -0000 1.2 +++ UI/org/eclipse/rse/internal/ui/GenericMessages.properties 19 Feb 2008 20:50:30 -0000 @@ -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_propertyMessage = Properties for {0} RSEQuery_task = RSE Query + +Error=Error +Question=Question +Warning=Warning +Information=Information #P org.eclipse.rse.processes.ui Index: src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java,v retrieving revision 1.2 diff -u -r1.2 SystemProcessesResources.java --- src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java 5 Jun 2007 10:56:52 -0000 1.2 +++ src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.java 19 Feb 2008 20:50:31 -0000 @@ -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 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); Index: src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java,v retrieving revision 1.2 diff -u -r1.2 ProcessesPlugin.java --- src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java 15 May 2007 23:53:31 -0000 1.2 +++ src/org/eclipse/rse/internal/processes/ui/ProcessesPlugin.java 19 Feb 2008 20:50:31 -0000 @@ -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 @@ * 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. Index: src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties,v retrieving revision 1.2 diff -u -r1.2 SystemProcessesResources.properties --- src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties 5 Jun 2007 10:56:52 -0000 1.2 +++ src/org/eclipse/rse/internal/processes/ui/SystemProcessesResources.properties 19 Feb 2008 20:50:31 -0000 @@ -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_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 + Index: src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java,v retrieving revision 1.12 diff -u -r1.12 SystemProcessFilterStringEditPane.java --- src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java 15 May 2007 23:53:31 -0000 1.12 +++ src/org/eclipse/rse/processes/ui/SystemProcessFilterStringEditPane.java 19 Feb 2008 20:50:32 -0000 @@ -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 @@ 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; } Index: src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java,v retrieving revision 1.11 diff -u -r1.11 SystemViewRemoteProcessAdapter.java --- src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java 15 May 2007 23:53:31 -0000 1.11 +++ src/org/eclipse/rse/internal/processes/ui/view/SystemViewRemoteProcessAdapter.java 19 Feb 2008 20:50:32 -0000 @@ -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 @@ 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.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 @@ 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; Index: src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java,v retrieving revision 1.5 diff -u -r1.5 SystemKillProcessAction.java --- src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java 14 May 2007 13:04:34 -0000 1.5 +++ src/org/eclipse/rse/internal/processes/ui/actions/SystemKillProcessAction.java 19 Feb 2008 20:50:31 -0000 @@ -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.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.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 @@ 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 @@ */ 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(); }