Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2006-09-01 08:39:03 -0400
committerashatalin2006-09-01 08:39:03 -0400
commitea95ae2ad329fb65bce945c36241716f5562ced4 (patch)
treefc28b7f4609c19eed37df23851072396f6d6d37a /plugins
parent4b6bd1e8a0556e69b61e9ed117466b2c25257037 (diff)
downloadorg.eclipse.gmf-tooling-ea95ae2ad329fb65bce945c36241716f5562ced4.tar.gz
org.eclipse.gmf-tooling-ea95ae2ad329fb65bce945c36241716f5562ced4.tar.xz
org.eclipse.gmf-tooling-ea95ae2ad329fb65bce945c36241716f5562ced4.zip
[155966] - No valid diagram root in "Initialize ... diagram file" wizard on XSD generated models
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet3
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet13
2 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
index 57a9ff27c..d64a92b2e 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
@@ -336,6 +336,9 @@ for (Iterator it = genDiagram.getContainsShortcutsTo().iterator(); it.hasNext();
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) {
mySelectedModelElement = (EObject) selectedElement;
setOkButtonEnabled(ViewService.getInstance().provides(Node.class, new EObjectAdapter(mySelectedModelElement), myView, null, ViewUtil.APPEND, true, <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.DIAGRAM_PREFERENCES_HINT));
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