01: package com.xoetrope.editor.eclipse.services;
02:
03: import java.awt.BorderLayout;
04: import java.awt.Frame;
05: import java.awt.Panel;
06:
07: import net.xoetrope.editor.project.XEditorProject;
08: import net.xoetrope.xui.XProjectManager;
09:
10: import org.eclipse.core.resources.IResourceChangeEvent;
11: import org.eclipse.core.resources.IResourceChangeListener;
12: import org.eclipse.core.resources.ResourcesPlugin;
13: import org.eclipse.swt.SWT;
14: import org.eclipse.swt.awt.SWT_AWT;
15: import org.eclipse.swt.widgets.Composite;
16: import org.eclipse.ui.part.ViewPart;
17:
18: import com.xoetrope.carousel.services.RouteEditor;
19:
20: public class RouteManagerEditor extends ViewPart implements
21: IResourceChangeListener {
22: private XEditorProject currentProject;
23: private RouteEditor routeEditor;
24: private Composite panelProxy;
25:
26: public RouteManagerEditor() {
27: super ();
28: currentProject = (XEditorProject) XProjectManager
29: .getCurrentProject();
30: currentProject.setObject("RouteEditor", this );
31: setTitle("Route Manager (" + currentProject.getProjectTitle()
32: + ")");
33: ResourcesPlugin.getWorkspace().addResourceChangeListener(this );
34: }
35:
36: public void createPartControl(Composite parent) {
37: panelProxy = new Composite(parent, SWT.EMBEDDED);
38: Frame awtFrame = SWT_AWT.new_Frame(panelProxy);
39:
40: routeEditor = new RouteEditor(currentProject);
41: routeEditor.doLayout();
42: Panel root = new Panel();
43: root.setLayout(new BorderLayout());
44: root.add(routeEditor, BorderLayout.CENTER);
45: awtFrame.add(root);
46: }
47:
48: public void setFocus() {
49: panelProxy.setFocus();
50: }
51:
52: public void resourceChanged(IResourceChangeEvent event) {
53:
54: }
55:
56: }
|