mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45:22 +02:00
[235626][cleanup] Get rid of resource bundle related dead code
This commit is contained in:
parent
d0c9ca3d48
commit
d716e3fc3e
7 changed files with 1 additions and 235 deletions
|
@ -438,9 +438,6 @@ public class SshConnectorService extends StandardConnectorService implements ISs
|
||||||
*/
|
*/
|
||||||
protected void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc)
|
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
|
//RSEUIPlugin.logError("Disconnect failed",exc); // temporary
|
||||||
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_FAILED, IStatus.ERROR, NLS.bind(CommonMessages.MSG_DISCONNECT_FAILED, hostName), exc);
|
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_FAILED, IStatus.ERROR, NLS.bind(CommonMessages.MSG_DISCONNECT_FAILED, hostName), exc);
|
||||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
|
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
|
||||||
|
@ -455,8 +452,6 @@ public class SshConnectorService extends StandardConnectorService implements ISs
|
||||||
*/
|
*/
|
||||||
protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
|
protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
|
||||||
{
|
{
|
||||||
//SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell, RSEUIPlugin.getResourceBundle(),
|
|
||||||
// ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName)
|
|
||||||
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_CANCELLED, IStatus.CANCEL, NLS.bind(CommonMessages.MSG_DISCONNECT_CANCELLED, hostName));
|
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_CANCELLED, IStatus.CANCEL, NLS.bind(CommonMessages.MSG_DISCONNECT_CANCELLED, hostName));
|
||||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg);
|
SystemMessageDialog msgDlg = new SystemMessageDialog(shell,msg);
|
||||||
msgDlg.open();
|
msgDlg.open();
|
||||||
|
|
|
@ -484,10 +484,6 @@ public class TelnetConnectorService extends StandardConnectorService implements
|
||||||
*/
|
*/
|
||||||
protected void showDisconnectErrorMessage(Shell shell, String hostName,
|
protected void showDisconnectErrorMessage(Shell shell, String hostName,
|
||||||
int port, Exception exc) {
|
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
|
|
||||||
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
|
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
ICommonMessageIds.MSG_DISCONNECT_FAILED,
|
ICommonMessageIds.MSG_DISCONNECT_FAILED,
|
||||||
IStatus.ERROR,
|
IStatus.ERROR,
|
||||||
|
@ -504,9 +500,6 @@ public class TelnetConnectorService extends StandardConnectorService implements
|
||||||
*/
|
*/
|
||||||
protected void showDisconnectCancelledMessage(Shell shell,
|
protected void showDisconnectCancelledMessage(Shell shell,
|
||||||
String hostName, int port) {
|
String hostName, int port) {
|
||||||
// SystemMessage.displayMessage(SystemMessage.MSGTYPE_ERROR, shell,
|
|
||||||
// RSEUIPlugin.getResourceBundle(),
|
|
||||||
// ISystemMessages.MSG_DISCONNECT_CANCELLED, hostName);
|
|
||||||
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
|
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
ICommonMessageIds.MSG_DISCONNECT_CANCELLED,
|
ICommonMessageIds.MSG_DISCONNECT_CANCELLED,
|
||||||
IStatus.CANCEL,
|
IStatus.CANCEL,
|
||||||
|
|
|
@ -172,7 +172,6 @@ public class SystemSelectRemoteFileOrFolderForm
|
||||||
this.fileMode = fileMode;
|
this.fileMode = fileMode;
|
||||||
callerInstanceOfWizardPage = (caller instanceof WizardPage);
|
callerInstanceOfWizardPage = (caller instanceof WizardPage);
|
||||||
callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
|
callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
|
||||||
//rb = RSEUIPlugin.getResourceBundle();
|
|
||||||
sr = RSECorePlugin.getTheSystemRegistry();
|
sr = RSECorePlugin.getTheSystemRegistry();
|
||||||
|
|
||||||
// set default GUI
|
// set default GUI
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
|
|
||||||
package org.eclipse.rse.internal.processes.ui;
|
package org.eclipse.rse.internal.processes.ui;
|
||||||
|
|
||||||
import java.util.MissingResourceException;
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
|
||||||
|
@ -39,8 +36,6 @@ public class ProcessesPlugin extends SystemBasePlugin {
|
||||||
|
|
||||||
//The shared instance.
|
//The shared instance.
|
||||||
private static ProcessesPlugin plugin;
|
private static ProcessesPlugin plugin;
|
||||||
//Resource bundle.
|
|
||||||
private ResourceBundle resourceBundle;
|
|
||||||
|
|
||||||
private static SystemMessageFile messageFile = null;
|
private static SystemMessageFile messageFile = null;
|
||||||
private static SystemMessageFile defaultMessageFile = null;
|
private static SystemMessageFile defaultMessageFile = null;
|
||||||
|
@ -71,7 +66,6 @@ public class ProcessesPlugin extends SystemBasePlugin {
|
||||||
public void stop(BundleContext context) throws Exception {
|
public void stop(BundleContext context) throws Exception {
|
||||||
super.stop(context);
|
super.stop(context);
|
||||||
plugin = null;
|
plugin = null;
|
||||||
resourceBundle = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,32 +75,6 @@ public class ProcessesPlugin extends SystemBasePlugin {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the string from the plugin's resource bundle,
|
|
||||||
* or 'key' if not found.
|
|
||||||
*/
|
|
||||||
public static String getResourceString(String key) {
|
|
||||||
ResourceBundle bundle = ProcessesPlugin.getDefault().getResourceBundle();
|
|
||||||
try {
|
|
||||||
return (bundle != null) ? bundle.getString(key) : key;
|
|
||||||
} catch (MissingResourceException e) {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the plugin's resource bundle,
|
|
||||||
*/
|
|
||||||
public ResourceBundle getResourceBundle() {
|
|
||||||
try {
|
|
||||||
if (resourceBundle == null)
|
|
||||||
resourceBundle = ResourceBundle.getBundle("org.eclipse.rse.processes.ui.SystemProcessesResources"); //$NON-NLS-1$
|
|
||||||
} catch (MissingResourceException x) {
|
|
||||||
resourceBundle = null;
|
|
||||||
}
|
|
||||||
return resourceBundle;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve a message from this plugin's message file
|
* Retrieve a message from this plugin's message file
|
||||||
* @param msgId - the ID of the message to retrieve. This is the concatenation of the
|
* @param msgId - the ID of the message to retrieve. This is the concatenation of the
|
||||||
|
|
|
@ -447,9 +447,6 @@ public class SystemFilterWorkWithFilterPoolsDialog
|
||||||
tree.refresh(parent);
|
tree.refresh(parent);
|
||||||
} catch (Exception exc)
|
} catch (Exception exc)
|
||||||
{
|
{
|
||||||
//SystemMessage.displayExceptionMessage(getShell(),RSEUIPlugin.getResourceBundle(),
|
|
||||||
// ISystemMessages.MSG_EXCEPTION_DELETING,exc,
|
|
||||||
// pool.getName());
|
|
||||||
SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
|
SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
|
||||||
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(pool.getName(),exc));
|
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(pool.getName(),exc));
|
||||||
msgDlg.open();
|
msgDlg.open();
|
||||||
|
@ -517,9 +514,6 @@ public class SystemFilterWorkWithFilterPoolsDialog
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
//SystemMessage.displayExceptionMessage(getShell(),RSEUIPlugin.getResourceBundle(),
|
|
||||||
// ISystemMessages.MSG_EXCEPTION_RENAMING,exc,
|
|
||||||
// pool.getName());
|
|
||||||
SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
|
SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
|
||||||
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(pool.getName(),exc));
|
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(pool.getName(),exc));
|
||||||
msgDlg.open();
|
msgDlg.open();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -163,188 +163,6 @@ public abstract class SystemBasePlugin extends AbstractUIPlugin
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------
|
|
||||||
// TRANSLATABLE RESOURCE-RELATED METHODS...
|
|
||||||
// ----------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the resource bundle. Called by child class in their
|
|
||||||
* constructor, say, to load in their resource bundle. Handles
|
|
||||||
* rare case when not found by telling user, then dying.
|
|
||||||
* Note: This is NOT to be used for plugin.properties since Eclipse handles that file differently.
|
|
||||||
* @param descriptor for the plugin where the file is
|
|
||||||
* @param name of .properties file, without the '.properties' specified
|
|
||||||
* @return ResourceBundle if loaded successfully, null if not.
|
|
||||||
*/
|
|
||||||
// public static final ResourceBundle loadResourceBundle(Bundle bundle, String fileName)
|
|
||||||
// {
|
|
||||||
// ResourceBundle rb = null;
|
|
||||||
// boolean ok = false;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// URL url = resolveBundleNameNL(bundle, fileName+".properties");
|
|
||||||
// logDebugMessage("SystemBasePlugin", "Trying this now: " + url.toString());
|
|
||||||
// InputStream in = url.openStream();
|
|
||||||
// rb = new PropertyResourceBundle(in);
|
|
||||||
// in.close();
|
|
||||||
// ok = true;
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// catch (Exception exc)
|
|
||||||
// {
|
|
||||||
// logError("SystemBasePlugin - try for resource bundle " + fileName + " not successful!",exc);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!ok)
|
|
||||||
// {
|
|
||||||
// Shell s = getActiveWorkbenchShell();
|
|
||||||
//
|
|
||||||
// if (s == null) {
|
|
||||||
// Display d = Display.getCurrent();
|
|
||||||
//
|
|
||||||
// if (d != null) {
|
|
||||||
// s = d.getActiveShell();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// d = Display.getDefault();
|
|
||||||
//
|
|
||||||
// if (d != null) {
|
|
||||||
// s = d.getActiveShell();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (s != null) {
|
|
||||||
// org.eclipse.swt.widgets.MessageBox mb = new org.eclipse.swt.widgets.MessageBox(s);
|
|
||||||
// mb.setText("Unexcepted Error");
|
|
||||||
// mb.setMessage("Unable to load resource file " + fileName + ".properties");
|
|
||||||
// mb.open();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return rb;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the plugin.properties resource bundle associated with the specified plugin descriptor
|
|
||||||
*
|
|
||||||
* @param descriptor for the plugin where the file is
|
|
||||||
* @return ResourceBundle if loaded successfully, null if not.
|
|
||||||
*/
|
|
||||||
// public static final ResourceBundle loadPluginResourceBundle(Bundle bundle)
|
|
||||||
// {
|
|
||||||
// ResourceBundle rb = null;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// rb = Platform.getResourceBundle(bundle);
|
|
||||||
// }
|
|
||||||
// catch (Exception exc)
|
|
||||||
// {
|
|
||||||
// logInfo("try for resource bundle plugin.properties not successful!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return rb;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the default resource bundle for handling cases where strings aren't translated. Called by child class in their
|
|
||||||
* constructor, say, to load in their resource bundle. Handles
|
|
||||||
* rare case when not found by telling user, then dying.
|
|
||||||
* Note: This is NOT to be used for plugin.properties since Eclipse handles that file differently.
|
|
||||||
* @param descriptor for the plugin where the file is
|
|
||||||
* @param name of .properties file, without the '.properties' specified
|
|
||||||
* @return ResourceBundle if loaded successfully, null if not.
|
|
||||||
*/
|
|
||||||
// public static final ResourceBundle loadDefaultResourceBundle(Bundle bundle,
|
|
||||||
// String fileName)
|
|
||||||
// {
|
|
||||||
// ResourceBundle rb = null;
|
|
||||||
// boolean ok = false;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// String name = fileName+".properties";
|
|
||||||
// URL url = bundle.getEntry("/"+name);
|
|
||||||
// logDebugMessage("SystemBasePlugin", "Trying this now: " + url.toString());
|
|
||||||
// InputStream in = url.openStream();
|
|
||||||
// rb = new PropertyResourceBundle(in);
|
|
||||||
// in.close();
|
|
||||||
// ok = true;
|
|
||||||
// }
|
|
||||||
// catch (Exception exc)
|
|
||||||
// {
|
|
||||||
// logError("SystemBasePlugin - try for resource bundle " + fileName + " not successful!",exc);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!ok)
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// Shell s = getActiveWorkbenchShell();
|
|
||||||
//
|
|
||||||
// if (s == null) {
|
|
||||||
// Display d = Display.getCurrent();
|
|
||||||
//
|
|
||||||
// if (d != null) {
|
|
||||||
// s = d.getActiveShell();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// d = Display.getDefault();
|
|
||||||
//
|
|
||||||
// if (d != null) {
|
|
||||||
// s = d.getActiveShell();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (s != null) {
|
|
||||||
// org.eclipse.swt.widgets.MessageBox mb = new org.eclipse.swt.widgets.MessageBox(s);
|
|
||||||
// mb.setText("Unexcepted Error");
|
|
||||||
// mb.setMessage("Unable to load resource file " + fileName + ".properties");
|
|
||||||
// mb.open();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return rb;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a string from a given resource bundle.
|
|
||||||
* If not found, stack trace info is placed in the
|
|
||||||
* plugin's log file to help pinpoint the offending code.
|
|
||||||
*/
|
|
||||||
// public static String getString(ResourceBundle resourceBundle, String key)
|
|
||||||
// {
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// return resourceBundle.getString(key);
|
|
||||||
// }
|
|
||||||
// catch (MissingResourceException exc)
|
|
||||||
// {
|
|
||||||
// SystemBasePlugin.logError("Missing resource: " + key, exc);
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a string from a given resource bundle, with an english string to
|
|
||||||
* use a default if the given key is not found.
|
|
||||||
* <p>
|
|
||||||
* If not found, stack trace info is placed in the
|
|
||||||
* plugin's log file to help pinpoint the offending code.
|
|
||||||
*/
|
|
||||||
// public static String getString(ResourceBundle resourceBundle, String key, String defaultString)
|
|
||||||
// {
|
|
||||||
// String s = defaultString;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// s = resourceBundle.getString(key);
|
|
||||||
// }
|
|
||||||
// catch (MissingResourceException exc)
|
|
||||||
// {
|
|
||||||
// SystemBasePlugin.logError("Missing resource: " + key, exc);
|
|
||||||
// }
|
|
||||||
// return s;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ------------------
|
// ------------------
|
||||||
// MESSAGE METHODS...
|
// MESSAGE METHODS...
|
||||||
// ------------------
|
// ------------------
|
||||||
|
|
|
@ -208,7 +208,6 @@ public class SystemNewFilterWizardNamePage
|
||||||
else if (poolWrapperInformation != null)
|
else if (poolWrapperInformation != null)
|
||||||
{
|
{
|
||||||
poolVerbiage = SystemWidgetHelpers.createVerbiage(composite_prompts, poolWrapperInformation.getVerbiageLabel(), nbrColumns, false, 200);
|
poolVerbiage = SystemWidgetHelpers.createVerbiage(composite_prompts, poolWrapperInformation.getVerbiageLabel(), nbrColumns, false, 200);
|
||||||
//poolWrapperCombo = SystemWidgetHelpers.createLabeledCombo(composite_prompts, null, poolWrapperInformation.getResourceBundle(), poolWrapperInformation.getPromptRBKey()); // d47323
|
|
||||||
poolWrapperCombo = SystemWidgetHelpers.createLabeledReadonlyCombo(composite_prompts, null, poolWrapperInformation.getPromptLabel(), poolWrapperInformation.getPromptTooltip());
|
poolWrapperCombo = SystemWidgetHelpers.createLabeledReadonlyCombo(composite_prompts, null, poolWrapperInformation.getPromptLabel(), poolWrapperInformation.getPromptTooltip());
|
||||||
poolComboLabel = SystemWidgetHelpers.getLastLabel();
|
poolComboLabel = SystemWidgetHelpers.getLastLabel();
|
||||||
poolWrappers = poolWrapperInformation.getWrappers();
|
poolWrappers = poolWrapperInformation.getWrappers();
|
||||||
|
|
Loading…
Add table
Reference in a new issue