mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 01:45:33 +02:00
[216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
-this is phase 1...still need to get rid of duplicate messages
This commit is contained in:
parent
785ecdf6b0
commit
df73457621
5 changed files with 20 additions and 8 deletions
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - adapted template for daytime example.
|
||||
* 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.examples.daytime;
|
||||
|
@ -31,7 +32,7 @@ public class Activator extends SystemBasePlugin {
|
|||
|
||||
//The shared instance.
|
||||
private static Activator plugin;
|
||||
|
||||
public static String PLUGIN_ID = "org.eclipse.rse.examples.daytime"; //$NON-NLS-1$
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - 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.examples.daytime;
|
||||
|
@ -29,6 +30,8 @@ public class DaytimeResources extends NLS {
|
|||
|
||||
public static String DaytimeWizard_TestFieldText;
|
||||
|
||||
public static String MSG_CONNECT_FAILED;
|
||||
|
||||
static {
|
||||
// load message values from bundle file
|
||||
NLS.initializeMessages(BUNDLE_NAME, DaytimeResources.class);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#
|
||||
# Contributors:
|
||||
# Martin Oberhuber (Wind River) - 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
|
||||
|
@ -19,3 +20,5 @@ Daytime_Connector_Description=The Daytime Connector Service manages connections
|
|||
Daytime_Resource_Type=daytime resource
|
||||
DaytimeConnectorService_NotAvailable=Daytime service is not available on {0}.
|
||||
DaytimeWizard_TestFieldText=This is the Daytime Wizard Test Field.
|
||||
|
||||
MSG_CONNECT_FAILED = Connect to {0} failed with an unexpected exception
|
||||
|
|
|
@ -8,11 +8,14 @@
|
|||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - initial API and implementation
|
||||
* David Dykstal (IBM) - [217556] remove service subsystem 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.examples.daytime.subsystems;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||
|
@ -23,10 +26,12 @@ import org.eclipse.rse.core.model.SystemMessageObject;
|
|||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||
import org.eclipse.rse.core.subsystems.SubSystem;
|
||||
import org.eclipse.rse.examples.daytime.Activator;
|
||||
import org.eclipse.rse.examples.daytime.DaytimeResources;
|
||||
import org.eclipse.rse.examples.daytime.model.DaytimeResource;
|
||||
import org.eclipse.rse.examples.daytime.service.IDaytimeService;
|
||||
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.model.ISystemRegistryUI;
|
||||
|
||||
|
@ -72,8 +77,8 @@ public class DaytimeSubSystem extends SubSystem {
|
|||
node.setDaytime(daytime);
|
||||
return new Object[] { node };
|
||||
} catch(Exception e) {
|
||||
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED);
|
||||
msg.makeSubstitution(getHostName(), e);
|
||||
String msgTxt = NLS.bind(DaytimeResources.MSG_CONNECT_FAILED, getHostName());
|
||||
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, e);
|
||||
SystemMessageObject msgobj = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR,this);
|
||||
return new Object[] { msgobj };
|
||||
}
|
||||
|
|
|
@ -1785,14 +1785,14 @@ public abstract class SubSystem extends RSEModelObject
|
|||
else if (exc instanceof java.net.UnknownHostException)
|
||||
{
|
||||
SystemBasePlugin.logError("Connection error", exc); //$NON-NLS-1$
|
||||
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_UNKNOWNHOST);
|
||||
msg.makeSubstitution(hostName);
|
||||
String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_UNKNOWNHOST, hostName);
|
||||
msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, exc);
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemBasePlugin.logError("Connection error", exc); //$NON-NLS-1$
|
||||
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED);
|
||||
msg.makeSubstitution(hostName, exc);
|
||||
String msgTxt = NLS.bind(SubSystemResources.MSG_CONNECT_FAILED, hostName);
|
||||
msg = new SimpleSystemMessage(RSECorePlugin.PLUGIN_ID, IStatus.ERROR, msgTxt, exc);
|
||||
}
|
||||
|
||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
|
||||
|
|
Loading…
Add table
Reference in a new issue