Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskovalsky2015-03-29 22:34:14 +0000
committerskovalsky2015-03-29 22:37:03 +0000
commit077da7f7966a153054661462bf89cffac3250fd2 (patch)
tree2ebccb094df2099f4b8f27d9b87aef0250dea6a5 /plugins
parent04fbff613efacda85020f24f50550bed0d6dcbda (diff)
downloadorg.eclipse.papyrus-077da7f7966a153054661462bf89cffac3250fd2.tar.gz
org.eclipse.papyrus-077da7f7966a153054661462bf89cffac3250fd2.tar.xz
org.eclipse.papyrus-077da7f7966a153054661462bf89cffac3250fd2.zip
Bug 462540 - [Element Types] State diagram should be migrated to the
elementtypes framework: - remove transition commands Change-Id: I5049e25e881a1d1a1d0182cd01a908b8ed8ee404 Signed-off-by: skovalsky <kovalsky@montages.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomTransitionReorientCommand.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomStateItemSemanticEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionCreateCommand.java156
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionReorientCommand.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConnectionPointReferenceItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateChoiceItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateDeepHistoryItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateEntryPointItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateExitPointItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateForkItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateInitialItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJoinItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJunctionItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateShallowHistoryItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateTerminateItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/TransitionEditHelper.java119
19 files changed, 120 insertions, 648 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomTransitionReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomTransitionReorientCommand.java
deleted file mode 100644
index 8f84ac68cec..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomTransitionReorientCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.statemachine.custom.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.uml2.uml.Vertex;
-
-/**
- * Customized transition-reorient command, takes changing of container into account.
- *
- * @author ansgar
- *
- */
-public class CustomTransitionReorientCommand extends TransitionReorientCommand {
- /**
- * @generated
- */
- protected final EObject newEnd;
-
- public CustomTransitionReorientCommand(ReorientRelationshipRequest request) {
- super(request);
- newEnd = request.getNewRelationshipEnd();
- }
-
- @Override
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().setSource(getNewSource());
- EMFCustomTransitionRetargetContainerCommand.changeContainer(getLink());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- @Override
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().setTarget(getNewTarget());
- EMFCustomTransitionRetargetContainerCommand.changeContainer(getLink());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- @Override
- protected boolean canReorientSource() {
- Vertex target = getLink().getTarget();
- if (!EMFCustomTransitionRetargetContainerCommand.isValid(newEnd, target)) {
- return false;
- }
- return super.canReorientSource();
- }
-
- @Override
- protected boolean canReorientTarget() {
- Vertex source = getLink().getSource();
- if (!EMFCustomTransitionRetargetContainerCommand.isValid(source, newEnd)) {
- return false;
- }
- return super.canReorientTarget();
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomStateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomStateItemSemanticEditPolicy.java
index e4d274490a0..82c0bdb37b7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomStateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomStateItemSemanticEditPolicy.java
@@ -13,8 +13,6 @@ package org.eclipse.papyrus.uml.diagram.statemachine.custom.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.CustomTransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.StateItemSemanticEditPolicy;
@@ -29,8 +27,6 @@ public class CustomStateItemSemanticEditPolicy extends StateItemSemanticEditPoli
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomTransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionCreateCommand.java
deleted file mode 100644
index ec40436e5cc..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionCreateCommand.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.eclipse.papyrus.uml.diagram.statemachine.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.EMFCustomTransitionRetargetContainerCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.statemachine.providers.ElementInitializers;
-import org.eclipse.uml2.uml.Region;
-import org.eclipse.uml2.uml.Transition;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.Vertex;
-
-/**
- * @generated
- */
-public class TransitionCreateCommand extends EditElementCommand {
-
- /**
- * Default approach is to traverse ancestors of the source to find instance
- * of container. Modify with appropriate logic.
- *
- * @generated NOT
- */
- protected Region deduceContainer(EObject source, EObject target) {
- // TODO: avoid modification of generated code, problem is that model needs to be changed at many places ...
- return EMFCustomTransitionRetargetContainerCommand.deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- protected Region container;
-
- /**
- * @generated
- */
- public TransitionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
- }
-
- /**
- * @generated
- */
- @Override
- public boolean canExecute() {
- if (source == null && target == null) {
- return false;
- }
- if (source != null && false == source instanceof Vertex) {
- return false;
- }
- if (target != null && false == target instanceof Vertex) {
- return false;
- }
- if (getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- if (getContainer() == null) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateTransition_7000(getContainer(), getSource(), getTarget());
- }
-
- /**
- * @generated
- */
- protected void doConfigure(Transition newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
- configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if (configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
-
- Transition newElement = UMLFactory.eINSTANCE.createTransition();
- getContainer().getTransitions()
- .add(newElement);
- newElement.setSource(
- getSource()
- );
- newElement.setTarget(
- getTarget()
- );
- ElementInitializers.getInstance().init_Transition_7000(newElement);
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest) getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
-
- }
-
- /**
- * @generated
- */
- public Region getContainer() {
- return container;
- }
-
- /**
- * @generated
- */
- protected Vertex getSource() {
- return (Vertex) source;
- }
-
- /**
- * @generated
- */
- protected Vertex getTarget() {
- return (Vertex) target;
- }
-
- /**
- * @generated
- */
- @Override
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionReorientCommand.java
deleted file mode 100644
index 1401d555910..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/TransitionReorientCommand.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package org.eclipse.papyrus.uml.diagram.statemachine.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.EMFCustomTransitionRetargetContainerCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Region;
-import org.eclipse.uml2.uml.Transition;
-import org.eclipse.uml2.uml.Vertex;
-
-/**
- * @generated
- */
-public class TransitionReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public TransitionReorientCommand(ReorientRelationshipRequest request) {
- super(request.getLabel(), request.getRelationship(), request);
- reorientDirection = request.getDirection();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- @Override
- public boolean canExecute() {
- if (false == getElementToEdit() instanceof Transition) {
- return false;
- }
- if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated NOT
- */
- protected boolean canReorientSource() {
- if (!(oldEnd instanceof Vertex && newEnd instanceof Vertex)) {
- return false;
- }
- Vertex target = getLink().getTarget();
- if (!(getLink().eContainer() instanceof Region)) {
- return false;
- }
- // TODO: avoid modifications here. Not done due to many required changes
- if (!EMFCustomTransitionRetargetContainerCommand.isValid(newEnd, target)) {
- return false;
- }
- Region container = (Region) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistTransition_7000(container, getLink(), getNewSource(), target);
- }
-
- /**
- * @generated NOT
- */
- protected boolean canReorientTarget() {
- if (!(oldEnd instanceof Vertex && newEnd instanceof Vertex)) {
- return false;
- }
- Vertex source = getLink().getSource();
- if (!(getLink().eContainer() instanceof Region)) {
- return false;
- }
- // TODO: avoid modifications here. Not done due to many required changes
- if (!EMFCustomTransitionRetargetContainerCommand.isValid(source, newEnd)) {
- return false;
- }
- Region container = (Region) getLink().eContainer();
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistTransition_7000(container, getLink(), source, getNewTarget());
- }
-
- /**
- * @generated
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * @generated
- */
- protected Transition getLink() {
- return (Transition) getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected Vertex getNewSource() {
- return (Vertex) newEnd;
- }
-
- /**
- * @generated
- */
- protected Vertex getNewTarget() {
- return (Vertex) newEnd;
- }
-
- /**
- * @generated
- */
- protected Vertex getOldSource() {
- return (Vertex) oldEnd;
- }
-
- /**
- * @generated
- */
- protected Vertex getOldTarget() {
- return (Vertex) oldEnd;
- }
-
- /**
- * @generated NOT
- */
- protected CommandResult reorientSource() throws ExecutionException {
- getLink().setSource(getNewSource());
- // TODO: avoid modifications here. Not done due to many required changes
- EMFCustomTransitionRetargetContainerCommand.changeContainer(getLink());
- return CommandResult.newOKCommandResult(getLink());
- }
-
- /**
- * @generated NOT
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getLink().setTarget(getNewTarget());
- EMFCustomTransitionRetargetContainerCommand.changeContainer(getLink());
- return CommandResult.newOKCommandResult(getLink());
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConnectionPointReferenceItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConnectionPointReferenceItemSemanticEditPolicy.java
index 9bd429431cc..b1b3165b18d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConnectionPointReferenceItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConnectionPointReferenceItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class ConnectionPointReferenceItemSemanticEditPolicy extends UMLBaseItemS
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -130,13 +120,6 @@ public class ConnectionPointReferenceItemSemanticEditPolicy extends UMLBaseItemS
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -149,8 +132,6 @@ public class ConnectionPointReferenceItemSemanticEditPolicy extends UMLBaseItemS
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
index f11bbeb734c..4b8e47ba5d3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
@@ -28,9 +28,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -98,13 +95,6 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -137,13 +127,6 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -156,8 +139,6 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateChoiceItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateChoiceItemSemanticEditPolicy.java
index 7d1f0653e9b..3cbd2b3410f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateChoiceItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateChoiceItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateChoiceItemSemanticEditPolicy extends UMLBaseItemSemantic
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateChoiceItemSemanticEditPolicy extends UMLBaseItemSemantic
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateChoiceItemSemanticEditPolicy extends UMLBaseItemSemantic
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateDeepHistoryItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateDeepHistoryItemSemanticEditPolicy.java
index 26abd004b8d..e8377c0d476 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateDeepHistoryItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateDeepHistoryItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateDeepHistoryItemSemanticEditPolicy extends UMLBaseItemSem
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateDeepHistoryItemSemanticEditPolicy extends UMLBaseItemSem
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateDeepHistoryItemSemanticEditPolicy extends UMLBaseItemSem
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateEntryPointItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateEntryPointItemSemanticEditPolicy.java
index 65d08cbf087..269ea0814ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateEntryPointItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateEntryPointItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateEntryPointItemSemanticEditPolicy extends UMLBaseItemSema
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateEntryPointItemSemanticEditPolicy extends UMLBaseItemSema
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateEntryPointItemSemanticEditPolicy extends UMLBaseItemSema
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateExitPointItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateExitPointItemSemanticEditPolicy.java
index fe21dc6b8cc..4fde05166f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateExitPointItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateExitPointItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateExitPointItemSemanticEditPolicy extends UMLBaseItemSeman
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateExitPointItemSemanticEditPolicy extends UMLBaseItemSeman
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateExitPointItemSemanticEditPolicy extends UMLBaseItemSeman
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateForkItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateForkItemSemanticEditPolicy.java
index cbb808fefe9..646d236c681 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateForkItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateForkItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateForkItemSemanticEditPolicy extends UMLBaseItemSemanticEd
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateForkItemSemanticEditPolicy extends UMLBaseItemSemanticEd
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateForkItemSemanticEditPolicy extends UMLBaseItemSemanticEd
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateInitialItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateInitialItemSemanticEditPolicy.java
index a38c364f3d3..81fa88fdcd5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateInitialItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateInitialItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateInitialItemSemanticEditPolicy extends UMLBaseItemSemanti
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateInitialItemSemanticEditPolicy extends UMLBaseItemSemanti
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateInitialItemSemanticEditPolicy extends UMLBaseItemSemanti
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJoinItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJoinItemSemanticEditPolicy.java
index 281b16264f4..4233934c852 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJoinItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJoinItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateJoinItemSemanticEditPolicy extends UMLBaseItemSemanticEd
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateJoinItemSemanticEditPolicy extends UMLBaseItemSemanticEd
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateJoinItemSemanticEditPolicy extends UMLBaseItemSemanticEd
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJunctionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJunctionItemSemanticEditPolicy.java
index fbaf8682713..8d606305d93 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJunctionItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateJunctionItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateJunctionItemSemanticEditPolicy extends UMLBaseItemSemant
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateJunctionItemSemanticEditPolicy extends UMLBaseItemSemant
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateJunctionItemSemanticEditPolicy extends UMLBaseItemSemant
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateShallowHistoryItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateShallowHistoryItemSemanticEditPolicy.java
index be46b015836..02008fa352a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateShallowHistoryItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateShallowHistoryItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateShallowHistoryItemSemanticEditPolicy extends UMLBaseItem
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateShallowHistoryItemSemanticEditPolicy extends UMLBaseItem
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateShallowHistoryItemSemanticEditPolicy extends UMLBaseItem
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateTerminateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateTerminateItemSemanticEditPolicy.java
index b1786a06b80..87ea617d818 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateTerminateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/PseudostateTerminateItemSemanticEditPolicy.java
@@ -27,9 +27,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
import org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -97,13 +94,6 @@ public class PseudostateTerminateItemSemanticEditPolicy extends UMLBaseItemSeman
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -133,13 +123,6 @@ public class PseudostateTerminateItemSemanticEditPolicy extends UMLBaseItemSeman
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -152,8 +135,6 @@ public class PseudostateTerminateItemSemanticEditPolicy extends UMLBaseItemSeman
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
index 2d5c20758c7..5650d140e40 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
@@ -38,8 +38,6 @@ 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.statemachine.edit.commands.InternalTransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
@@ -382,13 +380,6 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
@@ -421,13 +412,6 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
isExtendedType = true;
}
}
- if (UMLElementTypes.Transition_7000 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new TransitionCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -440,8 +424,6 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
@Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch (getVisualID(req)) {
- case TransitionEditPart.VISUAL_ID:
- return getGEFWrapper(new TransitionReorientCommand(req));
}
return super.getReorientRelationshipCommand(req);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
index b188c399aa3..5435ee3730b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
@@ -3426,7 +3426,7 @@
name="UML::Transition"
identifier="org.eclipse.papyrus.uml.Transition"
hint="UML::Transition"
- editHelperClassName="org.eclipse.papyrus.uml.service.types.helper.ElementEditHelper">
+ editHelperClassName="org.eclipse.papyrus.uml.service.types.helper.TransitionEditHelper">
<iconEntry
xmi:id="_SdLCtlYCEeS0WsAAtVmToA"
iconPath="/icons/full/obj16/Transition.gif"
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/TransitionEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/TransitionEditHelper.java
new file mode 100644
index 00000000000..67806ec63d2
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/TransitionEditHelper.java
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.IdentityCommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.uml2.uml.Transition;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.Vertex;
+
+public class TransitionEditHelper extends ElementEditHelper {
+
+ protected boolean canCreate(EObject source, EObject target) {
+ if (false == source instanceof Vertex) {
+ return false;
+ }
+ if (target == null) {
+ return true;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ EObject source = req.getSource();
+ EObject target = req.getTarget();
+ if (false == source instanceof Vertex) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (target == null) {
+ return IdentityCommand.INSTANCE;
+ }
+ if (false == target instanceof Vertex) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (source == target) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ setContainerAndFeature(req, (Vertex) source);
+ return super.getCreateRelationshipCommand(req);
+ }
+
+ private void setContainerAndFeature(CreateRelationshipRequest req, Vertex vertex) {
+ req.setContainer(vertex.getContainer());
+ req.setContainmentFeature(UMLPackage.eINSTANCE.getRegion_Transition());
+ }
+
+
+ @Override
+ protected ICommand getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ return new ReorientTransitionCommand(req);
+ }
+
+ private static class ReorientTransitionCommand extends EditElementCommand {
+
+ private final EObject myNewEnd;
+
+ private final int myReorientDirection;
+
+ protected ReorientTransitionCommand(ReorientRelationshipRequest req) {
+ super("Reorient Transition Command", (EObject) req.getRelationship(), req); ////$NON-NLS-1$
+ myNewEnd = req.getNewRelationshipEnd();
+ myReorientDirection = req.getDirection();
+ }
+
+ @Override
+ public boolean canExecute() {
+ if (false == myNewEnd instanceof Vertex) {
+ return false;
+ }
+ if (false == getElementToEdit() instanceof Transition) {
+ return false;
+ }
+ if (myReorientDirection != ReorientRelationshipRequest.REORIENT_SOURCE && myReorientDirection != ReorientRelationshipRequest.REORIENT_TARGET) {
+ return false;
+ }
+ return super.canExecute();
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Transition link = (Transition) getElementToEdit();
+ Vertex newLinkEnd = (Vertex) myNewEnd;
+ if (myReorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ link.setSource(newLinkEnd);
+ } else if (myReorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ link.setTarget(newLinkEnd);
+ } else {
+ return CommandResult.newErrorCommandResult("Wrong direction");
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ }
+}

Back to the top