Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistria2011-08-08 16:00:39 +0000
committermistria2011-08-08 16:00:39 +0000
commit6af63931f1daa587158775a246ec8afcd095cf4e (patch)
tree09f95fd4996f44737cfde2abcc1693f2e1d35f47
parent4a554ab0ac3f11e962f58a9ab04a5a7064aa3f00 (diff)
downloadorg.eclipse.gmf-tooling-6af63931f1daa587158775a246ec8afcd095cf4e.tar.gz
org.eclipse.gmf-tooling-6af63931f1daa587158775a246ec8afcd095cf4e.tar.xz
org.eclipse.gmf-tooling-6af63931f1daa587158775a246ec8afcd095cf4e.zip
bug:354152 -> Fixed isSingleValue to support "-2"
bug:354128 -> Updated template when root is DocumentRoot
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/OclMigrationProblems.qvto2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/DiagramEditorUtil.xpt10
2 files changed, 8 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/OclMigrationProblems.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/OclMigrationProblems.qvto
index 10ec22640..b3fcd5ba7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/OclMigrationProblems.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/OclMigrationProblems.qvto
@@ -8,7 +8,7 @@ helper isUnbounded(typedElement : ecore::ETypedElement) : Boolean {
}
helper isSingleValued(typedElement : ecore::ETypedElement) : Boolean {
- return typedElement.upperBound = 1
+ return typedElement.upperBound = 1 or typedElement.upperBound = -2
}
helper firstOrNull(oSet : OrderedSet(gmfgen::DefaultSizeAttributes)) : gmfgen::DefaultSizeAttributes {
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/DiagramEditorUtil.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/DiagramEditorUtil.xpt
index 1b77077e0..9bafaeeb8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/DiagramEditorUtil.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/DiagramEditorUtil.xpt
@@ -250,12 +250,16 @@ public class «diagramEditorUtilClassName» {
«DEFINE createDocumentRootMethod FOR gmfgen::GenDiagram»
«EXPAND xpt::Common::generatedMemberComment»
private static «EXPAND MetaModel::QualifiedClassName FOR getDocumentRoot(self)» createDocumentRoot(«EXPAND MetaModel::QualifiedClassName FOR domainDiagramElement» model) {
- «EXPAND MetaModel::NewInstance('docRoot') FOR getDocumentRoot(self)»
-«LET getDocumentRootSetFeature(self) AS f»«IF f = null-»
+ «IF domainDiagramElement = getDocumentRoot(self)»
+ return model;
+ «ELSE»
+ «EXPAND MetaModel::NewInstance('docRoot') FOR getDocumentRoot(self)»
+ «LET getDocumentRootSetFeature(self) AS f»«IF f = null-»
docRoot.set«domainDiagramElement.ecoreClass.name»(model); // FIXME name of the set method is pure guess«ELSE-»
«EXPAND MetaModel::modifyFeature('docRoot', getDocumentRoot(self), 'model') FOR f»«ENDIF»
-«ENDLET-»
+ «ENDLET-»
return docRoot;
+ «ENDIF»
}
«ENDDEFINE»

Back to the top