2 * $RCSfile: JSCorePlugin.java,v $
5 * CH-1700 Fribourg, Switzerland
8 *========================================================================
9 * Modifications history
10 *========================================================================
11 * $Log: not supported by cvs2svn $
12 * Revision 1.2 2004/05/22 16:14:37 l950637
13 * Adapt for Eclipse 3.0M9
15 * Revision 1.1 2004/02/05 03:10:08 agfitzp
18 * Revision 1.3 2003/12/10 20:19:16 agfitzp
21 * Revision 1.2 2003/06/21 03:48:51 agfitzp
22 * fixed global variables as functions bug
23 * fixed length calculation of instance variables
24 * Automatic outlining is now a preference
26 * Revision 1.1 2003/05/28 15:17:12 agfitzp
27 * net.sourceforge.phpeclipse.js.core 0.0.1 code base
29 *========================================================================
32 package net.sourceforge.phpeclipse.js.core;
34 import java.util.LinkedList;
35 import java.util.List;
36 import java.util.MissingResourceException;
37 import java.util.ResourceBundle;
39 import org.eclipse.core.resources.IWorkspace;
40 import org.eclipse.core.resources.ResourcesPlugin;
41 import org.eclipse.core.runtime.Plugin;
45 * The main plugin class to be used in the desktop.
47 public class JSCorePlugin extends Plugin
49 //The shared instance.
50 private static JSCorePlugin plugin;
53 private ResourceBundle resourceBundle;
55 private boolean defaultsInitialized = false;
60 private List currentFunctions = new LinkedList();
66 public JSCorePlugin() {
70 resourceBundle = ResourceBundle.getBundle("net.sourceforge.phpeclipse.js.core.JSCorePluginResources");
71 } catch(MissingResourceException x) {
72 resourceBundle = null;
77 * Returns the shared instance.
80 public static JSCorePlugin getDefault() {
85 * Returns the workspace instance.
88 public static IWorkspace getWorkspace() {
89 return ResourcesPlugin.getWorkspace();
93 * Returns the string from the plugin's resource bundle, or 'key' if not found.
98 public static String getResourceString(String key) {
99 ResourceBundle bundle = JSCorePlugin.getDefault().getResourceBundle();
102 return bundle.getString(key);
103 } catch(MissingResourceException e) {
109 * Returns the plugin's resource bundle,
112 public ResourceBundle getResourceBundle() {
113 return resourceBundle;
117 * Returns the currentFunctions.
120 public List getCurrentFunctions() {
121 return currentFunctions;
125 * Sets the currentFunctions.
126 * @param currentFunctions The currentFunctions to set
128 public void setCurrentFunctions(List currentFunctions) {
129 this.currentFunctions = currentFunctions;