diff options
author | ptessier | 2014-03-28 16:24:15 +0000 |
---|---|---|
committer | ptessier | 2014-03-28 16:24:15 +0000 |
commit | 44cdeaafc730bc6acba1e5d28744d883275d1a03 (patch) | |
tree | 74d587258e3a2ade7fba9767af5b05b3d1e3048e /plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend | |
parent | c688a6391f657796f14e34414201e57b953dc4f6 (diff) | |
parent | e030997a556eb1fd481248e7945bbad7e7a1c303 (diff) | |
download | org.eclipse.papyrus-44cdeaafc730bc6acba1e5d28744d883275d1a03.tar.gz org.eclipse.papyrus-44cdeaafc730bc6acba1e5d28744d883275d1a03.tar.xz org.eclipse.papyrus-44cdeaafc730bc6acba1e5d28744d883275d1a03.zip |
Merge branch 'master' of ssh://ptessier@git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend index da889d954a4..615b782bf85 100644 --- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend +++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.xtend @@ -40,18 +40,7 @@ import metamodel.MetaModel if(requestElementType == null) { return super.getCreateCommand(req); } - org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType; - boolean isExtendedType = false; - if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) { - baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType); - if(baseElementType != null) { - isExtendedType = true; - } else { - // no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs. - baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.findClosestNonExtendedElementType((org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType); - isExtendedType = true; - } - } + «FOR n : nodes» «IF !n.sansDomain» @@ -63,23 +52,21 @@ import metamodel.MetaModel «ENDIF» ''' -def childNodeCreateCommand(TypeModelFacet it,GenNode node)''' -if («accessElementType(node)» == baseElementType) { - «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0» - // adjust the containment feature - org.eclipse.emf.ecore.EReference containmentFeature = «MetaFeature(it.childMetaFeature)»; - req.setContainmentFeature(containmentFeature); - «ENDIF» - if(isExtendedType) { - return getExtendedTypeCreationCommand(req, (org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType); + def childNodeCreateCommand(TypeModelFacet it,GenNode node)''' + if («accessElementType(node)» == requestElementType) { + «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0» + // adjust the containment feature + org.eclipse.emf.ecore.EReference containmentFeature = «MetaFeature(it.childMetaFeature)»; + req.setContainmentFeature(containmentFeature); + «ENDIF» + + «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0» + return getGEFWrapper(getSemanticCreationCommand(req)); + «ELSE» + return getGEFWrapper(new «node.getCreateCommandQualifiedClassName()»(req, org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getDiagramFrom(getHost()))); + «ENDIF» + } - «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0» - return getGEFWrapper(getSemanticCreationCommand(req)); - «ELSE» - return getGEFWrapper(new «node.getCreateCommandQualifiedClassName()»(req, org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getDiagramFrom(getHost()))); - «ENDIF» - -} -''' + ''' }
\ No newline at end of file |