blob: ad613691e46ae8301a0641c70b253f16d99bdc71 [file] [log] [blame]
package org.eclipse.jst.server.websphere.core;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.Plugin;
/**
* The main plugin class to be used in the desktop.
*/
public class CorePlugin extends Plugin {
//The shared instance.
private static CorePlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
/**
* The constructor.
*/
public CorePlugin() {
super();
plugin = this;
}
/**
* Returns the shared instance.
*/
public static CorePlugin getDefault() {
return plugin;
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle = CorePlugin.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.jst.server.websphere.core.CorePluginResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
return resourceBundle;
}
}