Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java26
1 files changed, 4 insertions, 22 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java
index d45ae754fde..b6877584b1c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/policies/ClassOperationCompartmentItemSemanticEditPolicyCN.java
@@ -14,8 +14,6 @@ package org.eclipse.papyrus.uml.diagram.clazz.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
-import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.OperationForClassCommand;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.ReceptionCreateCommand;
@@ -41,30 +39,14 @@ public class ClassOperationCompartmentItemSemanticEditPolicyCN extends UMLBaseIt
if (requestElementType == null) {
return super.getCreateCommand(req);
}
- IElementType baseElementType = requestElementType;
- boolean isExtendedType = false;
- if (requestElementType instanceof IExtendedHintedElementType) {
- baseElementType = 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 = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
- isExtendedType = true;
- }
- }
- if (UMLElementTypes.Reception_3011 == baseElementType) {
- if (isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
- }
+ if (UMLElementTypes.Reception_3011 == requestElementType) {
+
return getGEFWrapper(new ReceptionCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if (UMLElementTypes.Operation_3013 == baseElementType) {
- if (isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
- }
+ if (UMLElementTypes.Operation_3013 == requestElementType) {
+
return getGEFWrapper(new OperationForClassCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}

Back to the top