Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands')
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/AddStructuralFeatureValueActionCreateCommand.java126
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand.java130
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsValueCreateCommand.java130
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand.java130
4 files changed, 516 insertions, 0 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/AddStructuralFeatureValueActionCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/AddStructuralFeatureValueActionCreateCommand.java
new file mode 100644
index 00000000000..dddf91fccee
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/AddStructuralFeatureValueActionCreateCommand.java
@@ -0,0 +1,126 @@
+package org.eclipse.papyrus.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.ElementInitializers;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.AddStructuralFeatureValueAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class AddStructuralFeatureValueActionCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public AddStructuralFeatureValueActionCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static AddStructuralFeatureValueActionCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new AddStructuralFeatureValueActionCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public AddStructuralFeatureValueActionCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+
+
+ return true;
+
+
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+
+ AddStructuralFeatureValueAction newElement = UMLFactory.eINSTANCE.createAddStructuralFeatureValueAction();
+
+ Activity owner = (Activity)getElementToEdit();
+ owner.getNodes().add(newElement);
+
+
+ ElementInitializers.getInstance().init_AddStructuralFeatureValueAction_3091(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AddStructuralFeatureValueAction 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());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand.java
new file mode 100644
index 00000000000..0c3c8b8e801
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand.java
@@ -0,0 +1,130 @@
+package org.eclipse.papyrus.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.ElementInitializers;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.StructuralFeatureAction;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInAddStructuralFeatureValueActionAsObjectCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ StructuralFeatureAction container = (StructuralFeatureAction)getElementToEdit();
+ if(container.getObject() != null) {
+ return false;
+ }
+
+
+ return true;
+
+
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ StructuralFeatureAction owner = (StructuralFeatureAction)getElementToEdit();
+ owner.setObject(newElement);
+
+
+ ElementInitializers.getInstance().init_InputPin_3092(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin 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());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsValueCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsValueCreateCommand.java
new file mode 100644
index 00000000000..93744839038
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/InputPinInAddStructuralFeatureValueActionAsValueCreateCommand.java
@@ -0,0 +1,130 @@
+package org.eclipse.papyrus.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.ElementInitializers;
+import org.eclipse.uml2.uml.InputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.WriteStructuralFeatureAction;
+
+/**
+ * @generated
+ */
+public class InputPinInAddStructuralFeatureValueActionAsValueCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public InputPinInAddStructuralFeatureValueActionAsValueCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static InputPinInAddStructuralFeatureValueActionAsValueCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new InputPinInAddStructuralFeatureValueActionAsValueCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public InputPinInAddStructuralFeatureValueActionAsValueCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ WriteStructuralFeatureAction container = (WriteStructuralFeatureAction)getElementToEdit();
+ if(container.getValue() != null) {
+ return false;
+ }
+
+
+ return true;
+
+
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+
+ InputPin newElement = UMLFactory.eINSTANCE.createInputPin();
+
+ WriteStructuralFeatureAction owner = (WriteStructuralFeatureAction)getElementToEdit();
+ owner.setValue(newElement);
+
+
+ ElementInitializers.getInstance().init_InputPin_3093(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(InputPin 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());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand.java
new file mode 100644
index 00000000000..7a38a5cf9fa
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.activity/src/org/eclipse/papyrus/diagram/activity/edit/commands/OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand.java
@@ -0,0 +1,130 @@
+package org.eclipse.papyrus.diagram.activity.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.activity.providers.ElementInitializers;
+import org.eclipse.uml2.uml.OutputPin;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.WriteStructuralFeatureAction;
+
+/**
+ * @generated
+ */
+public class OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OutputPinInAddStructuralFeatureValueActionAsResultCreateCommand(CreateElementRequest req) {
+ super(req.getLabel(), null, req);
+ }
+
+ /**
+ * FIXME: replace with setElementToEdit()
+ *
+ * @generated
+ */
+ protected EObject getElementToEdit() {
+
+
+ EObject container = ((CreateElementRequest)getRequest()).getContainer();
+ if(container instanceof View) {
+ container = ((View)container).getElement();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ WriteStructuralFeatureAction container = (WriteStructuralFeatureAction)getElementToEdit();
+ if(container.getResult() != null) {
+ return false;
+ }
+
+
+ return true;
+
+
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+
+
+ OutputPin newElement = UMLFactory.eINSTANCE.createOutputPin();
+
+ WriteStructuralFeatureAction owner = (WriteStructuralFeatureAction)getElementToEdit();
+ owner.setResult(newElement);
+
+
+ ElementInitializers.getInstance().init_OutputPin_3094(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+
+
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(OutputPin 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());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if(configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
+ }
+
+}

Back to the top