diff options
author | Florian Noyrit | 2014-03-03 18:35:01 +0000 |
---|---|---|
committer | Florian Noyrit | 2014-03-03 18:35:01 +0000 |
commit | 3724d11f5e8c95b39c35a1895ca977515d2fe392 (patch) | |
tree | 6df809ceee75ad07c1ff5e87fea7c2f0a6ebe3aa /plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend | |
parent | e6640915c57d431d04bd85d42bf6da5fa4434dda (diff) | |
download | org.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.tar.gz org.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.tar.xz org.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.zip |
Updated generation templates
Regenerated class diagram with many refactorings
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend index 1b16e699e54..a17cac0b44a 100644 --- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend +++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend @@ -51,7 +51,8 @@ import xpt.providers.ElementTypes @Singleton class linkCommands extends xpt.diagram.editpolicies.linkCommands {
@Inject extension Utils_qvto;
@Inject extension Common;
-
+ + @Inject aspects.xpt.diagram.editpolicies.Utils_qvto aspectsUtils_qvto
@Inject VisualIDRegistry xptVisualIDRegistry; @Inject ElementTypes xptElementTypes; @Inject CreateLinkCommand xptCreateLinkCommand;
@@ -77,15 +78,21 @@ import xpt.providers.ElementTypes return null; } org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType; + «IF aspectsUtils_qvto.containsCreateStartLinkCommand(it)» boolean isExtendedType = false; + «ENDIF» if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) { baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType); if(baseElementType != null) { + «IF aspectsUtils_qvto.containsCreateStartLinkCommand(it)» isExtendedType = true; + «ENDIF» } 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); + «IF aspectsUtils_qvto.containsCreateStartLinkCommand(it)» isExtendedType = true; + «ENDIF» } } «FOR l : getAllPotentialLinks(it)» @@ -102,15 +109,21 @@ import xpt.providers.ElementTypes return null; } org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType; + «IF aspectsUtils_qvto.containsCreateCompleteLinkCommand(it)» boolean isExtendedType = false; + «ENDIF» if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) { baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType); if(baseElementType != null) { + «IF aspectsUtils_qvto.containsCreateCompleteLinkCommand(it)» isExtendedType = true; + «ENDIF» } 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); + «IF aspectsUtils_qvto.containsCreateCompleteLinkCommand(it)» isExtendedType = true; + «ENDIF» } } «FOR l : getAllPotentialLinks(it)» @@ -164,15 +177,19 @@ import xpt.providers.ElementTypes «generatedMemberComment(
'Returns command to reorient EClass based link. New link target or source\n' + 'should be the domain model element associated with this node.\n'
)» - protected org.eclipse.gef.commands.Command getReorientRelationshipCommand( - org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - «FOR rLink : getReroutableTypeLinks(it)»
- «reorientLinkCommandWithService(rLink)» - «ENDFOR»
- } - return super.getReorientRelationshipCommand(req); - } + protected org.eclipse.gef.commands.Command getReorientRelationshipCommand( + org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) { + switch (getVisualID(req)) { + «FOR link : getReroutableTypeLinks(it)» + «reorientLinkCommandWithService(link) » + «ENDFOR» + «callReorientCommand(it)» + «FOR link : getReroutableTypeLinks(it)» + «reorientLinkCommandWithoutService(link) » + «ENDFOR» + } + return super.getReorientRelationshipCommand(req); + } '''
//This function writes only : "case myLinkEditPart.VISUAL_ID:" @@ -204,7 +221,7 @@ import xpt.providers.ElementTypes // This function writes the code for the Links which uses their own ReorientCommand (the initial code) def reorientLinkCommandWithoutService(GenLink it) '''
- «IF it.eResource.allContents.filter(EditPartUsingReorientService).filter[v|v.genView.contains(it)].size != 0»
+ «IF it.eResource.allContents.filter(EditPartUsingReorientService).filter[v|v.genView.contains(it)].size == 0»
«reorientLinkCommand(it)» «ENDIF»
'''
|