Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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.xtend92
1 files changed, 46 insertions, 46 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 7141f4fb939..0b053d973f3 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
@@ -12,21 +12,21 @@
* Michael Golubev (Borland) - [243151] explicit source/target for links
* - #386838 - migrate to Xtend2
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- */
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingReorientService
-import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand
-import xpt.Common
-import xpt.diagram.commands.CreateLinkCommand
-import xpt.diagram.editpolicies.Utils_qvto
-import xpt.editor.VisualIDRegistry
-import xpt.providers.ElementTypes
-
+ */
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
+import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingReorientService
+import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand
+import xpt.Common
+import xpt.diagram.commands.CreateLinkCommand
+import xpt.diagram.editpolicies.Utils_qvto
+import xpt.editor.VisualIDRegistry
+import xpt.providers.ElementTypes
+
/**
* Start start of link creation.
* User click to this editpart and start dragging with link tool.
@@ -47,16 +47,16 @@ import xpt.providers.ElementTypes
* in the latter case it is assumed that its a TypeLink (so its model facet is LinkTypeModelFacet),
* because RefLinks don't have underlying semantic identity
*
-*/
-@Singleton class linkCommands extends xpt.diagram.editpolicies.linkCommands {
- @Inject extension Utils_qvto;
- @Inject extension Common;
+*/
+@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 aspects.xpt.diagram.editpolicies.Utils_qvto aspectsUtils_qvto
@Inject VisualIDRegistry xptVisualIDRegistry;
@Inject ElementTypes xptElementTypes;
- @Inject CreateLinkCommand xptCreateLinkCommand;
-
+ @Inject CreateLinkCommand xptCreateLinkCommand;
+
override createLinkCommands(GenLinkEnd it) '''
«IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size <1»
@@ -133,11 +133,11 @@ import xpt.providers.ElementTypes
«ENDIF»
'''
-
+
// We overwrite the reorientTypeLinkCommands to manages the links which use the ReorientCommand provided by the EditService
- override reorientTypeLinkCommands(GenLinkEnd it) '''
- «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'
+ override reorientTypeLinkCommands(GenLinkEnd it) '''
+ «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) {
@@ -155,21 +155,21 @@ import xpt.providers.ElementTypes
}
return super.getReorientRelationshipCommand(req);
}
- '''
-
+ '''
+
//This function writes only : "case myLinkEditPart.VISUAL_ID:"
//for the link which uses the ReorientCommand provided by the EditService
- def reorientLinkCommandWithService(GenLink it) '''
- «IF it.eResource.allContents.filter(typeof(EditPartUsingReorientService)).filter[v| v.genView.contains(it)].size != 0»
+ def reorientLinkCommandWithService(GenLink it) '''
+ «IF it.eResource.allContents.filter(typeof(EditPartUsingReorientService)).filter[v| v.genView.contains(it)].size != 0»
«xptVisualIDRegistry.caseVisualID(it)»
- «ENDIF»
- '''
-
+ «ENDIF»
+ '''
+
// This function writes the code to call the ReorientCommand provided by the ReorientService
- def callReorientCommand(GenLinkEnd it) '''
+ def callReorientCommand(GenLinkEnd it) '''
«var rServiceNodes = it.eResource.allContents.filter(typeof (EditPartUsingReorientService))»
- «IF !rServiceNodes.empty»
- «IF !rServiceNodes.filter[rServiceNode|(!(rServiceNode.genView.filter[view|getReroutableTypeLinks(it).toList.contains(view)].empty))].empty»
+ «IF !rServiceNodes.empty»
+ «IF !rServiceNodes.filter[rServiceNode|(!(rServiceNode.genView.filter[view|getReroutableTypeLinks(it).toList.contains(view)].empty))].empty»
org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider =org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getRelationship());
if(provider == null) {
return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
@@ -180,15 +180,15 @@ import xpt.providers.ElementTypes
return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
}
return getGEFWrapper(reorientCommand.reduce());
- «ENDIF»
- «ENDIF»
- '''
-
+ «ENDIF»
+ «ENDIF»
+ '''
+
// 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»
+ def reorientLinkCommandWithoutService(GenLink it) '''
+ «IF it.eResource.allContents.filter(EditPartUsingReorientService).filter[v|v.genView.contains(it)].size == 0»
«reorientLinkCommand(it)»
- «ENDIF»
- '''
-
-}
+ «ENDIF»
+ '''
+
+}

Back to the top