Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2010-02-12 13:37:09 +0000
committerytanguy2010-02-12 13:37:09 +0000
commit1ac87985ffd2e529b552e468cc5587a089d3c353 (patch)
tree752eeef4af05a646929d1aee490595d224829873 /plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java
parent8fe79488eba34885f0a2f855305969ec5e1d35de (diff)
downloadorg.eclipse.papyrus-1ac87985ffd2e529b552e468cc5587a089d3c353.tar.gz
org.eclipse.papyrus-1ac87985ffd2e529b552e468cc5587a089d3c353.tar.xz
org.eclipse.papyrus-1ac87985ffd2e529b552e468cc5587a089d3c353.zip
NEW - bug 302703: [Profile Diagram] Papyrus shall support profile diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=302703
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java')
-rw-r--r--plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java b/plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..ee997dfad80
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.diagram.profile/src/org/eclipse/papyrus/diagram/profile/edit/policies/DataTypeOperationItemSemanticEditPolicy.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.diagram.profile.edit.policies;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.profile.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class DataTypeOperationItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public DataTypeOperationItemSemanticEditPolicy() {
+ super(UMLElementTypes.Operation_3019);
+ }
+
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+}

Back to the top