/** @generated */
 protected Command getDestroyElementCommand(DestroyElementRequest req) {
   View view = (View) getHost().getModel();
   CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
   cmd.setTransactionNestingEnabled(false);
   for (Iterator<?> it = view.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 = view.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;
     }
   }
   EAnnotation annotation = view.getEAnnotation("Shortcut"); // $NON-NLS-1$
   if (annotation == null) {
     // there are indirectly referenced children, need extra commands: false
     addDestroyShortcutsCommand(cmd, view);
     // delete host element
     cmd.add(new DestroyElementCommand(req));
   } else {
     cmd.add(new DeleteCommand(getEditingDomain(), view));
   }
   return getGEFWrapper(cmd.reduce());
 }
  protected void createEntryPoint(Edge edge, Diagram subdiagram) {
    Transition transition = (Transition) edge.getElement();
    Region entryPointContainer = getEntryPointContainer(transition);
    Entry entryPoint = createSemanticEntryPoint(transition);

    // re-wire old transition to targeting the selected state
    transition.setTarget((State) subdiagram.getElement());
    View oldTarget = edge.getTarget();
    edge.setTarget(getContextObject());

    // create node for entry point
    View entryPointContainerView =
        helper.getViewForSemanticElement(entryPointContainer, subdiagram);
    View entryPointRegionCompartment =
        ViewUtil.getChildBySemanticHint(entryPointContainerView, SemanticHints.REGION_COMPARTMENT);
    Node entryNode =
        ViewService.createNode(
            entryPointRegionCompartment, entryPoint, SemanticHints.ENTRY, preferencesHint);
    ViewService.createEdge(
        entryNode,
        oldTarget,
        entryPoint.getOutgoingTransitions().get(0),
        SemanticHints.TRANSITION,
        preferencesHint);

    addEntryPointSpec(transition, entryPoint);
  }
 /** @generated */
 private Collection refreshConnections() {
   Map domain2NotationMap = new HashMap();
   Collection linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
   Collection existingLinks = new LinkedList(getDiagram().getEdges());
   for (Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext(); ) {
     Edge nextDiagramLink = (Edge) linksIterator.next();
     int diagramLinkVisualID = AutomataVisualIDRegistry.getVisualID(nextDiagramLink);
     if (diagramLinkVisualID == -1) {
       if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
         linksIterator.remove();
       }
       continue;
     }
     EObject diagramLinkObject = nextDiagramLink.getElement();
     EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
     EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
     for (Iterator LinkDescriptorsIterator = linkDescriptors.iterator();
         LinkDescriptorsIterator.hasNext(); ) {
       AutomataLinkDescriptor nextLinkDescriptor =
           (AutomataLinkDescriptor) LinkDescriptorsIterator.next();
       if (diagramLinkObject == nextLinkDescriptor.getModelElement()
           && diagramLinkSrc == nextLinkDescriptor.getSource()
           && diagramLinkDst == nextLinkDescriptor.getDestination()
           && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
         linksIterator.remove();
         LinkDescriptorsIterator.remove();
       }
     }
   }
   deleteViews(existingLinks.iterator());
   return createConnections(linkDescriptors, domain2NotationMap);
 }
  protected void createExitPoint(Edge edge, Diagram subdiagram) {
    Transition transition = (Transition) edge.getElement();
    // create semantic exit point
    Region exitPointContainer = getExitPointContainer(transition);
    Exit exitPoint = createSemanticExitPoint(transition);

    // create node for exit point
    View exitPointContainerView = helper.getViewForSemanticElement(exitPointContainer, subdiagram);
    View exitPointRegionCompartment =
        ViewUtil.getChildBySemanticHint(exitPointContainerView, SemanticHints.REGION_COMPARTMENT);
    Node exitNode =
        ViewService.createNode(
            exitPointRegionCompartment, exitPoint, SemanticHints.EXIT, preferencesHint);

    // re-wire existing transition to new exit point
    Vertex oldTarget = transition.getTarget();
    transition.setTarget(exitPoint);
    ViewService.createEdge(
        edge.getSource(), exitNode, transition, SemanticHints.TRANSITION, preferencesHint);

    // create transition from selected state to former transition target
    Transition exitPointTransition = SGraphFactory.eINSTANCE.createTransition();
    exitPointTransition.setSource((State) subdiagram.getElement());
    exitPointTransition.setTarget(oldTarget);
    ViewService.createEdge(
        getContextObject(),
        edge.getTarget(),
        exitPointTransition,
        SemanticHints.TRANSITION,
        preferencesHint);

    addExitPointSpec(exitPointTransition, exitPoint);
  }
 /** @generated */
 protected List getNotationalChildLinks() {
   List result = new LinkedList();
   List allLinks = getDiagram().getEdges();
   for (Iterator it = allLinks.iterator(); it.hasNext(); ) {
     Edge next = (Edge) it.next();
     if (next.isSetElement()
         && next.getElement() != null
         && next.getElement().eResource() == null) {
       result.add(next);
       continue;
     }
     View source = next.getSource();
     if (source == null
         || (source.isSetElement()
             && source.getElement() != null
             && source.getElement().eResource() == null)) {
       result.add(next);
       continue;
     }
     View target = next.getTarget();
     if (target == null
         || (target.isSetElement()
             && target.getElement() != null
             && target.getElement().eResource() == null)) {
       result.add(next);
       continue;
     }
     if (next.isSetElement() && next.getElement() != null) {
       if (next.getElement().eContainer() == getDiagram().getElement()) {
         int linkVID = MindmapVisualIDRegistry.getVisualID(next);
         switch (linkVID) {
           case RelationshipEditPart.VISUAL_ID:
           case Relationship2EditPart.VISUAL_ID:
           case Relationship3EditPart.VISUAL_ID:
             result.add(next);
             break;
         }
       }
     }
   }
   return result;
 }
 /** @generated */
 protected Command createCommand() {
   TransactionalEditingDomain editingDomain =
       TransactionUtil.getEditingDomain(oldTarget.getDiagram().getElement());
   CompoundCommand result = new CompoundCommand();
   result.append(new ReconnectNotationalEdgeTargetCommand(edge, newTarget));
   result.append(
       SetCommand.create(
           editingDomain,
           edge.getElement(),
           imagindata.imagindataPackage.eINSTANCE.getTransition_End(),
           newTarget.getElement()));
   return result;
 }
 /** @generated */
 private Collection<IAdaptable> refreshConnections() {
   Domain2Notation domain2NotationMap = new Domain2Notation();
   Collection<
           edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part
               .RelationalDatabase_MAVOLinkDescriptor>
       linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
   Collection existingLinks = new LinkedList(getDiagram().getEdges());
   for (Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext(); ) {
     Edge nextDiagramLink = (Edge) linksIterator.next();
     int diagramLinkVisualID =
         edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part
             .RelationalDatabase_MAVOVisualIDRegistry.getVisualID(nextDiagramLink);
     if (diagramLinkVisualID == -1) {
       if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
         linksIterator.remove();
       }
       continue;
     }
     EObject diagramLinkObject = nextDiagramLink.getElement();
     EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
     EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
     for (Iterator<
                 edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part
                     .RelationalDatabase_MAVOLinkDescriptor>
             linkDescriptorsIterator = linkDescriptors.iterator();
         linkDescriptorsIterator.hasNext(); ) {
       edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part
               .RelationalDatabase_MAVOLinkDescriptor
           nextLinkDescriptor = linkDescriptorsIterator.next();
       if (diagramLinkObject == nextLinkDescriptor.getModelElement()
           && diagramLinkSrc == nextLinkDescriptor.getSource()
           && diagramLinkDst == nextLinkDescriptor.getDestination()
           && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
         linksIterator.remove();
         linkDescriptorsIterator.remove();
         break;
       }
     }
   }
   deleteViews(existingLinks.iterator());
   return createConnections(linkDescriptors, domain2NotationMap);
 }
 /** @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;
     }
   }
 }
Exemple #9
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 */
 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 NOT adding the deletion of local conditions */
 protected Command getDestroyElementCommand(DestroyElementRequest req) {
   View view = (View) getHost().getModel();
   CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
   cmd.setTransactionNestingEnabled(false);
   for (Iterator it = view.getTargetEdges().iterator(); it.hasNext(); ) {
     Edge incomingLink = (Edge) it.next();
     if (UMLVisualIDRegistry.getVisualID(incomingLink) == ObjectFlowEditPart.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) == ControlFlowEditPart.VISUAL_ID) {
       DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
       cmd.add(new DestroyElementCommand(r));
       cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
       continue;
     }
   }
   for (Iterator it = view.getSourceEdges().iterator(); it.hasNext(); ) {
     Edge outgoingLink = (Edge) it.next();
     if (UMLVisualIDRegistry.getVisualID(outgoingLink)
         == ActionLocalPreconditionEditPart.VISUAL_ID) {
       /*
        * Simply delete the link and the local condition view.
        * Model arrangement are automatic since local condition is contained by the action.
        */
       cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink.getTarget()));
       cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
       continue;
     }
     if (UMLVisualIDRegistry.getVisualID(outgoingLink)
         == ActionLocalPostconditionEditPart.VISUAL_ID) {
       /*
        * Simply delete the link and the local condition view.
        * Model arrangement are automatic since local condition is contained by the action.
        */
       cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink.getTarget()));
       cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
       continue;
     }
     if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ObjectFlowEditPart.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) == ControlFlowEditPart.VISUAL_ID) {
       DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
       cmd.add(new DestroyElementCommand(r));
       cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
       continue;
     }
   }
   EAnnotation annotation = view.getEAnnotation("Shortcut"); // $NON-NLS-1$
   if (annotation == null) {
     // there are indirectly referenced children, need extra commands: false
     addDestroyChildNodesCommand(cmd);
     addDestroyShortcutsCommand(cmd, view);
     // delete host element
     cmd.add(new DestroyElementCommand(req));
   } else {
     cmd.add(new DeleteCommand(getEditingDomain(), view));
   }
   return getGEFWrapper(cmd.reduce());
 }
  /** @generated */
  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext(); ) {
      Edge incomingLink = (Edge) it.next();
      if (UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.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) == ObjectFlowEditPart.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) == ExceptionHandlerEditPart.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 = view.getSourceEdges().iterator(); it.hasNext(); ) {
      Edge outgoingLink = (Edge) it.next();
      if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.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) == ObjectFlowEditPart.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)
          == ActionLocalPreconditionEditPart.VISUAL_ID) {
        DestroyReferenceRequest r =
            new DestroyReferenceRequest(
                outgoingLink.getSource().getElement(),
                null,
                outgoingLink.getTarget().getElement(),
                false);
        cmd.add(
            new DestroyReferenceCommand(r) {

              protected CommandResult doExecuteWithResult(
                  IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
                EObject referencedObject = getReferencedObject();
                Resource resource = referencedObject.eResource();
                CommandResult result = super.doExecuteWithResult(progressMonitor, info);
                if (resource != null) {
                  resource.getContents().add(referencedObject);
                }
                return result;
              }
            });
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
      if (UMLVisualIDRegistry.getVisualID(outgoingLink)
          == ActionLocalPostconditionEditPart.VISUAL_ID) {
        DestroyReferenceRequest r =
            new DestroyReferenceRequest(
                outgoingLink.getSource().getElement(),
                null,
                outgoingLink.getTarget().getElement(),
                false);
        cmd.add(
            new DestroyReferenceCommand(r) {

              protected CommandResult doExecuteWithResult(
                  IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
                EObject referencedObject = getReferencedObject();
                Resource resource = referencedObject.eResource();
                CommandResult result = super.doExecuteWithResult(progressMonitor, info);
                if (resource != null) {
                  resource.getContents().add(referencedObject);
                }
                return result;
              }
            });
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
      if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ExceptionHandlerEditPart.VISUAL_ID) {
        DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
        cmd.add(new DestroyElementCommand(r));
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
    }
    EAnnotation annotation = view.getEAnnotation("Shortcut"); // $NON-NLS-1$
    if (annotation == null) {
      // there are indirectly referenced children, need extra commands: false
      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
      cmd.add(new DestroyElementCommand(req));
    } else {
      cmd.add(new DeleteCommand(getEditingDomain(), view));
    }
    return getGEFWrapper(cmd.reduce());
  }
 /** @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 ValueSpecificationAction_OutputPinEditPart.VISUAL_ID:
         for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) {
           Edge incomingLink = (Edge) it.next();
           if (UMLVisualIDRegistry.getVisualID(incomingLink) == ControlFlowEditPart.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) == ObjectFlowEditPart.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 = node.getSourceEdges().iterator(); it.hasNext(); ) {
           Edge outgoingLink = (Edge) it.next();
           if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ControlFlowEditPart.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) == ObjectFlowEditPart.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)
               == ObjectNodeSelectionEditPart.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(), 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 Command createDomainModelRemoveCommand(TransactionalEditingDomain editingDomain) {
   return DestroyElementCommand.create(editingDomain, edge.getElement());
 }
 /** @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 (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;
     }
   }
 }