01: /*
02: * ProjectRouteManager.java
03: *
04: * Created on 26 July 2005, 11:49
05: */
06:
07: package com.xoetrope.carousel.services;
08:
09: import net.xoetrope.editor.project.ProjectListener;
10: import net.xoetrope.editor.project.XEditorProject;
11:
12: /**
13: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
14: * the GNU Public License (GPL), please see license.txt for more details. If
15: * you make commercial use of this software you must purchase a commercial
16: * license from Xoetrope.</p>
17: * <p> $Revision: 1.8 $</p>
18: */
19: public class ProjectRouteManager implements ProjectListener {
20: public static final String ROUTE_MGR_LOOKUP = "RouteMgr";
21: public static final String SERVICE_MGR_LOOKUP = "ServiceMgr";
22: private static ProjectRouteManager routeMgr;
23:
24: private ProjectRouteManager() {
25: }
26:
27: public static ProjectRouteManager getInstance() {
28: if (routeMgr == null)
29: routeMgr = new ProjectRouteManager();
30:
31: return routeMgr;
32: }
33:
34: /**
35: * Update to reflect the new project state
36: * @param project the editor project to save
37: */
38: public void projectUpdated(XEditorProject proj) {
39: System.out.println("projectUpdated");
40: }
41:
42: public void checkProject(XEditorProject project) {
43: }
44:
45: public void saveProject(XEditorProject project) {
46: RouteManager mgr = (RouteManager) project
47: .getObject(ROUTE_MGR_LOOKUP);
48: if (mgr != null) {
49: mgr.saveRoutes();
50: ServiceManager serviceMgr = (ServiceManager) project
51: .getObject(SERVICE_MGR_LOOKUP);
52: serviceMgr.saveServices(project);
53: }
54: }
55:
56: public void projectInitialized(XEditorProject project) {
57: RouteManager mgr = (RouteManager) project
58: .getObject(ROUTE_MGR_LOOKUP);
59: if (mgr == null) {
60: mgr = new RouteManager(project);
61: project.setObject(ROUTE_MGR_LOOKUP, mgr);
62: }
63:
64: ServiceManager serviceMgr = (ServiceManager) project
65: .getObject(SERVICE_MGR_LOOKUP);
66: if (serviceMgr == null) {
67: serviceMgr = new ServiceManager(project);
68: project.setObject(SERVICE_MGR_LOOKUP, serviceMgr);
69: }
70: }
71:
72: public void projectLoaded(XEditorProject project) {
73: }
74:
75: public void resetProject(String moduleName, XEditorProject project) {
76: }
77: }
|