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/commands/MessageCreateCreateCommand.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java35
1 files changed, 16 insertions, 19 deletions
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;
}
-
}

Back to the top