1 package net.sourceforge.phpeclipse.wizards;
3 import java.util.MissingResourceException;
4 import java.util.ResourceBundle;
6 import org.eclipse.ui.plugin.AbstractUIPlugin;
7 import org.osgi.framework.BundleContext;
10 * The main plugin class to be used in the desktop.
12 public class WizardsPlugin extends AbstractUIPlugin {
13 //The shared instance.
14 private static WizardsPlugin plugin;
16 private ResourceBundle resourceBundle;
21 public WizardsPlugin() {
25 resourceBundle = ResourceBundle.getBundle("net.sourceforge.phpeclipse.wizards.WizardsPluginResources");
26 } catch (MissingResourceException x) {
27 resourceBundle = null;
32 * This method is called upon plug-in activation
34 public void start(BundleContext context) throws Exception {
39 * This method is called when the plug-in is stopped
41 public void stop(BundleContext context) throws Exception {
46 * Returns the shared instance.
48 public static WizardsPlugin getDefault() {
53 * Returns the string from the plugin's resource bundle,
54 * or 'key' if not found.
56 public static String getResourceString(String key) {
57 ResourceBundle bundle = WizardsPlugin.getDefault().getResourceBundle();
59 return (bundle != null) ? bundle.getString(key) : key;
60 } catch (MissingResourceException e) {
66 * Returns the plugin's resource bundle,
68 public ResourceBundle getResourceBundle() {
69 return resourceBundle;