diff options
author | skovalsky | 2015-03-21 22:06:27 +0000 |
---|---|---|
committer | Svyatoslav Kovalsky | 2015-03-29 21:30:42 +0000 |
commit | 04fbff613efacda85020f24f50550bed0d6dcbda (patch) | |
tree | a83f756a648f07e70d13f2f82197cc8c3136d0d5 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus | |
parent | 9eee3a5b9815afb112dd2b6e2c27cf8862d5401c (diff) | |
download | org.eclipse.papyrus-04fbff613efacda85020f24f50550bed0d6dcbda.tar.gz org.eclipse.papyrus-04fbff613efacda85020f24f50550bed0d6dcbda.tar.xz org.eclipse.papyrus-04fbff613efacda85020f24f50550bed0d6dcbda.zip |
Bug 462540 - [Element Types] State diagram should be migrated to the
elementtypes framework:
- remove context link commands
Change-Id: Iad275e230720069b78817e69b3f301684cbb8183
Signed-off-by: skovalsky <kovalsky@montages.com>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus')
7 files changed, 0 insertions, 333 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java deleted file mode 100644 index 3b42f9bceb9..00000000000 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java +++ /dev/null @@ -1,109 +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.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.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-
-/**
- * @generated
- */
-public class ContextLinkCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- public ContextLinkCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- @Override
- public boolean canExecute() {
- if (source == null && target == null) {
- return false;
- }
- if (source != null && false == source instanceof Constraint) {
- return false;
- }
- if (target != null && false == target instanceof Namespace) {
- 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
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintContext_8500(getSource(), getTarget());
- }
-
- /**
- * @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$
- }
-
- if (getSource() != null && getTarget() != null) {
- getSource().setContext(
- getTarget()
- );
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- @Override
- protected void setElementToEdit(EObject element) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected Constraint getSource() {
- return (Constraint) source;
- }
-
- /**
- * @generated
- */
- protected Namespace getTarget() {
- return (Namespace) target;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java deleted file mode 100644 index 3ea2bbc79b3..00000000000 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java +++ /dev/null @@ -1,166 +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.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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-
-/**
- * @generated
- */
-public class ContextLinkReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ContextLinkReorientCommand(ReorientReferenceRelationshipRequest request) {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- @Override
- public boolean canExecute() {
- if (false == referenceOwner instanceof Constraint) {
- return false;
- }
- if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean canReorientSource() {
- if (!(oldEnd instanceof Namespace && newEnd instanceof Constraint)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget() {
- if (!(oldEnd instanceof Namespace && newEnd instanceof Namespace)) {
- return false;
- }
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getOldSource(), 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 CommandResult reorientSource() throws ExecutionException {
- getOldSource().setContext(
- null
- );
- getNewSource().setContext(
- getOldTarget()
- );
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- getOldSource().setContext(
- getNewTarget()
- );
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected Constraint getOldSource() {
- return (Constraint) referenceOwner;
- }
-
- /**
- * @generated
- */
- protected Constraint getNewSource() {
- return (Constraint) newEnd;
- }
-
- /**
- * @generated
- */
- protected Namespace getOldTarget() {
- return (Namespace) oldEnd;
- }
-
- /**
- * @generated
- */
- protected Namespace getNewTarget() {
- return (Namespace) newEnd;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java index a4f6e957c57..04c09443a97 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.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.ContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -100,13 +97,6 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol if (UMLElementTypes.CommentAnnotatedElement_667 == baseElementType) {
return null;
}
- if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if (isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new ContextLinkCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -134,8 +124,6 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
switch (getVisualID(req)) {
- case ContextLinkEditPart.VISUAL_ID:
- return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(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 fee1d8a77cb..f11bbeb734c 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,11 +28,8 @@ 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.ContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
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.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
@@ -147,13 +144,6 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol return getGEFWrapper(new TransitionCreateCommand(req,
req.getSource(), req.getTarget()));
}
- if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new ContextLinkCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -181,8 +171,6 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
switch (getVisualID(req)) {
- case ContextLinkEditPart.VISUAL_ID:
- return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java index 4e02b52292d..d6719ca19d8 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java @@ -34,8 +34,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.ContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
@@ -542,13 +540,6 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy isExtendedType = true;
}
}
- if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new ContextLinkCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -561,8 +552,6 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
switch (getVisualID(req)) {
- case ContextLinkEditPart.VISUAL_ID:
- return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(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 9aff5175fe6..2d5c20758c7 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 @@ -37,8 +37,6 @@ 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.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
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;
@@ -430,13 +428,6 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy { return getGEFWrapper(new TransitionCreateCommand(req,
req.getSource(), req.getTarget()));
}
- if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new ContextLinkCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -464,8 +455,6 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy { @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
switch (getVisualID(req)) {
- case ContextLinkEditPart.VISUAL_ID:
- return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java index 6fad3bda18e..cc084d02f53 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java @@ -25,9 +25,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelations 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.ContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -116,13 +113,6 @@ public class TransitionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol isExtendedType = true;
}
}
- if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if (isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
- }
- return getGEFWrapper(new ContextLinkCreateCommand(req,
- req.getSource(), req.getTarget()));
- }
return null;
}
@@ -135,8 +125,6 @@ public class TransitionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
switch (getVisualID(req)) {
- case ContextLinkEditPart.VISUAL_ID:
- return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
|