1 package net.sourceforge.phpeclipse;
3 import java.util.MissingResourceException;
4 import java.util.ResourceBundle;
6 import org.eclipse.core.resources.IWorkspace;
7 import org.eclipse.core.resources.ResourcesPlugin;
8 import org.eclipse.core.runtime.IPluginDescriptor;
9 import org.eclipse.ui.plugin.AbstractUIPlugin;
12 * The main plugin class to be used in the desktop.
14 public class PHPeclipsePlugin extends AbstractUIPlugin {
15 //The shared instance.
16 private static PHPeclipsePlugin plugin;
18 private ResourceBundle resourceBundle;
23 public PHPeclipsePlugin(IPluginDescriptor descriptor) {
28 ResourceBundle.getBundle(
29 "net.sourceforge.PHPeclipsePluginResources");
30 } catch (MissingResourceException x) {
31 resourceBundle = null;
36 * Returns the shared instance.
38 public static PHPeclipsePlugin getDefault() {
43 * Returns the workspace instance.
45 public static IWorkspace getWorkspace() {
46 return ResourcesPlugin.getWorkspace();
50 * Returns the string from the plugin's resource bundle,
51 * or 'key' if not found.
53 public static String getResourceString(String key) {
54 ResourceBundle bundle =
55 PHPeclipsePlugin.getDefault().getResourceBundle();
57 return bundle.getString(key);
58 } catch (MissingResourceException e) {
64 * Returns the plugin's resource bundle,
66 public ResourceBundle getResourceBundle() {
67 return resourceBundle;