Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java27
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java27
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java127
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java50
62 files changed, 1208 insertions, 1186 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java
index aac5ef9e2f3..e2febf3c71d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public CompactLifelineCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public CompactLifelineCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static CompactLifelineCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new CompactLifelineCreateCommandCN(req, eObject);
+ public static CompactLifelineCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new CompactLifelineCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public CompactLifelineCreateCommandCN(final CreateElementRequest req) {
+ public CompactLifelineCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getLifeline());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
-
- final Interaction owner = (Interaction)getElementToEdit();
- owner.getLifelines().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Interaction qualifiedTarget = (Interaction)target;
+ qualifiedTarget.getLifelines().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class CompactLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final Lifeline newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Lifeline 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java
index 169baf0cdf8..f4c74291c8a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.StateInvariant;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public CompactStateInvariantCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public CompactStateInvariantCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static CompactStateInvariantCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new CompactStateInvariantCreateCommandCN(req, eObject);
+ public static CompactStateInvariantCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new CompactStateInvariantCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public CompactStateInvariantCreateCommandCN(final CreateElementRequest req) {
+ public CompactStateInvariantCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getStateInvariant());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final StateInvariant newElement = UMLFactory.eINSTANCE.createStateInvariant();
-
- final Interaction owner = (Interaction)getElementToEdit();
- owner.getFragments().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ StateInvariant newElement = UMLFactory.eINSTANCE.createStateInvariant();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Interaction qualifiedTarget = (Interaction)target;
+ qualifiedTarget.getFragments().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class CompactStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final StateInvariant newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(StateInvariant 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java
index 291358df10b..c603595654b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
/**
* @generated
*/
- public DestructionOccurrenceSpecificationCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public DestructionOccurrenceSpecificationCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static DestructionOccurrenceSpecificationCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new DestructionOccurrenceSpecificationCreateCommandCN(req, eObject);
+ public static DestructionOccurrenceSpecificationCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new DestructionOccurrenceSpecificationCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public DestructionOccurrenceSpecificationCreateCommandCN(final CreateElementRequest req) {
+ public DestructionOccurrenceSpecificationCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final DestructionOccurrenceSpecification newElement = UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification();
-
- final Lifeline owner = (Lifeline)getElementToEdit();
- owner.getCoveredBys().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ DestructionOccurrenceSpecification newElement = UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Lifeline qualifiedTarget = (Lifeline)target;
+ qualifiedTarget.getCoveredBys().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class DestructionOccurrenceSpecificationCreateCommandCN extends EditEleme
/**
* @generated
*/
- protected void doConfigure(final DestructionOccurrenceSpecification newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(DestructionOccurrenceSpecification 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java
index 1fe8cf4db15..44fd26b3418 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.DurationConstraint;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public DurationConstraintCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public DurationConstraintCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static DurationConstraintCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new DurationConstraintCreateCommandCN(req, eObject);
+ public static DurationConstraintCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new DurationConstraintCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public DurationConstraintCreateCommandCN(final CreateElementRequest req) {
+ public DurationConstraintCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDurationConstraint());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final DurationConstraint newElement = UMLFactory.eINSTANCE.createDurationConstraint();
-
- final Namespace owner = (Namespace)getElementToEdit();
- owner.getOwnedRules().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ DurationConstraint newElement = UMLFactory.eINSTANCE.createDurationConstraint();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Namespace qualifiedTarget = (Namespace)target;
+ qualifiedTarget.getOwnedRules().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class DurationConstraintCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final DurationConstraint newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(DurationConstraint 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java
index 60f38663826..8d0fe922d05 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.DurationObservation;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public DurationObservationCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public DurationObservationCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static DurationObservationCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new DurationObservationCreateCommandCN(req, eObject);
+ public static DurationObservationCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new DurationObservationCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public DurationObservationCreateCommandCN(final CreateElementRequest req) {
+ public DurationObservationCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDurationObservation());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final DurationObservation newElement = UMLFactory.eINSTANCE.createDurationObservation();
-
- final Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ DurationObservation newElement = UMLFactory.eINSTANCE.createDurationObservation();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Package qualifiedTarget = (Package)target;
+ qualifiedTarget.getPackagedElements().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class DurationObservationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final DurationObservation newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(DurationObservation 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java
index f78653354c1..72727a3677f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public FullLifelineCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public FullLifelineCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static FullLifelineCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new FullLifelineCreateCommandCN(req, eObject);
+ public static FullLifelineCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new FullLifelineCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public FullLifelineCreateCommandCN(final CreateElementRequest req) {
+ public FullLifelineCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getLifeline());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
-
- final Interaction owner = (Interaction)getElementToEdit();
- owner.getLifelines().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Interaction qualifiedTarget = (Interaction)target;
+ qualifiedTarget.getLifelines().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class FullLifelineCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final Lifeline newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Lifeline 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java
index 826afe40125..d81c83f8c05 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.StateInvariant;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public FullStateInvariantCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public FullStateInvariantCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static FullStateInvariantCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new FullStateInvariantCreateCommandCN(req, eObject);
+ public static FullStateInvariantCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new FullStateInvariantCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public FullStateInvariantCreateCommandCN(final CreateElementRequest req) {
+ public FullStateInvariantCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getStateInvariant());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final StateInvariant newElement = UMLFactory.eINSTANCE.createStateInvariant();
-
- final Lifeline owner = (Lifeline)getElementToEdit();
- owner.getCoveredBys().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ StateInvariant newElement = UMLFactory.eINSTANCE.createStateInvariant();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Lifeline qualifiedTarget = (Lifeline)target;
+ qualifiedTarget.getCoveredBys().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class FullStateInvariantCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final StateInvariant newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(StateInvariant 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java
index 05e166feb32..08ed60c03c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Gate;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class GateCreateCommand extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class GateCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public GateCreateCommand(final CreateElementRequest req, final EObject eObject) {
+ public GateCreateCommand(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static GateCreateCommand create(final CreateElementRequest req, final EObject eObject) {
- return new GateCreateCommand(req, eObject);
+ public static GateCreateCommand create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new GateCreateCommand(req, eObject, diagram);
}
/**
* @generated
*/
- public GateCreateCommand(final CreateElementRequest req) {
+ public GateCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class GateCreateCommand extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class GateCreateCommand extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class GateCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getGate());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final Gate newElement = UMLFactory.eINSTANCE.createGate();
-
- final Interaction owner = (Interaction)getElementToEdit();
- owner.getFormalGates().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Gate newElement = UMLFactory.eINSTANCE.createGate();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Interaction qualifiedTarget = (Interaction)target;
+ qualifiedTarget.getFormalGates().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class GateCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final Gate newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Gate 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java
index c6687a706c4..85109f8e4aa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.GeneralOrdering;
import org.eclipse.uml2.uml.InteractionFragment;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public GeneralOrderingCreateCommand(final CreateElementRequest req, final EObject eObject) {
+ public GeneralOrderingCreateCommand(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static GeneralOrderingCreateCommand create(final CreateElementRequest req, final EObject eObject) {
- return new GeneralOrderingCreateCommand(req, eObject);
+ public static GeneralOrderingCreateCommand create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new GeneralOrderingCreateCommand(req, eObject, diagram);
}
/**
* @generated
*/
- public GeneralOrderingCreateCommand(final CreateElementRequest req) {
+ public GeneralOrderingCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getGeneralOrdering());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final GeneralOrdering newElement = UMLFactory.eINSTANCE.createGeneralOrdering();
-
- final InteractionFragment owner = (InteractionFragment)getElementToEdit();
- owner.getGeneralOrderings().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ GeneralOrdering newElement = UMLFactory.eINSTANCE.createGeneralOrdering();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ InteractionFragment qualifiedTarget = (InteractionFragment)target;
+ qualifiedTarget.getGeneralOrderings().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final GeneralOrdering newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(GeneralOrdering 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java
index 53d109e7c8d..27ef67539e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class InteractionCreateCommandTN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class InteractionCreateCommandTN extends EditElementCommand {
/**
* @generated
*/
- public InteractionCreateCommandTN(final CreateElementRequest req, final EObject eObject) {
+ public InteractionCreateCommandTN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static InteractionCreateCommandTN create(final CreateElementRequest req, final EObject eObject) {
- return new InteractionCreateCommandTN(req, eObject);
+ public static InteractionCreateCommandTN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new InteractionCreateCommandTN(req, eObject, diagram);
}
/**
* @generated
*/
- public InteractionCreateCommandTN(final CreateElementRequest req) {
+ public InteractionCreateCommandTN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class InteractionCreateCommandTN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class InteractionCreateCommandTN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class InteractionCreateCommandTN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getInteraction());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final Interaction newElement = UMLFactory.eINSTANCE.createInteraction();
-
- final Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Interaction newElement = UMLFactory.eINSTANCE.createInteraction();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Package qualifiedTarget = (Package)target;
+ qualifiedTarget.getPackagedElements().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class InteractionCreateCommandTN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final Interaction newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Interaction 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java
index a159897c518..889ac8ba3b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public LifelineCreateCommand(final CreateElementRequest req, final EObject eObject) {
+ public LifelineCreateCommand(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static LifelineCreateCommand create(final CreateElementRequest req, final EObject eObject) {
- return new LifelineCreateCommand(req, eObject);
+ public static LifelineCreateCommand create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new LifelineCreateCommand(req, eObject, diagram);
}
/**
* @generated
*/
- public LifelineCreateCommand(final CreateElementRequest req) {
+ public LifelineCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class LifelineCreateCommand extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class LifelineCreateCommand extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class LifelineCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getLifeline());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
-
- final Interaction owner = (Interaction)getElementToEdit();
- owner.getLifelines().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Interaction qualifiedTarget = (Interaction)target;
+ qualifiedTarget.getLifelines().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final Lifeline newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Lifeline 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java
index 78589b26a75..59d3139b082 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageAsyncCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageAsyncCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,32 +85,30 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
- final Message newElement = UMLFactory.eINSTANCE.createMessage();
+ Message newElement = UMLFactory.eINSTANCE.createMessage();
getContainer().getMessages().add(newElement);
newElement.setReceiveEvent(getSource());
newElement.setSendEvent(getTarget());
doConfigure(newElement, monitor, info);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -120,7 +118,7 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -128,21 +126,21 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -151,7 +149,7 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -162,5 +160,4 @@ public class MessageAsyncCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java
index 86356c91650..7d6f32c1b5f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java
@@ -46,11 +46,11 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageAsyncReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageAsyncReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -61,10 +61,10 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -74,14 +74,14 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4(container, getLink(), getNewSource(), target);
}
@@ -89,14 +89,14 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4(container, getLink(), source, getNewTarget());
}
@@ -104,14 +104,14 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageAsyncReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java
index 3d2fa0b3873..55c4303dad2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageCreateCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageCreateCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageCreateCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageCreateCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,32 +85,30 @@ public class MessageCreateCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
- final Message newElement = UMLFactory.eINSTANCE.createMessage();
+ Message newElement = UMLFactory.eINSTANCE.createMessage();
getContainer().getMessages().add(newElement);
newElement.setReceiveEvent(getSource());
newElement.setSendEvent(getTarget());
doConfigure(newElement, monitor, info);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -120,7 +118,7 @@ public class MessageCreateCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -128,21 +126,21 @@ public class MessageCreateCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -151,7 +149,7 @@ public class MessageCreateCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -162,5 +160,4 @@ public class MessageCreateCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java
index 094de7eaf39..2dd2c8c841d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java
@@ -46,11 +46,11 @@ public class MessageCreateReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageCreateReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageCreateReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -61,10 +61,10 @@ public class MessageCreateReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -74,14 +74,14 @@ public class MessageCreateReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_44(container, getLink(), getNewSource(), target);
}
@@ -89,14 +89,14 @@ public class MessageCreateReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_44(container, getLink(), source, getNewTarget());
}
@@ -104,14 +104,14 @@ public class MessageCreateReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageCreateReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java
index f12ba33fe1c..d1824bc9452 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageDeleteCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageDeleteCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,32 +85,30 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
- final Message newElement = UMLFactory.eINSTANCE.createMessage();
+ Message newElement = UMLFactory.eINSTANCE.createMessage();
getContainer().getMessages().add(newElement);
newElement.setReceiveEvent(getSource());
newElement.setSendEvent(getTarget());
doConfigure(newElement, monitor, info);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -120,7 +118,7 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -128,21 +126,21 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -151,7 +149,7 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -162,5 +160,4 @@ public class MessageDeleteCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java
index c9aa11253db..5ac1f0980e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java
@@ -46,11 +46,11 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageDeleteReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageDeleteReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -61,10 +61,10 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -74,14 +74,14 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_47(container, getLink(), getNewSource(), target);
}
@@ -89,14 +89,14 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_47(container, getLink(), source, getNewTarget());
}
@@ -104,14 +104,14 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageDeleteReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java
index cf7fbd5ef33..cdfe7126943 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageFoundCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageFoundCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageFoundCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageFoundCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof Element) {
+ if(source != null && false == source instanceof Element) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,26 +85,24 @@ public class MessageFoundCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
throw new UnsupportedOperationException();
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -114,7 +112,7 @@ public class MessageFoundCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -122,21 +120,21 @@ public class MessageFoundCreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)this.source;
+ return (Element)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -145,7 +143,7 @@ public class MessageFoundCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -156,5 +154,4 @@ public class MessageFoundCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java
index 7addc368ffc..235759db847 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java
@@ -47,11 +47,11 @@ public class MessageFoundReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageFoundReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageFoundReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -62,10 +62,10 @@ public class MessageFoundReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,14 +75,14 @@ public class MessageFoundReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof Element && this.newEnd instanceof Element)) {
+ if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_53(container, getLink(), getNewSource(), target);
}
@@ -90,14 +90,14 @@ public class MessageFoundReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final Element source = getLink().getOwner();
+ Element source = getLink().getOwner();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_53(container, getLink(), source, getNewTarget());
}
@@ -105,14 +105,14 @@ public class MessageFoundReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageFoundReorientCommand extends EditElementCommand {
* @generated
*/
protected Element getOldSource() {
- return (Element)this.oldEnd;
+ return (Element)oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)this.newEnd;
+ return (Element)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java
index 21f904f6631..5b408f51625 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageLostCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageLostCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageLostCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageLostCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof Element) {
+ if(target != null && false == target instanceof Element) {
return false;
}
if(getSource() == null) {
@@ -85,26 +85,24 @@ public class MessageLostCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
throw new UnsupportedOperationException();
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -114,7 +112,7 @@ public class MessageLostCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -122,21 +120,21 @@ public class MessageLostCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)this.target;
+ return (Element)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -145,7 +143,7 @@ public class MessageLostCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -156,5 +154,4 @@ public class MessageLostCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java
index 5e189028828..cd0178a5571 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java
@@ -47,11 +47,11 @@ public class MessageLostReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageLostReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageLostReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -62,10 +62,10 @@ public class MessageLostReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,14 +75,14 @@ public class MessageLostReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final Element target = getLink().getOwner();
+ Element target = getLink().getOwner();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_50(container, getLink(), getNewSource(), target);
}
@@ -90,14 +90,14 @@ public class MessageLostReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof Element && this.newEnd instanceof Element)) {
+ if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_50(container, getLink(), source, getNewTarget());
}
@@ -105,14 +105,14 @@ public class MessageLostReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageLostReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)this.oldEnd;
+ return (Element)oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)this.newEnd;
+ return (Element)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java
index eef4db153e6..a978a12a420 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
/**
* @generated
*/
- public MessageOccurrenceSpecificationCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public MessageOccurrenceSpecificationCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static MessageOccurrenceSpecificationCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new MessageOccurrenceSpecificationCreateCommandCN(req, eObject);
+ public static MessageOccurrenceSpecificationCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new MessageOccurrenceSpecificationCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public MessageOccurrenceSpecificationCreateCommandCN(final CreateElementRequest req) {
+ public MessageOccurrenceSpecificationCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getMessageOccurrenceSpecification());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final MessageOccurrenceSpecification newElement = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
-
- final Lifeline owner = (Lifeline)getElementToEdit();
- owner.getCoveredBys().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ MessageOccurrenceSpecification newElement = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Lifeline qualifiedTarget = (Lifeline)target;
+ qualifiedTarget.getCoveredBys().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class MessageOccurrenceSpecificationCreateCommandCN extends EditElementCo
/**
* @generated
*/
- protected void doConfigure(final MessageOccurrenceSpecification newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(MessageOccurrenceSpecification 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java
index 105df89b331..13b3991b3b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageReplyCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageReplyCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageReplyCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageReplyCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,32 +85,30 @@ public class MessageReplyCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
- final Message newElement = UMLFactory.eINSTANCE.createMessage();
+ Message newElement = UMLFactory.eINSTANCE.createMessage();
getContainer().getMessages().add(newElement);
newElement.setReceiveEvent(getSource());
newElement.setSendEvent(getTarget());
doConfigure(newElement, monitor, info);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -120,7 +118,7 @@ public class MessageReplyCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -128,21 +126,21 @@ public class MessageReplyCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -151,7 +149,7 @@ public class MessageReplyCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -162,5 +160,4 @@ public class MessageReplyCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java
index 5d46893aa93..18643d8c709 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java
@@ -46,11 +46,11 @@ public class MessageReplyReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageReplyReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageReplyReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -61,10 +61,10 @@ public class MessageReplyReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -74,14 +74,14 @@ public class MessageReplyReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_41(container, getLink(), getNewSource(), target);
}
@@ -89,14 +89,14 @@ public class MessageReplyReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_41(container, getLink(), source, getNewTarget());
}
@@ -104,14 +104,14 @@ public class MessageReplyReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageReplyReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java
index 53a3e14e881..569bafd41ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java
@@ -50,11 +50,11 @@ public class MessageSyncCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageSyncCreateCommand(final CreateRelationshipRequest request, final EObject source, final EObject target) {
+ public MessageSyncCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request.getLabel(), null, request);
this.source = source;
this.target = target;
- this.container = deduceContainer(source, target);
+ container = deduceContainer(source, target);
}
/**
@@ -62,13 +62,13 @@ public class MessageSyncCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
- if(this.source == null && this.target == null) {
+ if(source == null && target == null) {
return false;
}
- if(this.source != null && false == this.source instanceof MessageEnd) {
+ if(source != null && false == source instanceof MessageEnd) {
return false;
}
- if(this.target != null && false == this.target instanceof MessageEnd) {
+ if(target != null && false == target instanceof MessageEnd) {
return false;
}
if(getSource() == null) {
@@ -85,32 +85,30 @@ public class MessageSyncCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
-
- final Message newElement = UMLFactory.eINSTANCE.createMessage();
+ Message newElement = UMLFactory.eINSTANCE.createMessage();
getContainer().getMessages().add(newElement);
newElement.setReceiveEvent(getSource());
newElement.setSendEvent(getTarget());
doConfigure(newElement, monitor, info);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
-
}
/**
* @generated
*/
- protected void doConfigure(final Message newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(Message 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
@@ -120,7 +118,7 @@ public class MessageSyncCreateCommand extends EditElementCommand {
* @generated
*/
@Override
- protected void setElementToEdit(final EObject element) {
+ protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -128,21 +126,21 @@ public class MessageSyncCreateCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getSource() {
- return (MessageEnd)this.source;
+ return (MessageEnd)source;
}
/**
* @generated
*/
protected MessageEnd getTarget() {
- return (MessageEnd)this.target;
+ return (MessageEnd)target;
}
/**
* @generated
*/
public Interaction getContainer() {
- return this.container;
+ return container;
}
/**
@@ -151,7 +149,7 @@ public class MessageSyncCreateCommand extends EditElementCommand {
*
* @generated
*/
- protected Interaction deduceContainer(final EObject source, final EObject target) {
+ protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
@@ -162,5 +160,4 @@ public class MessageSyncCreateCommand extends EditElementCommand {
}
return null;
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java
index 0b540068711..845d99634ec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java
@@ -46,11 +46,11 @@ public class MessageSyncReorientCommand extends EditElementCommand {
/**
* @generated
*/
- public MessageSyncReorientCommand(final ReorientRelationshipRequest request) {
+ public MessageSyncReorientCommand(ReorientRelationshipRequest request) {
super(request.getLabel(), request.getRelationship(), request);
- this.reorientDirection = request.getDirection();
- this.oldEnd = request.getOldRelationshipEnd();
- this.newEnd = request.getNewRelationshipEnd();
+ reorientDirection = request.getDirection();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
}
/**
@@ -61,10 +61,10 @@ public class MessageSyncReorientCommand extends EditElementCommand {
if(false == getElementToEdit() instanceof Message) {
return false;
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -74,14 +74,14 @@ public class MessageSyncReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd target = getLink().getSendEvent();
+ MessageEnd target = getLink().getSendEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_3(container, getLink(), getNewSource(), target);
}
@@ -89,14 +89,14 @@ public class MessageSyncReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(this.oldEnd instanceof MessageEnd && this.newEnd instanceof MessageEnd)) {
+ if(!(oldEnd instanceof MessageEnd && newEnd instanceof MessageEnd)) {
return false;
}
- final MessageEnd source = getLink().getReceiveEvent();
+ MessageEnd source = getLink().getReceiveEvent();
if(!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- final Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction)getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_3(container, getLink(), source, getNewTarget());
}
@@ -104,14 +104,14 @@ public class MessageSyncReorientCommand extends EditElementCommand {
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(this.reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -144,27 +144,27 @@ public class MessageSyncReorientCommand extends EditElementCommand {
* @generated
*/
protected MessageEnd getOldSource() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewSource() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
/**
* @generated
*/
protected MessageEnd getOldTarget() {
- return (MessageEnd)this.oldEnd;
+ return (MessageEnd)oldEnd;
}
/**
* @generated
*/
protected MessageEnd getNewTarget() {
- return (MessageEnd)this.newEnd;
+ return (MessageEnd)newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java
index f195ed5984c..4e489cf1e00 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- public OccurrenceSpecificationCreateCommandCN(final CreateElementRequest req, final EObject eObject) {
+ public OccurrenceSpecificationCreateCommandCN(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static OccurrenceSpecificationCreateCommandCN create(final CreateElementRequest req, final EObject eObject) {
- return new OccurrenceSpecificationCreateCommandCN(req, eObject);
+ public static OccurrenceSpecificationCreateCommandCN create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new OccurrenceSpecificationCreateCommandCN(req, eObject, diagram);
}
/**
* @generated
*/
- public OccurrenceSpecificationCreateCommandCN(final CreateElementRequest req) {
+ public OccurrenceSpecificationCreateCommandCN(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getOccurrenceSpecification());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final OccurrenceSpecification newElement = UMLFactory.eINSTANCE.createOccurrenceSpecification();
-
- final Lifeline owner = (Lifeline)getElementToEdit();
- owner.getCoveredBys().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ OccurrenceSpecification newElement = UMLFactory.eINSTANCE.createOccurrenceSpecification();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Lifeline qualifiedTarget = (Lifeline)target;
+ qualifiedTarget.getCoveredBys().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class OccurrenceSpecificationCreateCommandCN extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final OccurrenceSpecification newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(OccurrenceSpecification 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java
index ea4deda222b..c7aaf9e9588 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.TimeConstraint;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public TimeConstraintCreateCommand(final CreateElementRequest req, final EObject eObject) {
+ public TimeConstraintCreateCommand(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static TimeConstraintCreateCommand create(final CreateElementRequest req, final EObject eObject) {
- return new TimeConstraintCreateCommand(req, eObject);
+ public static TimeConstraintCreateCommand create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new TimeConstraintCreateCommand(req, eObject, diagram);
}
/**
* @generated
*/
- public TimeConstraintCreateCommand(final CreateElementRequest req) {
+ public TimeConstraintCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getTimeConstraint());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final TimeConstraint newElement = UMLFactory.eINSTANCE.createTimeConstraint();
-
- final Namespace owner = (Namespace)getElementToEdit();
- owner.getOwnedRules().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ TimeConstraint newElement = UMLFactory.eINSTANCE.createTimeConstraint();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Namespace qualifiedTarget = (Namespace)target;
+ qualifiedTarget.getOwnedRules().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final TimeConstraint newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(TimeConstraint 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java
index ccfa5cf2276..6e3346163b6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java
@@ -19,10 +19,14 @@ 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.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.TimeObservation;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -34,7 +38,7 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
- private EClass eClass = null;
+ private Diagram diagram = null;
/**
* @generated
@@ -44,24 +48,25 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
- public TimeObservationCreateCommand(final CreateElementRequest req, final EObject eObject) {
+ public TimeObservationCreateCommand(CreateElementRequest req, EObject eObject, Diagram diagram) {
super(req.getLabel(), null, req);
this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
+ this.diagram = diagram;
}
/**
* @generated
*/
- public static TimeObservationCreateCommand create(final CreateElementRequest req, final EObject eObject) {
- return new TimeObservationCreateCommand(req, eObject);
+ public static TimeObservationCreateCommand create(CreateElementRequest req, EObject eObject, Diagram diagram) {
+ return new TimeObservationCreateCommand(req, eObject, diagram);
}
/**
* @generated
*/
- public TimeObservationCreateCommand(final CreateElementRequest req) {
+ public TimeObservationCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req.getLabel(), null, req);
+ this.diagram = diagram;
}
/**
@@ -71,7 +76,6 @@ public class TimeObservationCreateCommand extends EditElementCommand {
*/
@Override
protected EObject getElementToEdit() {
-
EObject container = ((CreateElementRequest)getRequest()).getContainer();
if(container instanceof View) {
container = ((View)container).getElement();
@@ -79,7 +83,7 @@ public class TimeObservationCreateCommand extends EditElementCommand {
if(container != null) {
return container;
}
- return this.eObject;
+ return eObject;
}
/**
@@ -87,24 +91,31 @@ public class TimeObservationCreateCommand extends EditElementCommand {
*/
@Override
public boolean canExecute() {
-
- return true;
-
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getTimeObservation());
+ return data.isPermitted();
}
/**
* @generated
*/
@Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
-
- final TimeObservation newElement = UMLFactory.eINSTANCE.createTimeObservation();
-
- final Package owner = (Package)getElementToEdit();
- owner.getPackagedElements().add(newElement);
-
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ TimeObservation newElement = UMLFactory.eINSTANCE.createTimeObservation();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ } else {
+ Package qualifiedTarget = (Package)target;
+ qualifiedTarget.getPackagedElements().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
+ }
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -112,15 +123,14 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected void doConfigure(final TimeObservation newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
- final ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ protected void doConfigure(TimeObservation 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());
- final ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
if(configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java
index b591034abdd..d6b6150cf1c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java
@@ -13,6 +13,7 @@ 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.timing.edit.commands.CompactStateInvariantCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.DestructionOccurrenceSpecificationCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.DurationConstraintCreateCommandCN;
@@ -42,8 +43,8 @@ public class CompactLifelineCompartmentItemSemanticEditPolicyCN extends UMLBaseI
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -54,8 +55,7 @@ public class CompactLifelineCompartmentItemSemanticEditPolicyCN extends UMLBaseI
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.
+ // 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;
}
@@ -64,57 +64,56 @@ public class CompactLifelineCompartmentItemSemanticEditPolicyCN extends UMLBaseI
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new CompactStateInvariantCreateCommandCN(req));
+ return getGEFWrapper(new CompactStateInvariantCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.OccurrenceSpecification_12 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new OccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new OccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.MessageOccurrenceSpecification_13 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new MessageOccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new MessageOccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DestructionOccurrenceSpecification_27 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DestructionOccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new DestructionOccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DurationConstraint_18 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DurationConstraintCreateCommandCN(req));
+ return getGEFWrapper(new DurationConstraintCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DurationObservation_17 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DurationObservationCreateCommandCN(req));
+ return getGEFWrapper(new DurationObservationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TimeConstraint_15 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new TimeConstraintCreateCommand(req));
+ return getGEFWrapper(new TimeConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TimeObservation_16 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new TimeObservationCreateCommand(req));
+ return getGEFWrapper(new TimeObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.GeneralOrdering_67 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new GeneralOrderingCreateCommand(req));
+ return getGEFWrapper(new GeneralOrderingCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java
index 35430e90f2d..d511667691c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class CompactLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemantic
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
index 75528f51e37..67674586c5c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
@@ -33,8 +33,8 @@ public class CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN extends
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -45,13 +45,11 @@ public class CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN extends
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.
+ // 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;
}
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java
index 34cf94b472e..e6245ba1791 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class CompactStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSe
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java
index 54131bcc319..bd48a03cfc1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java
@@ -62,13 +62,12 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -80,16 +79,16 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -100,8 +99,7 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
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.
+ // 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;
}
@@ -154,8 +152,8 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -166,8 +164,7 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
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.
+ // 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;
}
@@ -224,7 +221,7 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageSyncEditPart.VISUAL_ID:
return getGEFWrapper(new MessageSyncReorientCommand(req));
@@ -243,5 +240,4 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicyCN extends
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java
index d1b48b72954..6704305bfd5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class DurationConstraintItemSemanticEditPolicyCN extends UMLBaseItemSeman
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java
index 93cca0e6d66..bb0d2900ab1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class DurationObservationItemSemanticEditPolicyCN extends UMLBaseItemSema
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java
index fdbdd05ba22..3492ae2d96c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class FullLifelineItemSemanticEditPolicyCN extends UMLBaseItemSemanticEdi
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java
index 340edfbf3fa..e519a13860f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java
@@ -33,8 +33,8 @@ public class FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN exte
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -45,13 +45,11 @@ public class FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN exte
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.
+ // 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;
}
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
index 71294a04fc9..7c715eea807 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java
@@ -33,8 +33,8 @@ public class FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN extends UM
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -45,13 +45,11 @@ public class FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN extends UM
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.
+ // 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;
}
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
index 8ea077efd8f..6ea609ee11f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
@@ -13,6 +13,7 @@ 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.timing.edit.commands.DestructionOccurrenceSpecificationCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.DurationConstraintCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.DurationObservationCreateCommandCN;
@@ -42,8 +43,8 @@ public class FullLifelineTimelineCompartmentItemSemanticEditPolicyCN extends UML
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -54,8 +55,7 @@ public class FullLifelineTimelineCompartmentItemSemanticEditPolicyCN extends UML
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.
+ // 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;
}
@@ -64,57 +64,56 @@ public class FullLifelineTimelineCompartmentItemSemanticEditPolicyCN extends UML
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new FullStateInvariantCreateCommandCN(req));
+ return getGEFWrapper(new FullStateInvariantCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.OccurrenceSpecification_12 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new OccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new OccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.MessageOccurrenceSpecification_13 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new MessageOccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new MessageOccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DestructionOccurrenceSpecification_27 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DestructionOccurrenceSpecificationCreateCommandCN(req));
+ return getGEFWrapper(new DestructionOccurrenceSpecificationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DurationConstraint_18 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DurationConstraintCreateCommandCN(req));
+ return getGEFWrapper(new DurationConstraintCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.DurationObservation_17 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new DurationObservationCreateCommandCN(req));
+ return getGEFWrapper(new DurationObservationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TimeConstraint_15 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new TimeConstraintCreateCommand(req));
+ return getGEFWrapper(new TimeConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TimeObservation_16 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new TimeObservationCreateCommand(req));
+ return getGEFWrapper(new TimeObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.GeneralOrdering_67 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new GeneralOrderingCreateCommand(req));
+ return getGEFWrapper(new GeneralOrderingCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java
index 19b2c6a2450..6f17fc0a148 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class FullStateInvariantItemSemanticEditPolicyCN extends UMLBaseItemSeman
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java
index e190f061e29..c56d2b1a8b6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java
@@ -62,13 +62,12 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -80,16 +79,16 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -100,8 +99,7 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
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.
+ // 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;
}
@@ -154,8 +152,8 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -166,8 +164,7 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
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.
+ // 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;
}
@@ -224,7 +221,7 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageSyncEditPart.VISUAL_ID:
return getGEFWrapper(new MessageSyncReorientCommand(req));
@@ -243,5 +240,4 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
index ed3cbe1fc87..b48b1468880 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java
index 69ab0662cdd..97657b54fca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java
@@ -13,6 +13,7 @@ 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.timing.edit.commands.CompactLifelineCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.FullLifelineCreateCommandCN;
import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
@@ -35,8 +36,8 @@ public class InteractionCompartmentItemSemanticEditPolicyTN extends UMLBaseItemS
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -47,8 +48,7 @@ public class InteractionCompartmentItemSemanticEditPolicyTN extends UMLBaseItemS
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.
+ // 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;
}
@@ -57,15 +57,14 @@ public class InteractionCompartmentItemSemanticEditPolicyTN extends UMLBaseItemS
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new FullLifelineCreateCommandCN(req));
+ return getGEFWrapper(new FullLifelineCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.Lifeline_20 == baseElementType) {
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new CompactLifelineCreateCommandCN(req));
+ return getGEFWrapper(new CompactLifelineCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java
index 8cac636666b..951e7cbe0fa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java
@@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
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.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.GateCreateCommand;
@@ -49,8 +50,8 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -61,8 +62,7 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
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.
+ // 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;
}
@@ -71,7 +71,7 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new GateCreateCommand(req));
+ return getGEFWrapper(new GateCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
@@ -80,13 +80,12 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -98,16 +97,16 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +117,7 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
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.
+ // 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;
}
@@ -139,8 +137,8 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -151,8 +149,7 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
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.
+ // 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;
}
@@ -176,7 +173,7 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -185,5 +182,4 @@ public class InteractionNodeItemSemanticEditPolicyTN extends UMLBaseItemSemantic
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java
index 7ae3dc0af57..b220587bea3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java
index c21cdaac003..8be6b8c5405 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageAsyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java
index 045509d391d..6b5ae8ebec7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageCreateItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java
index aa34ce1db35..4a66baa1d11 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageDeleteItemSemanticEditPolicy extends UMLBaseItemSemanticEdit
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java
index 545da71153f..b66876f0a6c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageFoundItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java
index 2db6c1a129c..8122664ee02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageLostItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java
index b208e5ef77d..1eb64daf1de 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java
@@ -62,13 +62,12 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -80,16 +79,16 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -100,8 +99,7 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
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.
+ // 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;
}
@@ -154,8 +152,8 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -166,8 +164,7 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
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.
+ // 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;
}
@@ -224,7 +221,7 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageSyncEditPart.VISUAL_ID:
return getGEFWrapper(new MessageSyncReorientCommand(req));
@@ -243,5 +240,4 @@ public class MessageOccurrenceSpecificationItemSemanticEditPolicyCN extends UMLB
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java
index dd1493ea725..9d954226292 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageReplyItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java
index dd20f687f39..110751085f6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class MessageSyncItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java
index 96f23dfc1ca..b005705e735 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java
@@ -47,13 +47,12 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class OccurrenceSpecificationItemSemanticEditPolicyCN extends UMLBaseItem
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java
index 6a780ca14b0..eb03a240084 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java
index 1efd5463cc4..0bff4374b8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java
@@ -47,13 +47,12 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
- final EObject selectedEObject = req.getElementToDestroy();
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
if(provider != null) {
// Retrieve delete command from the Element Edit service
- final ICommand deleteCommand = provider.getEditCommand(req);
-
+ ICommand deleteCommand = provider.getEditCommand(req);
if(deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
@@ -65,16 +64,16 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
}
/**
* @generated
*/
- protected Command getStartCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -85,8 +84,7 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
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.
+ // 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;
}
@@ -106,8 +104,8 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* @generated
*/
- protected Command getCompleteCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return null;
}
@@ -118,8 +116,7 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
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.
+ // 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;
}
@@ -143,7 +140,7 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
* @generated
*/
@Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
switch(getVisualID(req)) {
case MessageLostEditPart.VISUAL_ID:
return getGEFWrapper(new MessageLostReorientCommand(req));
@@ -152,5 +149,4 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
}
return super.getReorientRelationshipCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java
index ca41ca53b9d..786d6f8d57a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java
@@ -33,8 +33,8 @@ public class TimeRulerCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSem
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -45,13 +45,11 @@ public class TimeRulerCompartmentItemSemanticEditPolicyCN extends UMLBaseItemSem
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.
+ // 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;
}
}
return super.getCreateCommand(req);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java
index 82de5aedcc9..faf71de7429 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
import org.eclipse.gmf.runtime.notation.Diagram;
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.common.commands.DuplicateNamedElementCommand;
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.InteractionCreateCommandTN;
import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
@@ -39,8 +40,8 @@ public class TimingDiagramEditPartFactoryItemSemanticEditPolicy extends UMLBaseI
* @generated
*/
@Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
+ protected Command getCreateCommand(CreateElementRequest req) {
+ IElementType requestElementType = req.getElementType();
if(requestElementType == null) {
return super.getCreateCommand(req);
}
@@ -51,8 +52,7 @@ public class TimingDiagramEditPartFactoryItemSemanticEditPolicy extends UMLBaseI
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.
+ // 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;
}
@@ -61,7 +61,7 @@ public class TimingDiagramEditPartFactoryItemSemanticEditPolicy extends UMLBaseI
if(isExtendedType) {
return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
}
- return getGEFWrapper(new InteractionCreateCommandTN(req));
+ return getGEFWrapper(new InteractionCreateCommandTN(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
@@ -70,8 +70,8 @@ public class TimingDiagramEditPartFactoryItemSemanticEditPolicy extends UMLBaseI
* @generated
*/
@Override
- protected Command getDuplicateCommand(final DuplicateElementsRequest req) {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ protected Command getDuplicateCommand(DuplicateElementsRequest req) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
Diagram currentDiagram = null;
if(getHost() instanceof IGraphicalEditPart) {
currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
@@ -87,15 +87,14 @@ public class TimingDiagramEditPartFactoryItemSemanticEditPolicy extends UMLBaseI
/**
* @generated
*/
- private final Diagram diagram;
+ private Diagram diagram;
/**
* @generated
*/
- public DuplicateAnythingCommand(final TransactionalEditingDomain editingDomain, final DuplicateElementsRequest req, final Diagram currentDiagram) {
+ public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap(), currentDiagram);
this.diagram = currentDiagram;
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 0387a764619..cd6ebf02c73 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -81,8 +81,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected UMLBaseItemSemanticEditPolicy(final IElementType elementType) {
- this.myElementType = elementType;
+ protected UMLBaseItemSemanticEditPolicy(IElementType elementType) {
+ myElementType = elementType;
}
/**
@@ -96,13 +96,13 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
@Override
@SuppressWarnings("unchecked")
- public Command getCommand(final Request request) {
+ public Command getCommand(Request request) {
if(request instanceof ReconnectRequest) {
- final Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
+ Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
if(view instanceof View) {
- final Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
+ Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view);
+ request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
}
}
return super.getCommand(request);
@@ -113,8 +113,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*
* @generated
*/
- protected int getVisualID(final IEditCommandRequest request) {
- final Object id = request.getParameter(VISUAL_ID_KEY);
+ protected int getVisualID(IEditCommandRequest request) {
+ Object id = request.getParameter(VISUAL_ID_KEY);
return id instanceof Integer ? ((Integer)id).intValue() : -1;
}
@@ -122,12 +122,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
@Override
- protected Command getSemanticCommand(final IEditCommandRequest request) {
- final IEditCommandRequest completedRequest = completeRequest(request);
+ protected Command getSemanticCommand(IEditCommandRequest request) {
+ IEditCommandRequest completedRequest = completeRequest(request);
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
if(completedRequest instanceof DestroyRequest) {
- final DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
+ DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
}
return semanticCommand;
@@ -136,20 +136,20 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command addDeleteViewCommand(final Command mainCommand, final DestroyRequest completedRequest) {
- final Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
+ protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
}
/**
* @generated
*/
- private Command getEditHelperCommand(final IEditCommandRequest request, final Command editPolicyCommand) {
+ private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
if(editPolicyCommand != null) {
- final ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
+ ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command);
}
- final IElementType requestContextElementType = getContextElementType(request);
+ IElementType requestContextElementType = getContextElementType(request);
request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, requestContextElementType);
ICommand command = requestContextElementType.getEditCommand(request);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null);
@@ -166,15 +166,15 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected IElementType getContextElementType(final IEditCommandRequest request) {
- final IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : this.myElementType;
+ protected IElementType getContextElementType(IEditCommandRequest request) {
+ IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
+ return requestContextElementType != null ? requestContextElementType : myElementType;
}
/**
* @generated
*/
- protected Command getSemanticCommandSwitch(final IEditCommandRequest req) {
+ protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
if(req instanceof CreateRelationshipRequest) {
return getCreateRelationshipCommand((CreateRelationshipRequest)req);
} else if(req instanceof CreateElementRequest) {
@@ -204,22 +204,22 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getConfigureCommand(final ConfigureRequest req) {
+ protected Command getConfigureCommand(ConfigureRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getCreateCommand(final CreateElementRequest req) {
- // no more usage of the extended types here.
+ protected Command getCreateCommand(CreateElementRequest req) {
+ // no more usage of the extended types here.
return null;
}
@@ -227,39 +227,39 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getExtendedTypeCreationCommand(final CreateElementRequest request, final IExtendedHintedElementType requestElementType) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getContainer());
+ protected Command getExtendedTypeCreationCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getContainer());
if(provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
- final ICommand createGMFCommand = provider.getEditCommand(request);
+ ICommand createGMFCommand = provider.getEditCommand(request);
return getGEFWrapper(createGMFCommand);
}
/**
* @generated
*/
- protected Command getExtendedStartCreateRelationshipCommand(final CreateElementRequest request, final IExtendedHintedElementType requestElementType) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
+ protected Command getExtendedStartCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
if(provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
- final ICommand createGMFCommand = provider.getEditCommand(request);
+ ICommand createGMFCommand = provider.getEditCommand(request);
return getGEFWrapper(createGMFCommand);
}
/**
* @generated
*/
- protected Command getExtendedCompleteCreateRelationshipCommand(final CreateElementRequest request, final IExtendedHintedElementType requestElementType) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
+ protected Command getExtendedCompleteCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
if(provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
- final ICommand createGMFCommand = provider.getEditCommand(request);
+ ICommand createGMFCommand = provider.getEditCommand(request);
return getGEFWrapper(createGMFCommand);
}
@@ -267,48 +267,47 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getSetCommand(final SetRequest req) {
+ protected Command getSetCommand(SetRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getEditContextCommand(final GetEditContextRequest req) {
+ protected Command getEditContextCommand(GetEditContextRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getDestroyElementCommand(final DestroyElementRequest req) {
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getDestroyReferenceCommand(final DestroyReferenceRequest req) {
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getDuplicateCommand(final DuplicateElementsRequest req) {
+ protected Command getDuplicateCommand(DuplicateElementsRequest req) {
return null;
}
/**
* @generated
*/
- protected Command getMoveCommand(final MoveRequest req) {
-
- final EObject targetCEObject = req.getTargetContainer();
+ protected Command getMoveCommand(MoveRequest req) {
+ EObject targetCEObject = req.getTargetContainer();
if(targetCEObject != null) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
if(provider != null) {
- final ICommand moveCommand = provider.getEditCommand(req);
+ ICommand moveCommand = provider.getEditCommand(req);
if(moveCommand != null) {
return new ICommandProxy(moveCommand);
}
@@ -317,27 +316,26 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
} else {
return getGEFWrapper(new MoveElementsCommand(req));
}
-
}
/**
* @generated
*/
- protected Command getReorientReferenceRelationshipCommand(final ReorientReferenceRelationshipRequest req) {
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
return UnexecutableCommand.INSTANCE;
}
/**
* @generated
*/
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
return UnexecutableCommand.INSTANCE;
}
/**
* @generated
*/
- protected final Command getGEFWrapper(final ICommand cmd) {
+ protected final Command getGEFWrapper(ICommand cmd) {
return new ICommandProxy(cmd);
}
@@ -355,10 +353,10 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*
* @generated
*/
- protected void addDestroyShortcutsCommand(final ICompositeCommand cmd, final View view) {
+ protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(final Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- final View nextView = (View)it.next();
+ for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
+ View nextView = (View)it.next();
if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
continue;
}
@@ -392,100 +390,99 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateMessage_3(final Interaction container, final MessageEnd source, final MessageEnd target) {
+ public boolean canCreateMessage_3(Interaction container, MessageEnd source, MessageEnd target) {
return canExistMessage_3(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_4(final Interaction container, final MessageEnd source, final MessageEnd target) {
+ public boolean canCreateMessage_4(Interaction container, MessageEnd source, MessageEnd target) {
return canExistMessage_4(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_41(final Interaction container, final MessageEnd source, final MessageEnd target) {
+ public boolean canCreateMessage_41(Interaction container, MessageEnd source, MessageEnd target) {
return canExistMessage_41(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_44(final Interaction container, final MessageEnd source, final MessageEnd target) {
+ public boolean canCreateMessage_44(Interaction container, MessageEnd source, MessageEnd target) {
return canExistMessage_44(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_47(final Interaction container, final MessageEnd source, final MessageEnd target) {
+ public boolean canCreateMessage_47(Interaction container, MessageEnd source, MessageEnd target) {
return canExistMessage_47(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_50(final Interaction container, final MessageEnd source, final Element target) {
+ public boolean canCreateMessage_50(Interaction container, MessageEnd source, Element target) {
return canExistMessage_50(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateMessage_53(final Interaction container, final Element source, final MessageEnd target) {
+ public boolean canCreateMessage_53(Interaction container, Element source, MessageEnd target) {
return canExistMessage_53(container, null, source, target);
}
/**
* @generated
*/
- public boolean canExistMessage_3(final Interaction container, final Message linkInstance, final MessageEnd source, final MessageEnd target) {
+ public boolean canExistMessage_3(Interaction container, Message linkInstance, MessageEnd source, MessageEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_4(final Interaction container, final Message linkInstance, final MessageEnd source, final MessageEnd target) {
+ public boolean canExistMessage_4(Interaction container, Message linkInstance, MessageEnd source, MessageEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_41(final Interaction container, final Message linkInstance, final MessageEnd source, final MessageEnd target) {
+ public boolean canExistMessage_41(Interaction container, Message linkInstance, MessageEnd source, MessageEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_44(final Interaction container, final Message linkInstance, final MessageEnd source, final MessageEnd target) {
+ public boolean canExistMessage_44(Interaction container, Message linkInstance, MessageEnd source, MessageEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_47(final Interaction container, final Message linkInstance, final MessageEnd source, final MessageEnd target) {
+ public boolean canExistMessage_47(Interaction container, Message linkInstance, MessageEnd source, MessageEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_50(final Interaction container, final Message linkInstance, final MessageEnd source, final Element target) {
+ public boolean canExistMessage_50(Interaction container, Message linkInstance, MessageEnd source, Element target) {
return true;
}
/**
* @generated
*/
- public boolean canExistMessage_53(final Interaction container, final Message linkInstance, final Element source, final MessageEnd target) {
+ public boolean canExistMessage_53(Interaction container, Message linkInstance, Element source, MessageEnd target) {
return true;
}
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java
index 80bcd5386fd..aa740184aa5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java
@@ -72,7 +72,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
hideSelection();
- addFeedback(this.selectionFeedbackFigure = createSelectionFeedbackFigure());
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
@@ -88,10 +88,10 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
((WrappingLabel)getHostFigure()).setSelected(false);
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
- if(this.selectionFeedbackFigure != null) {
- removeFeedback(this.selectionFeedbackFigure);
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
- this.selectionFeedbackFigure = null;
+ selectionFeedbackFigure = null;
}
hideFocus();
}
@@ -106,7 +106,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
((WrappingLabel)getHostFigure()).setFocus(true);
} else {
hideFocus();
- addFeedback(this.focusFeedbackFigure = createFocusFeedbackFigure());
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
refreshFocusFeedback();
}
}
@@ -119,9 +119,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
if(getHostFigure() instanceof WrappingLabel) {
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
- if(this.focusFeedbackFigure != null) {
- removeFeedback(this.focusFeedbackFigure);
- this.focusFeedbackFigure = null;
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
}
}
}
@@ -147,13 +147,13 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
*/
protected IFigure createSelectionFeedbackFigure() {
if(getHostFigure() instanceof Label) {
- final Label feedbackFigure = new Label();
+ Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
return feedbackFigure;
} else {
- final RectangleFigure feedbackFigure = new RectangleFigure();
+ RectangleFigure feedbackFigure = new RectangleFigure();
feedbackFigure.setFill(false);
return feedbackFigure;
}
@@ -165,8 +165,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
protected IFigure createFocusFeedbackFigure() {
return new Figure() {
- @Override
- protected void paintFigure(final Graphics graphics) {
+ protected void paintFigure(Graphics graphics) {
graphics.drawFocus(getBounds().getResized(-1, -1));
}
};
@@ -175,8 +174,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
- protected void updateLabel(final Label target) {
- final Label source = (Label)getHostFigure();
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -186,12 +185,12 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshSelectionFeedback() {
- if(this.selectionFeedbackFigure != null) {
- if(this.selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)this.selectionFeedbackFigure);
- this.selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
- this.selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
}
}
}
@@ -200,8 +199,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshFocusFeedback() {
- if(this.focusFeedbackFigure != null) {
- this.focusFeedbackFigure.setBounds(getFeedbackBounds());
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -217,15 +216,15 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
private FigureListener getHostPositionListener() {
- if(this.hostPositionListener == null) {
- this.hostPositionListener = new FigureListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
- public void figureMoved(final IFigure source) {
+ public void figureMoved(IFigure source) {
refreshFeedback();
}
};
}
- return this.hostPositionListener;
+ return hostPositionListener;
}
/**
@@ -233,10 +232,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
*/
@Override
protected List createSelectionHandles() {
- final MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
moveHandle.setBorder(null);
moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
return Collections.singletonList(moveHandle);
}
-
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java
index d9f06ea32da..7b2da04390d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java
@@ -66,7 +66,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
hideSelection();
- addFeedback(this.selectionFeedbackFigure = createSelectionFeedbackFigure());
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
@@ -82,10 +82,10 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
((WrappingLabel)getHostFigure()).setSelected(false);
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
- if(this.selectionFeedbackFigure != null) {
- removeFeedback(this.selectionFeedbackFigure);
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
- this.selectionFeedbackFigure = null;
+ selectionFeedbackFigure = null;
}
hideFocus();
}
@@ -100,7 +100,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
((WrappingLabel)getHostFigure()).setFocus(true);
} else {
hideFocus();
- addFeedback(this.focusFeedbackFigure = createFocusFeedbackFigure());
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
refreshFocusFeedback();
}
}
@@ -113,9 +113,9 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
if(getHostFigure() instanceof WrappingLabel) {
((WrappingLabel)getHostFigure()).setFocus(false);
} else {
- if(this.focusFeedbackFigure != null) {
- removeFeedback(this.focusFeedbackFigure);
- this.focusFeedbackFigure = null;
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
}
}
}
@@ -141,13 +141,13 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
*/
protected IFigure createSelectionFeedbackFigure() {
if(getHostFigure() instanceof Label) {
- final Label feedbackFigure = new Label();
+ Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
return feedbackFigure;
} else {
- final RectangleFigure feedbackFigure = new RectangleFigure();
+ RectangleFigure feedbackFigure = new RectangleFigure();
feedbackFigure.setFill(false);
return feedbackFigure;
}
@@ -159,8 +159,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
protected IFigure createFocusFeedbackFigure() {
return new Figure() {
- @Override
- protected void paintFigure(final Graphics graphics) {
+ protected void paintFigure(Graphics graphics) {
graphics.drawFocus(getBounds().getResized(-1, -1));
}
};
@@ -169,8 +168,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
- protected void updateLabel(final Label target) {
- final Label source = (Label)getHostFigure();
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -180,12 +179,12 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshSelectionFeedback() {
- if(this.selectionFeedbackFigure != null) {
- if(this.selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)this.selectionFeedbackFigure);
- this.selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
- this.selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
}
}
}
@@ -194,8 +193,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshFocusFeedback() {
- if(this.focusFeedbackFigure != null) {
- this.focusFeedbackFigure.setBounds(getFeedbackBounds());
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -211,15 +210,14 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
private FigureListener getHostPositionListener() {
- if(this.hostPositionListener == null) {
- this.hostPositionListener = new FigureListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
- public void figureMoved(final IFigure source) {
+ public void figureMoved(IFigure source) {
refreshFeedback();
}
};
}
- return this.hostPositionListener;
+ return hostPositionListener;
}
-
}

Back to the top