Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
index dec4d547a..d0d4107e9 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
@@ -238,8 +238,17 @@ if (!genDiagram.isSynchronized()) {
myDiagramRoot = null;
if (event.getSelection() instanceof <%=importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")%>) {
<%=importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")%> selection = (<%=importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")%>) event.getSelection();
- if (selection.size() == 1 && selection.getFirstElement() instanceof EObject) {
- myDiagramRoot = (EObject) selection.getFirstElement();
+ if (selection.size() == 1) {
+ Object selectedElement = selection.getFirstElement();
+ if (selectedElement instanceof <%=importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")%>) {
+ selectedElement = ((<%=importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")%>) selectedElement).getValue();
+ }
+ if (selectedElement instanceof <%=importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Entry) {
+ selectedElement = ((<%=importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Entry) selectedElement).getValue();
+ }
+ if (selectedElement instanceof EObject) {
+ myDiagramRoot = (EObject) selectedElement;
+ }
}
}
setPageComplete(validatePage());

Back to the top