Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java230
1 files changed, 73 insertions, 157 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java
index df2121f20ee..b053cc9eb0f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/policies/ProfileItemSemanticEditPolicyTN.java
@@ -1,16 +1,16 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
+/*
+ * Copyright (c) 2014 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.uml.diagram.profile.edit.policies;
import java.util.ArrayList;
@@ -91,6 +91,8 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
super(UMLElementTypes.Profile_1030);
}
+
+
/**
* @generated
*/
@@ -98,7 +100,7 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
View view = (View)getHost().getModel();
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ EAnnotation annotation = view.getEAnnotation("Shortcut");//$NON-NLS-1$
if(annotation == null) {
// there are indirectly referenced children, need extra commands: false
addDestroyChildNodesCommand(cmd);
@@ -127,6 +129,11 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
Node cnode = (Node)cit.next();
switch(UMLVisualIDRegistry.getVisualID(cnode)) {
case StereotypeEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -150,27 +157,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case AssociationEditPart.VISUAL_ID:
- case AssociationBranchEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case ModelEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -191,25 +188,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case ProfileApplicationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case ProfileEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -231,25 +220,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case ProfileApplicationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case PackageEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -270,25 +251,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case ProfileApplicationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case ConstraintEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -307,28 +280,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- case ContextLinkEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case EnumerationEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -351,27 +313,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case AssociationEditPart.VISUAL_ID:
- case AssociationBranchEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case PrimitiveTypeEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -394,27 +346,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case AssociationEditPart.VISUAL_ID:
- case AssociationBranchEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case DataTypeEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -437,27 +379,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case AssociationEditPart.VISUAL_ID:
- case AssociationBranchEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case CommentEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -469,21 +401,17 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
- cmd.add(new DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
break;
case MetaclassEditPartCN.VISUAL_ID:
+
+
+
+
+
for(Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
Edge incomingLink = (Edge)it.next();
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
@@ -507,22 +435,7 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
break;
}
}
- for(Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- switch(UMLVisualIDRegistry.getVisualID(outgoingLink)) {
- case AssociationEditPart.VISUAL_ID:
- case AssociationBranchEditPart.VISUAL_ID:
- case GeneralizationEditPart.VISUAL_ID:
- case DependencyEditPart.VISUAL_ID:
- case DependencyBranchEditPart.VISUAL_ID:
- case ElementImportEditPart.VISUAL_ID:
- case PackageImportEditPart.VISUAL_ID:
- DestroyElementRequest destroyEltReq = new DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
- }
- }
+
cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
// don't need explicit deletion of cnode as parent's view deletion would clean child views as well
// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
@@ -534,6 +447,8 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
}
}
+
+
/**
* @generated
*/
@@ -714,4 +629,5 @@ public class ProfileItemSemanticEditPolicyTN extends UMLBaseItemSemanticEditPoli
}
return super.getReorientReferenceRelationshipCommand(req);
}
+
}

Back to the top