Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2011-12-01 22:50:52 +0000
committerBogdan Gheorghe2011-12-01 22:50:52 +0000
commit21f2fdcb72cec360e2085f884d07f8d50aa2d49f (patch)
treea1565cf03b3e8ffee208a7ac9081e10ceb058b1a
parent2a9dfa1c2abf51652efef1c4f7d5326296ce556c (diff)
downloadorg.eclipse.e4.tools-21f2fdcb72cec360e2085f884d07f8d50aa2d49f.tar.gz
org.eclipse.e4.tools-21f2fdcb72cec360e2085f884d07f8d50aa2d49f.tar.xz
org.eclipse.e4.tools-21f2fdcb72cec360e2085f884d07f8d50aa2d49f.zip
Use new model service API for hosting MPartv20111201-2250I20111202-1500I20111201-2015
-rw-r--r--bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
index 3c5d5749..b7ae68f2 100644
--- a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
+++ b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/preferences/CSSEditorPreferences.java
@@ -34,6 +34,7 @@ import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.SWT;
@@ -65,6 +66,7 @@ public class CSSEditorPreferences extends PreferencePageEnhancer {
IWorkbenchWindow wbw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
MWindow hostWin = (MWindow) wbw.getService(MWindow.class);
EPartService partService = hostWin.getContext().get(EPartService.class);
+ EModelService modelService = hostWin.getContext().get(EModelService.class);
MPart editor = partService.createPart(CompatibilityEditor.MODEL_ELEMENT_ID);
engine = hostWin.getContext().get(IThemeEngine.class);
@@ -79,19 +81,16 @@ public class CSSEditorPreferences extends PreferencePageEnhancer {
IEclipseContext localContext = hostWin.getContext().createChild();
localContext.set(IEditorInput.class, input);
localContext.set(EditorReference.class, reference);
- // This is subtle; unless the element is hooked into the model it won't
- // fire events
- hostWin.getSharedElements().add(editor);
// Render it
- IPresentationEngine renderer = hostWin.getContext().get(IPresentationEngine.class);
Composite composite3 = new Composite(parent, SWT.BORDER);
composite3.setLayout(new FillLayout());
GridData data = new GridData(SWT.CENTER, SWT.CENTER, true, true, 2, 2);
data.widthHint = 500;
data.heightHint = 500;
composite3.setLayoutData(data);
- Object createdElement = renderer.createGui(editor, composite3, localContext);
+
+ modelService.hostElement(editor, hostWin, composite3, localContext);
partService.activate(editor);
IEditorPart tmpEditor = editor.getContext().get(IEditorPart.class);
if (tmpEditor instanceof XtextEditor) {

Back to the top