Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto
new file mode 100644
index 000000000..e6716d8b8
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/GenDiagram.qvto
@@ -0,0 +1,29 @@
+import xpt.NativeGenModelUtils;
+
+import xpt.GenModelUtils;
+
+modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";
+modeltype genModel_1 uses "http://www.eclipse.org/emf/2002/GenModel";
+modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
+
+library GenDiagram;
+
+helper standaloneDomainModel(genDiagram : genModel::GenDiagram) : Boolean {
+ return not genDiagram.editorGen.sameFileForDiagramAndModel and genDiagram.domainDiagramElement <> null
+}
+
+helper hasDocumentRoot(genDiagram : genModel::GenDiagram) : Boolean {
+ return getDocumentRoot(genDiagram) <> null
+}
+
+helper getDocumentRoot(genDiagram : genModel::GenDiagram) : genModel_1::GenClass {
+ return (if genDiagram.domainDiagramElement = null then null else getDocumentRoot(genDiagram.domainDiagramElement.genPackage) endif)
+}
+
+helper getDocumentRootSetFeature(genDiagram : genModel::GenDiagram) : genModel_1::GenFeature {
+ return getDocumentRoot(genDiagram).genFeatures->select(f | isDocRootSetFeature(f, genDiagram.domainDiagramElement.ecoreClass))->first()
+}
+
+helper isDocRootSetFeature(gf : genModel_1::GenFeature, eType : ecore::EClass) : Boolean {
+ return not isListType(gf) and gf.ecoreFeature.changeable and (-2 = gf.ecoreFeature.upperBound.oclAsType(Integer) and (gf.ecoreFeature.eClass().name = 'EReference' and gf.ecoreFeature.eType.oclAsType(ecore::EClass).isSuperTypeOf(eType)))
+}

Back to the top