New (Quantum SQL) wizard module which extends Quantum context menus (Bookmark-Tables...
[phpeclipse.git] / net.sourceforge.phpeclipse.wizards / src / net / sourceforge / phpeclipse / wizards / WizardsPlugin.java
1 package net.sourceforge.phpeclipse.wizards;
2
3 import java.util.MissingResourceException;
4 import java.util.ResourceBundle;
5
6 import org.eclipse.ui.plugin.AbstractUIPlugin;
7 import org.osgi.framework.BundleContext;
8
9 /**
10  * The main plugin class to be used in the desktop.
11  */
12 public class WizardsPlugin extends AbstractUIPlugin {
13         //The shared instance.
14         private static WizardsPlugin plugin;
15         //Resource bundle.
16         private ResourceBundle resourceBundle;
17         
18         /**
19          * The constructor.
20          */
21         public WizardsPlugin() {
22                 super();
23                 plugin = this;
24                 try {
25                         resourceBundle = ResourceBundle.getBundle("net.sourceforge.phpeclipse.wizards.WizardsPluginResources");
26                 } catch (MissingResourceException x) {
27                         resourceBundle = null;
28                 }
29         }
30
31         /**
32          * This method is called upon plug-in activation
33          */
34         public void start(BundleContext context) throws Exception {
35                 super.start(context);
36         }
37
38         /**
39          * This method is called when the plug-in is stopped
40          */
41         public void stop(BundleContext context) throws Exception {
42                 super.stop(context);
43         }
44
45         /**
46          * Returns the shared instance.
47          */
48         public static WizardsPlugin getDefault() {
49                 return plugin;
50         }
51
52         /**
53          * Returns the string from the plugin's resource bundle,
54          * or 'key' if not found.
55          */
56         public static String getResourceString(String key) {
57                 ResourceBundle bundle = WizardsPlugin.getDefault().getResourceBundle();
58                 try {
59                         return (bundle != null) ? bundle.getString(key) : key;
60                 } catch (MissingResourceException e) {
61                         return key;
62                 }
63         }
64
65         /**
66          * Returns the plugin's resource bundle,
67          */
68         public ResourceBundle getResourceBundle() {
69                 return resourceBundle;
70         }
71 }