01: package net.xoetrope.builder.editor;
02:
03: import java.util.ArrayList;
04:
05: import net.xoetrope.xui.XProject;
06: import net.xoetrope.xui.XProjectManager;
07: import net.xoetrope.xui.XResourceManager;
08:
09: /**
10: * A central repository for XEditorProjects. Several projects may be supported
11: * within a single instance of the XuiEditor
12: * @since 1.03
13: * <p> Copyright (c) Xoetrope Ltd., 2002-2003</p>
14: * <p> $Revision: 1.4 $</p>
15: * <p> License: see License.txt</p>
16: */
17: public class XEditorProjectManager extends XProjectManager {
18: private static XuiEditor editor;
19: protected static ArrayList staticResources;
20:
21: public XEditorProjectManager(XuiEditor xuiEditor) {
22: editor = xuiEditor;
23: }
24:
25: /**
26: * Get the current or active project
27: * @return the current project
28: */
29: public static XProject getCurrentProject() {
30: if (currentProject == null)
31: currentProject = new XEditorProject(editor);
32:
33: return currentProject;
34: }
35:
36: /**
37: * Gets an instance of the resource manager in the current project
38: * @return the XResourceManager instance
39: */
40: public static XResourceManager getResourceManager() {
41: return currentProject.getResourceManager();
42: }
43:
44: /**
45: * Get a list of static objects/resources
46: * @return a static vector of objects
47: */
48: public static ArrayList getStaticResources() {
49: if (staticResources == null)
50: staticResources = new ArrayList();
51:
52: return staticResources;
53: }
54: }
|