01: package com.xoetrope.editor.netbeans.services;
02:
03: import com.xoetrope.carousel.services.*;
04: import java.awt.BorderLayout;
05:
06: import net.xoetrope.editor.project.XEditorProject;
07: import org.openide.windows.TopComponent;
08: import org.openide.text.CloneableEditorSupport;
09: import org.openide.windows.Mode;
10: import org.openide.windows.TopComponent;
11: import org.openide.windows.WindowManager;
12:
13: /**
14: * Basic TopComponent class which contains the RouteEditor
15: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
16: * the GNU Public License (GPL), please see license.txt for more details. If
17: * you make commercial use of this software you must purchase a commercial
18: * license from Xoetrope.</p>
19: * <p> $Revision: 1.4 $</p>
20: */
21: public class RouteTopComponent extends TopComponent {
22: private XEditorProject currentProject;
23: private RouteEditor routeEditor;
24:
25: /*
26: * Ctor for the class. Pass the current XEditorProject object and store it.
27: * Contstruct a RouteEditor and add it.
28: * @param proj The current XEditorProject object
29: */
30: public RouteTopComponent(XEditorProject proj) {
31: setLayout(new BorderLayout());
32: currentProject = proj;
33: setName("Routes ("
34: + currentProject.getStartupParam("ProjectPath") + ")");
35: routeEditor = new RouteEditor(proj);
36: add(routeEditor);
37: routeEditor.doLayout();
38: doLayout();
39: }
40:
41: /**
42: * Dock this TopComponent
43: */
44: public void open() {
45: Mode mode = WindowManager.getDefault().findMode("output");
46: if (mode != null)
47: mode.dockInto(this );
48: super .open();
49: }
50:
51: /**
52: * Let NetBeans know what this object will be referred to as.
53: * @return String the ID of the TopComponent
54: */
55: public String preferredId() {
56: return "XuiProRouteEditor";
57: }
58:
59: /**
60: * @todo When the class has stabilized remove this method and retest the persistence
61: * @return
62: */
63: public int getPersistenceType() {
64: return PERSISTENCE_NEVER;
65: }
66: }
|