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.ServiceEditor;
19: import com.xoetrope.carousel.visualizer.VisualiserContainer;
20:
21: public class ServiceManagerEditor extends ViewPart implements
22: IResourceChangeListener {
23: private XEditorProject currentProject;
24: private ServiceEditor serviceEditor;
25: private Composite panelProxy;
26:
27: public ServiceManagerEditor() {
28: super ();
29: currentProject = (XEditorProject) XProjectManager
30: .getCurrentProject();
31: currentProject.setObject("RouteEditor", this );
32: setTitle("Route Manager (" + currentProject.getProjectTitle()
33: + ")");
34: ResourcesPlugin.getWorkspace().addResourceChangeListener(this );
35: }
36:
37: public void createPartControl(Composite parent) {
38: panelProxy = new Composite(parent, SWT.EMBEDDED);
39: Frame awtFrame = SWT_AWT.new_Frame(panelProxy);
40:
41: serviceEditor = new ServiceEditor(currentProject);
42: serviceEditor.doLayout();
43: Panel root = new Panel();
44: root.setLayout(new BorderLayout());
45: root.add(serviceEditor, BorderLayout.CENTER);
46: awtFrame.add(root);
47: }
48:
49: public void setFocus() {
50: panelProxy.setFocus();
51: }
52:
53: public void resourceChanged(IResourceChangeEvent event) {
54:
55: }
56:
57: }
|