01: package com.xoetrope.editor.eclipse.langed;
02:
03: import java.awt.BorderLayout;
04: import java.awt.Frame;
05: import java.awt.Panel;
06:
07: import org.eclipse.core.resources.IResourceChangeEvent;
08: import org.eclipse.core.resources.IResourceChangeListener;
09: import org.eclipse.core.runtime.IProgressMonitor;
10: import org.eclipse.swt.SWT;
11: import org.eclipse.swt.awt.SWT_AWT;
12: import org.eclipse.swt.widgets.Composite;
13: import org.eclipse.ui.IEditorInput;
14: import org.eclipse.ui.IEditorSite;
15: import org.eclipse.ui.PartInitException;
16: import org.eclipse.ui.part.EditorPart;
17:
18: import com.xoetrope.carousel.langed.LangEdDesktop;
19:
20: public class LanguageEditor extends EditorPart implements
21: IResourceChangeListener {
22: private LangEdDesktop langEdDesktop;
23:
24: public void doSave(IProgressMonitor monitor) {
25: }
26:
27: public void doSaveAs() {
28: }
29:
30: public boolean isSaveAsAllowed() {
31: return false;
32: }
33:
34: public void resourceChanged(IResourceChangeEvent event) {
35: }
36:
37: public void init(IEditorSite site, IEditorInput input)
38: throws PartInitException {
39: setSite(site);
40: setInput(input);
41: }
42:
43: public boolean isDirty() {
44: return false;
45: }
46:
47: public void createPartControl(Composite parent) {
48: Composite panelProxy = new Composite(parent, SWT.EMBEDDED);
49:
50: Frame awtFrame = SWT_AWT.new_Frame(panelProxy);
51: awtFrame.setLayout(new BorderLayout());
52:
53: langEdDesktop = new LangEdDesktop(null, true, null, null);
54: langEdDesktop.setVisible(true);
55:
56: Panel root = new Panel();
57: root.setLayout(new BorderLayout());
58: root.add(langEdDesktop, BorderLayout.CENTER);
59:
60: awtFrame.add(root);
61: }
62:
63: public LangEdDesktop getLangEdDesktop() {
64: return langEdDesktop;
65: }
66:
67: public void setFocus() {
68: }
69: }
|