Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xtend43
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend16
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend18
3 files changed, 6 insertions, 71 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xtend
index 63b4d9e479b..5cbb6d18b97 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xtend
@@ -129,11 +129,6 @@ override def addDestroyShortcutsCommand(GenDiagram it) '''
«getCreateCommand(it)»
- // RS: add code for extended types
- «getCreateExtendedTypeCommand(it)»
- «getExtendedStartCreateRelationshipCommand(it)»
- «getExtendedCompleteCreateRelationshipCommand(it)»
- // RS: End of add code for extended types
«getCreateSemanticServiceEditCommand(it)»
«getSetCommand(it)»
@@ -206,44 +201,6 @@ protected org.eclipse.gef.commands.Command getCreateRelationshipCommand(org.ecli
}
'''
- def getCreateExtendedTypeCommand(GenDiagram it) '''
-«generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedTypeCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(request.getContainer());
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
- }
-'''
-
- def getExtendedStartCreateRelationshipCommand(GenDiagram it) '''
-«generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedStartCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
-}
-'''
-
- def getExtendedCompleteCreateRelationshipCommand(GenDiagram it) '''
-«generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedCompleteCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
-}
-'''
override getMoveCommand(GenDiagram it) '''
«generatedMemberComment()»
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 f4895b3a4d6..7141f4fb939 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
@@ -78,9 +78,6 @@ import xpt.providers.ElementTypes
return null;
}
org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;
- «IF aspectsUtils_qvto.containsCreateStartLinkCommand(it)»
- boolean isExtendedType = true;
- «ENDIF»
«FOR l : getAllPotentialLinks(it)»
«startLinkCommands(l, it)»
@@ -96,9 +93,6 @@ import xpt.providers.ElementTypes
return null;
}
org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;
- «IF aspectsUtils_qvto.containsCreateCompleteLinkCommand(it)»
- boolean isExtendedType = true;
- «ENDIF»
«FOR l : getAllPotentialLinks(it)»
«completeLinkCommands(l, it)»
@@ -110,9 +104,7 @@ import xpt.providers.ElementTypes
override startLinkCommands(GenLink it, GenLinkEnd linkEnd) '''
if («xptElementTypes.accessElementType(it)» == baseElementType) {
«IF createStartLinkCommand(it, linkEnd)»
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, requestElementType);
- }
+
return getGEFWrapper(new «xptCreateLinkCommand.qualifiedClassName(it)»(req,
«IF createStartIncomingLinkCommand(it, linkEnd)»
req.getTarget(), req.getSource()
@@ -123,15 +115,12 @@ import xpt.providers.ElementTypes
«ELSE»
return null;
«ENDIF»
- }
'''
override completeLinkCommands(GenLink it, GenLinkEnd linkEnd) '''
if («xptElementTypes.accessElementType(it)» == baseElementType) {
«IF createCompleteLinkCommand(it, linkEnd)»
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, requestElementType);
- }
+
return getGEFWrapper(new «xptCreateLinkCommand.qualifiedClassName(it)»(req,
«IF createCompleteOutgoingLinkCommand(it, linkEnd)»
req.getTarget(), req.getSource()
@@ -142,7 +131,6 @@ import xpt.providers.ElementTypes
«ELSE»
return null;
«ENDIF»
- }
'''
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
index 323c3939a94..401cdcf7303 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
@@ -197,21 +197,11 @@ import xpt.editor.VisualIDRegistry
«generatedMemberComment»«/* XXX: unlike createNode, we don't check op.containerView() for null here. On purpose? */»
protected boolean provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation op) {
org.eclipse.gmf.runtime.emf.type.core.IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- //RS: add code for extended types creation
- if(elementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType closestNonExtendedType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(elementType);
- if(!«getElementTypesQualifiedClassName()».isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type.
- }
- } else {
- if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type
- }
+
+ if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
+ return false; // foreign element type
}
- //if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- // return false; // foreign element type
- //}
- // END R.S.
+
String elementTypeHint = ((org.eclipse.gmf.runtime.emf.type.core.IHintedType) elementType).getSemanticHint();
if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
return false; // our hint is visual id and must be specified, and it should be the same as in element type

Back to the top