Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2011-11-02 10:20:42 +0000
committercletavernie2011-11-02 10:20:42 +0000
commit36bd3dc04d5a01179f676bcb0f14771987079360 (patch)
tree2649117b7fa20b812dc2a7bdabf6208bd6e929c2 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
parent322c3f17a0ba2419c976c10f4eae80f19e552ace (diff)
downloadorg.eclipse.papyrus-36bd3dc04d5a01179f676bcb0f14771987079360.tar.gz
org.eclipse.papyrus-36bd3dc04d5a01179f676bcb0f14771987079360.tar.xz
org.eclipse.papyrus-36bd3dc04d5a01179f676bcb0f14771987079360.zip
362162: [Architecture - Refactoring] The plug-ins should be renamed to match their layer's qualified name
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362162
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java63
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
new file mode 100644
index 00000000000..abe2cf574c5
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.diagram.clazz.custom.command;
+
+import java.util.ArrayList;
+
+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.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.diagram.clazz.custom.ui.TemplateParameterConfigurationDialog;
+import org.eclipse.papyrus.diagram.clazz.edit.commands.TemplateParameterCreateCommand;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.TemplateParameter;
+import org.eclipse.uml2.uml.TemplateSignature;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+
+
+public class CTemplateParameterCreateCommand extends TemplateParameterCreateCommand {
+
+ public CTemplateParameterCreateCommand(CreateElementRequest req) {
+ super(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ TemplateParameter newElement = UMLFactory.eINSTANCE.createTemplateParameter();
+
+ TemplateSignature owner = (TemplateSignature)getElementToEdit();
+ owner.getOwnedParameters().add(newElement);
+ TemplateSignature childHolder = (TemplateSignature)getElementToEdit();
+ childHolder.getParameters().add(newElement);
+ ArrayList<EClass> eclassnotWanted = new ArrayList<EClass>();
+ eclassnotWanted.add(UMLPackage.eINSTANCE.getClassifier());
+ eclassnotWanted.add(UMLPackage.eINSTANCE.getOperation());
+ eclassnotWanted.add(UMLPackage.eINSTANCE.getConnectableElement());
+ TemplateParameterConfigurationDialog configurationDialog = new TemplateParameterConfigurationDialog(new Shell(), SWT.APPLICATION_MODAL, UMLPackage.eINSTANCE.getPackageableElement(), eclassnotWanted);
+ configurationDialog.setOwner(childHolder);
+ configurationDialog.open();
+ newElement.setParameteredElement(configurationDialog.getParameterableElement());
+ newElement.setDefault(configurationDialog.getDefaultparameterableElement());
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+}

Back to the top