1 package net.sourceforge.phpeclipse.xdebug.core;
3 import org.eclipse.core.runtime.Plugin;
4 import org.osgi.framework.BundleContext;
8 * The main plugin class to be used in the desktop.
10 public class CorePlugin extends Plugin {
11 //The shared instance.
12 private static CorePlugin plugin;
14 private ResourceBundle resourceBundle;
23 resourceBundle = ResourceBundle.getBundle("net.sourceforge.phpeclipse.xdebug.core.CorePluginResources");
24 } catch (MissingResourceException x) {
25 resourceBundle = null;
30 * This method is called upon plug-in activation
32 public void start(BundleContext context) throws Exception {
37 * This method is called when the plug-in is stopped
39 public void stop(BundleContext context) throws Exception {
44 * Returns the shared instance.
46 public static CorePlugin getDefault() {
51 * Returns the string from the plugin's resource bundle,
52 * or 'key' if not found.
54 public static String getResourceString(String key) {
55 ResourceBundle bundle = CorePlugin.getDefault().getResourceBundle();
57 return (bundle != null) ? bundle.getString(key) : key;
58 } catch (MissingResourceException e) {
64 * Returns the plugin's resource bundle,
66 public ResourceBundle getResourceBundle() {
67 return resourceBundle;