/** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case ParameterEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           if (UMLVisualIDRegistry.getVisualID(incomingLink)
               == CommentAnnotatedElementEditPart.VISUAL_ID) {
             DestroyReferenceRequest r =
                 new DestroyReferenceRequest(
                     incomingLink.getSource().getElement(),
                     null,
                     incomingLink.getTarget().getElement(),
                     false);
             cmd.add(new DestroyReferenceCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: false
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
     }
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case PackageImportsEditPart.VISUAL_ID:
         for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (UMLVisualIDRegistry.getVisualID(cnode)) {
             case ElementImportEditPart.VISUAL_ID:
               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;
           }
         }
         break;
     }
   }
 }
 /**
  * Clean all shortcuts to the host element from the same diagram
  *
  * @generated
  */
 protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
   assert view.getEAnnotation("Shortcut") == null; // $NON-NLS-1$
   for (Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext(); ) {
     View nextView = (View) it.next();
     if (nextView.getEAnnotation("Shortcut") == null
         || !nextView.isSetElement()
         || nextView.getElement() != view.getElement()) { // $NON-NLS-1$
       continue;
     }
     cmd.add(new DeleteCommand(getEditingDomain(), nextView));
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (BpeldiagVisualIDRegistry.getVisualID(node)) {
       case ForEachForEachCompartment9EditPart.VISUAL_ID:
         for (Iterator cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (BpeldiagVisualIDRegistry.getVisualID(cnode)) {
             case Assign4EditPart.VISUAL_ID:
               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 Compensate4EditPart.VISUAL_ID:
               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 CompensateScope4EditPart.VISUAL_ID:
               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 Empty4EditPart.VISUAL_ID:
               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 Exit4EditPart.VISUAL_ID:
               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 ExtensionActivity4EditPart.VISUAL_ID:
               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 ForEach3EditPart.VISUAL_ID:
               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 If2EditPart.VISUAL_ID:
               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 Invoke2EditPart.VISUAL_ID:
               for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink)
                     == PartnerActivityOperationEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           outgoingLink.getSource().getElement(),
                           null,
                           outgoingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 OpaqueActivity2EditPart.VISUAL_ID:
               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 PartnerActivity2EditPart.VISUAL_ID:
               for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink)
                     == PartnerActivityOperationEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           outgoingLink.getSource().getElement(),
                           null,
                           outgoingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Pick2EditPart.VISUAL_ID:
               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 Receive3EditPart.VISUAL_ID:
               for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink)
                     == PartnerActivityOperationEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           outgoingLink.getSource().getElement(),
                           null,
                           outgoingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 RepeatUntil4EditPart.VISUAL_ID:
               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 Reply3EditPart.VISUAL_ID:
               for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink)
                     == PartnerActivityOperationEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           outgoingLink.getSource().getElement(),
                           null,
                           outgoingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Rethrow3EditPart.VISUAL_ID:
               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 Scope4EditPart.VISUAL_ID:
               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 Throw3EditPart.VISUAL_ID:
               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 Validate3EditPart.VISUAL_ID:
               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 Wait3EditPart.VISUAL_ID:
               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 While3EditPart.VISUAL_ID:
               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;
           }
         }
         break;
     }
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case StateMachine_RegionSubverticesEditPart.VISUAL_ID:
         for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (UMLVisualIDRegistry.getVisualID(cnode)) {
             case SimpleStateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 CompositeStateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 SubmachineStateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 FinalStateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 InitialPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 ShallowHistoryPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 DeepHistoryPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 ForkPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 JoinPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 JunctionPseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 ChoicePseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 TerminatePseudostateEditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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;
           }
         }
         break;
     }
   }
 }
예제 #6
0
 /** @generated */
 protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case InteractionCompartmentEditPart.VISUAL_ID:
         for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (UMLVisualIDRegistry.getVisualID(cnode)) {
             case LifelineEditPartCN.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
                   case CommentAnnotatedElementEditPart.VISUAL_ID:
                   case ConstraintConstrainedElementEditPart.VISUAL_ID:
                   case ConnectorDurationObservationEditPart.VISUAL_ID:
                   case ConnectorTimeObservationEditPart.VISUAL_ID:
                     DestroyReferenceRequest destroyRefReq =
                         new DestroyReferenceRequest(
                             incomingLink.getSource().getElement(),
                             null,
                             incomingLink.getTarget().getElement(),
                             false);
                     cmd.add(new DestroyReferenceCommand(destroyRefReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                   case MessageEditPart.VISUAL_ID:
                     DestroyElementRequest destroyEltReq =
                         new DestroyElementRequest(incomingLink.getElement(), false);
                     cmd.add(new DestroyElementCommand(destroyEltReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     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)) {
                   case CommentAnnotatedElementEditPart.VISUAL_ID:
                   case ConstraintConstrainedElementEditPart.VISUAL_ID:
                     DestroyReferenceRequest destroyRefReq =
                         new DestroyReferenceRequest(
                             incomingLink.getSource().getElement(),
                             null,
                             incomingLink.getTarget().getElement(),
                             false);
                     cmd.add(new DestroyReferenceCommand(destroyRefReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                   case MessageEditPart.VISUAL_ID:
                     DestroyElementRequest destroyEltReq =
                         new DestroyElementRequest(incomingLink.getElement(), false);
                     cmd.add(new DestroyElementCommand(destroyEltReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     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)) {
                   case CommentAnnotatedElementEditPart.VISUAL_ID:
                   case ConstraintConstrainedElementEditPart.VISUAL_ID:
                   case ConnectorDurationObservationEditPart.VISUAL_ID:
                   case ConnectorTimeObservationEditPart.VISUAL_ID:
                     DestroyReferenceRequest destroyRefReq =
                         new DestroyReferenceRequest(
                             incomingLink.getSource().getElement(),
                             null,
                             incomingLink.getTarget().getElement(),
                             false);
                     cmd.add(new DestroyReferenceCommand(destroyRefReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                   case MessageEditPart.VISUAL_ID:
                     DestroyElementRequest destroyEltReq =
                         new DestroyElementRequest(incomingLink.getElement(), false);
                     cmd.add(new DestroyElementCommand(destroyEltReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     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 TimeObservationEditPartCN.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
                   case CommentAnnotatedElementEditPart.VISUAL_ID:
                   case ConstraintConstrainedElementEditPart.VISUAL_ID:
                   case ConnectorDurationObservationEditPart.VISUAL_ID:
                   case ConnectorTimeObservationEditPart.VISUAL_ID:
                     DestroyReferenceRequest destroyRefReq =
                         new DestroyReferenceRequest(
                             incomingLink.getSource().getElement(),
                             null,
                             incomingLink.getTarget().getElement(),
                             false);
                     cmd.add(new DestroyReferenceCommand(destroyRefReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                   case MessageEditPart.VISUAL_ID:
                     DestroyElementRequest destroyEltReq =
                         new DestroyElementRequest(incomingLink.getElement(), false);
                     cmd.add(new DestroyElementCommand(destroyEltReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                 }
               }
               cmd.add(
                   new DestroyElementCommand(
                       new DestroyElementRequest(
                           getEditingDomain(),
                           cnode.getElement(),
                           false))); // directlyOwned: false
               // 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 DurationObservationEditPartCN.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
                   case CommentAnnotatedElementEditPart.VISUAL_ID:
                   case ConstraintConstrainedElementEditPart.VISUAL_ID:
                   case ConnectorDurationObservationEditPart.VISUAL_ID:
                   case ConnectorTimeObservationEditPart.VISUAL_ID:
                     DestroyReferenceRequest destroyRefReq =
                         new DestroyReferenceRequest(
                             incomingLink.getSource().getElement(),
                             null,
                             incomingLink.getTarget().getElement(),
                             false);
                     cmd.add(new DestroyReferenceCommand(destroyRefReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                   case MessageEditPart.VISUAL_ID:
                     DestroyElementRequest destroyEltReq =
                         new DestroyElementRequest(incomingLink.getElement(), false);
                     cmd.add(new DestroyElementCommand(destroyEltReq));
                     cmd.add(
                         new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                             getEditingDomain(), incomingLink));
                     break;
                 }
               }
               cmd.add(
                   new DestroyElementCommand(
                       new DestroyElementRequest(
                           getEditingDomain(),
                           cnode.getElement(),
                           false))); // directlyOwned: false
               // 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;
           }
         }
         break;
     }
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (EsbVisualIDRegistry.getVisualID(node)) {
       case SwitchMediatorInputConnectorEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           if (EsbVisualIDRegistry.getVisualID(incomingLink) == EsbLinkEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case SwitchMediatorOutputConnectorEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           if (EsbVisualIDRegistry.getVisualID(outgoingLink) == EsbLinkEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case SwitchCaseBranchOutputConnectorEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           if (EsbVisualIDRegistry.getVisualID(outgoingLink) == EsbLinkEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case SwitchDefaultBranchOutputConnectorEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           if (EsbVisualIDRegistry.getVisualID(outgoingLink) == EsbLinkEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case SwitchMediatorContainerEditPart.VISUAL_ID:
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
     }
   }
 }
  /** @generated */
  protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
    View view = (View) getHost().getModel();
    for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
      Node node = (Node) nit.next();
      switch (UMLVisualIDRegistry.getVisualID(node)) {
        case ProfilePackageableElementCompartmentEditPartTN.VISUAL_ID:
          for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
            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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case ExtensionEditPart.VISUAL_ID:
                    case AssociationEditPart.VISUAL_ID:
                    case AssociationBranchEditPart.VISUAL_ID:
                    case GeneralizationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                    case PackageImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case ProfileApplicationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                    case PackageImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                    case PackageImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                  }
                }

                for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                  Edge outgoingLink = (Edge) it.next();
                  switch (UMLVisualIDRegistry.getVisualID(outgoingLink)) {
                    case ConstraintConstrainedElementEditPart.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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case AssociationEditPart.VISUAL_ID:
                    case AssociationBranchEditPart.VISUAL_ID:
                    case GeneralizationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case AssociationEditPart.VISUAL_ID:
                    case AssociationBranchEditPart.VISUAL_ID:
                    case GeneralizationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case AssociationEditPart.VISUAL_ID:
                    case AssociationBranchEditPart.VISUAL_ID:
                    case GeneralizationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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)) {
                    case CommentAnnotatedElementEditPart.VISUAL_ID:
                    case ConstraintConstrainedElementEditPart.VISUAL_ID:
                      DestroyReferenceRequest destroyRefReq =
                          new DestroyReferenceRequest(
                              incomingLink.getSource().getElement(),
                              null,
                              incomingLink.getTarget().getElement(),
                              false);
                      cmd.add(new DestroyReferenceCommand(destroyRefReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      break;
                    case ExtensionEditPart.VISUAL_ID:
                    case AssociationEditPart.VISUAL_ID:
                    case AssociationBranchEditPart.VISUAL_ID:
                    case GeneralizationEditPart.VISUAL_ID:
                    case DependencyEditPart.VISUAL_ID:
                    case DependencyBranchEditPart.VISUAL_ID:
                    case ElementImportEditPart.VISUAL_ID:
                      DestroyElementRequest destroyEltReq =
                          new DestroyElementRequest(incomingLink.getElement(), false);
                      cmd.add(new DestroyElementCommand(destroyEltReq));
                      cmd.add(
                          new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(
                              getEditingDomain(), incomingLink));
                      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;
            }
          }
          break;
      }
    }
  }
 /** @generated */
 protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case ValuePinInCallBeActEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
             case CommentLinkEditPart.VISUAL_ID:
               DestroyReferenceRequest destroyRefReq =
                   new DestroyReferenceRequest(
                       incomingLink.getSource().getElement(),
                       null,
                       incomingLink.getTarget().getElement(),
                       false);
               cmd.add(new DestroyReferenceCommand(destroyRefReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
             case ExceptionHandlerEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(incomingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
           }
         }
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(outgoingLink)) {
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(outgoingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
               break;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case ActionInputPinInCallBeActEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
             case CommentLinkEditPart.VISUAL_ID:
               DestroyReferenceRequest destroyRefReq =
                   new DestroyReferenceRequest(
                       incomingLink.getSource().getElement(),
                       null,
                       incomingLink.getTarget().getElement(),
                       false);
               cmd.add(new DestroyReferenceCommand(destroyRefReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
             case ExceptionHandlerEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(incomingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
           }
         }
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(outgoingLink)) {
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(outgoingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
               break;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case InputPinInCallBeActEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
             case CommentLinkEditPart.VISUAL_ID:
               DestroyReferenceRequest destroyRefReq =
                   new DestroyReferenceRequest(
                       incomingLink.getSource().getElement(),
                       null,
                       incomingLink.getTarget().getElement(),
                       false);
               cmd.add(new DestroyReferenceCommand(destroyRefReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
             case ExceptionHandlerEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(incomingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
           }
         }
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(outgoingLink)) {
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(outgoingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
               break;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case OutputPinInCallBeActEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(incomingLink)) {
             case CommentLinkEditPart.VISUAL_ID:
               DestroyReferenceRequest destroyRefReq =
                   new DestroyReferenceRequest(
                       incomingLink.getSource().getElement(),
                       null,
                       incomingLink.getTarget().getElement(),
                       false);
               cmd.add(new DestroyReferenceCommand(destroyRefReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
             case ExceptionHandlerEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(incomingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
               break;
           }
         }
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           switch (UMLVisualIDRegistry.getVisualID(outgoingLink)) {
             case ObjectFlowEditPart.VISUAL_ID:
             case ControlFlowEditPart.VISUAL_ID:
               DestroyElementRequest destroyEltReq =
                   new DestroyElementRequest(outgoingLink.getElement(), false);
               cmd.add(new DestroyElementCommand(destroyEltReq));
               cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
               break;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
     }
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (UMLVisualIDRegistry.getVisualID(node)) {
       case Port3EditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           if (UMLVisualIDRegistry.getVisualID(incomingLink) == ConnectorEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(incomingLink) == DependencyEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(incomingLink) == UsageEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(incomingLink)
               == ConstraintConstrainedElementEditPart.VISUAL_ID) {
             DestroyReferenceRequest r =
                 new DestroyReferenceRequest(
                     incomingLink.getSource().getElement(),
                     null,
                     incomingLink.getTarget().getElement(),
                     false);
             cmd.add(new DestroyReferenceCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(incomingLink)
               == CommentAnnotatedElementEditPart.VISUAL_ID) {
             DestroyReferenceRequest r =
                 new DestroyReferenceRequest(
                     incomingLink.getSource().getElement(),
                     null,
                     incomingLink.getTarget().getElement(),
                     false);
             cmd.add(new DestroyReferenceCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(incomingLink) == Dependency2EditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
             continue;
           }
         }
         for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ConnectorEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == DependencyEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == UsageEditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == PortProvidedEditPart.VISUAL_ID) {
             DestroyReferenceRequest r =
                 new DestroyReferenceRequest(
                     outgoingLink.getSource().getElement(),
                     null,
                     outgoingLink.getTarget().getElement(),
                     false);
             cmd.add(new DestroyReferenceCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == PortRequiredEditPart.VISUAL_ID) {
             DestroyReferenceRequest r =
                 new DestroyReferenceRequest(
                     outgoingLink.getSource().getElement(),
                     null,
                     outgoingLink.getTarget().getElement(),
                     false);
             cmd.add(new DestroyReferenceCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == Dependency2EditPart.VISUAL_ID) {
             DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
             cmd.add(new DestroyElementCommand(r));
             cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
             continue;
           }
         }
         cmd.add(
             new DestroyElementCommand(
                 new DestroyElementRequest(
                     getEditingDomain(), node.getElement(), false))); // directlyOwned: true
         // don't need explicit deletion of node as parent's view deletion would clean child views
         // as well
         // cmd.add(new
         // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
         break;
       case ClassClass_contentsEditPart.VISUAL_ID:
         for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (UMLVisualIDRegistry.getVisualID(cnode)) {
             case Property3EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == ConnectorEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == DependencyEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink) == UsageEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == ConstraintConstrainedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == CommentAnnotatedElementEditPart.VISUAL_ID) {
                   DestroyReferenceRequest r =
                       new DestroyReferenceRequest(
                           incomingLink.getSource().getElement(),
                           null,
                           incomingLink.getTarget().getElement(),
                           false);
                   cmd.add(new DestroyReferenceCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(incomingLink)
                     == Dependency2EditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == ConnectorEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == DependencyEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink) == UsageEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
                 if (UMLVisualIDRegistry.getVisualID(outgoingLink)
                     == Dependency2EditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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;
           }
         }
         break;
     }
   }
 }
 /** @generated */
 private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
   View view = (View) getHost().getModel();
   for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
     Node node = (Node) nit.next();
     switch (CrystalVisualIDRegistry.getVisualID(node)) {
       case LoopLoopLoopStatementsCompartmentEditPart.VISUAL_ID:
         for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) {
           Node cnode = (Node) cit.next();
           switch (CrystalVisualIDRegistry.getVisualID(cnode)) {
             case Expression6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Exception6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 If6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Case6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Insert6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Update6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Delete6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Select6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 While6EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 For4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Loop5EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Open4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Fetch4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 Close4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 CallProcedure4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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 CallFunction4EditPart.VISUAL_ID:
               for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) {
                 Edge incomingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(incomingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(incomingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
                   continue;
                 }
               }
               for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) {
                 Edge outgoingLink = (Edge) it.next();
                 if (CrystalVisualIDRegistry.getVisualID(outgoingLink)
                     == TransitionEditPart.VISUAL_ID) {
                   DestroyElementRequest r =
                       new DestroyElementRequest(outgoingLink.getElement(), false);
                   cmd.add(new DestroyElementCommand(r));
                   cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
                   continue;
                 }
               }
               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;
           }
         }
         break;
     }
   }
 }