diff options
author | Tom Schindl | 2012-05-07 14:27:01 +0000 |
---|---|---|
committer | Tom Schindl | 2012-05-07 14:27:01 +0000 |
commit | 93c506e4c8387505cb80ebc7fc6a35b28c03db96 (patch) | |
tree | 6ab56007c1cd25130fbc081ec980735359d7d461 | |
parent | 9179c44ed4766582b330a6e9e3f8b682471ea450 (diff) | |
download | org.eclipse.e4.tools-93c506e4c8387505cb80ebc7fc6a35b28c03db96.tar.gz org.eclipse.e4.tools-93c506e4c8387505cb80ebc7fc6a35b28c03db96.tar.xz org.eclipse.e4.tools-93c506e4c8387505cb80ebc7fc6a35b28c03db96.zip |
Bug 378618 - [Liveeditor] NPE on Application-Element
-rw-r--r-- | bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java index 31e5bf0e..df35df62 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java @@ -135,6 +135,7 @@ import org.eclipse.e4.ui.di.Persist; import org.eclipse.e4.ui.model.application.MApplicationElement; import org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl; import org.eclipse.e4.ui.model.application.impl.ApplicationPackageImpl; +import org.eclipse.e4.ui.model.application.ui.MContext; import org.eclipse.e4.ui.model.application.ui.MElementContainer; import org.eclipse.e4.ui.model.application.ui.MUIElement; import org.eclipse.e4.ui.model.application.ui.advanced.impl.AdvancedPackageImpl; @@ -635,7 +636,16 @@ public class ModelEditor { try { MApplicationElement o = (MApplicationElement) s.getFirstElement(); IScriptingSupport support = (IScriptingSupport) le.createExecutableExtension("class"); //$NON-NLS-1$ - support.openEditor(viewer.getControl().getShell(), s.getFirstElement(), project == null ? ModelUtils.getContainingContext(o) : null); + IEclipseContext ctx = null; + if (project == null) { + if (o instanceof MContext) { + ctx = ((MContext) o).getContext(); + } else { + ctx = ModelUtils.getContainingContext(o); + } + } + + support.openEditor(viewer.getControl().getShell(), s.getFirstElement(), ctx); } catch (CoreException e) { // TODO Auto-generated catch block e.printStackTrace(); |