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 void addDestroyChildNodesCommand(ICompositeCommand cmd) { View view = (View) getHost().getModel(); for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) { Node node = (Node) nit.next(); switch (UMLVisualIDRegistry.getVisualID(node)) { case ParameterEditPart.VISUAL_ID: for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (UMLVisualIDRegistry.getVisualID(incomingLink) == CommentAnnotatedElementEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), node.getElement(), false))); // directlyOwned: false // don't need explicit deletion of node as parent's view deletion would clean child views // as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node)); break; } } }
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); }
@SuppressWarnings("unchecked") protected void createEntryExitPoints(Diagram subdiagram) { TreeIterator<EObject> eAllContents = subdiagram.eAllContents(); List<Edge> entryPointsToCreate = new ArrayList<Edge>(); List<Edge> exitPointstoCreate = new ArrayList<Edge>(); while (eAllContents.hasNext()) { EObject next = eAllContents.next(); if (next instanceof View) { EList<Edge> targetEdges = ((View) next).getTargetEdges(); for (Edge edge : targetEdges) { if (!EcoreUtil.isAncestor(subdiagram, edge.getSource())) entryPointsToCreate.add(edge); } EList<Edge> sourceEdges = ((View) next).getSourceEdges(); for (Edge edge : sourceEdges) { if (!EcoreUtil.isAncestor(subdiagram, edge.getTarget())) exitPointstoCreate.add(edge); } } } for (Edge edge : entryPointsToCreate) { createEntryPoint(edge, subdiagram); } for (Edge edge : exitPointstoCreate) { createExitPoint(edge, subdiagram); } }
/** Execution of the command */ @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { View view = getView(); List<Edge> sourceList = ViewUtil.getSourceConnections(view); List<Edge> targetList = ViewUtil.getTargetConnections(view); for (Edge edge : sourceList) { IdentityAnchor anchor = (IdentityAnchor) edge.getSourceAnchor(); if (anchor != null) { anchor.setId(getNewIdStr(anchor)); } } for (Edge edge : targetList) { IdentityAnchor anchor = (IdentityAnchor) edge.getTargetAnchor(); if (anchor != null) { anchor.setId(getNewIdStr(anchor)); } } return CommandResult.newOKCommandResult(); }
/** @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()); }
/** @generated */ private Collection<View> getLinksTargetByType(Collection<Edge> edges, String type) { LinkedList<View> result = new LinkedList<View>(); for (Edge nextEdge : edges) { View nextEdgeTarget = nextEdge.getTarget(); if (type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) { result.add(nextEdgeTarget); } } return result; }
/** @generated */ private boolean canReconnect() { if (!DomainElementInitializer.LinkConstraints.canExistTransition_4001( edge.getSource().getElement(), newTarget.getElement())) { return false; } return true; }
/** * Creates an edge for a given eObject and with a given type and connects it between a given * source and a given target * * @param source The edge's source view * @param target The edge's target view * @param eObject The edge view object context * @param type The edge view type, check {@link ViewType} for predefined values * @param preferencesHint The preference hint that is to be used to find the appropriate * preference store from which to retrieve diagram preference values. The preference hint is * mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>. * @return A newly created <code>Edge</code> */ public static Edge createEdge( View source, View target, EObject eObject, String type, PreferencesHint preferencesHint) { assert source != null : "The source is null"; // $NON-NLS-1$ assert target != null : "The target is null"; // $NON-NLS-1$ assert source.getDiagram() != null : "The source is detached"; // $NON-NLS-1$ assert target.getDiagram() != null : "The target is detached"; // $NON-NLS-1$ IAdaptable viewModel = (eObject != null) ? new EObjectAdapter(eObject) : null; Edge edge = (Edge) ViewService.getInstance() .createEdge(viewModel, source.getDiagram(), type, ViewUtil.APPEND, preferencesHint); if (edge != null) { edge.setSource(source); edge.setTarget(target); } return edge; }
/** * This operation checks if, after resizing the ShapeNodeEditPart, all links anchors will fit * inside the figure in case their positions are preserved * * @param shapeEP That shape being resized * @param sizeDelta The SizeDelta for the resize * @param preserveAxis The axisxxx * @return The new SizeDelta to preserve anchors' positions */ public static Dimension getSizeDeltaToFitAnchors( ShapeNodeEditPart shapeEP, Dimension sizeDelta, int preserveAxis) { Dimension newSizeDelta = new Dimension(sizeDelta); View view = (View) shapeEP.getModel(); Rectangle figureBounds = shapeEP.getFigure().getBounds(); List<Edge> sourceList = ViewUtil.getSourceConnections(view); List<Edge> targetList = ViewUtil.getTargetConnections(view); for (Edge edge : sourceList) { IdentityAnchor anchor = (IdentityAnchor) edge.getSourceAnchor(); modifySizeDeltaToFitAnchor(anchor, newSizeDelta, preserveAxis, figureBounds); } for (Edge edge : targetList) { IdentityAnchor anchor = (IdentityAnchor) edge.getTargetAnchor(); modifySizeDeltaToFitAnchor(anchor, newSizeDelta, preserveAxis, figureBounds); } return newSizeDelta; }
/** @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); }
/** @generated */ public Edge createViewTableViewedTables_3002( View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); ArrayList points = new ArrayList(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(SqlmodelVisualIDRegistry.getType(ViewTableViewedTables2EditPart.VISUAL_ID)); edge.setElement(null); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE); if (edgeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); edgeFontStyle.setFontName(fontData.getName()); edgeFontStyle.setFontHeight(fontData.getHeight()); edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE)); if (routing != null) { ViewUtil.setStructuralFeatureValue( edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing); } return edge; }
/** @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 */ 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; }
/** * get the member end that will be managed by the branch of the association. * * @param associationBranchView the association branch view * @param association the association * @return the property concerned by the branch or null if the property is not found */ public static Property getPropertyToListen(Edge associationBranchView, Association association) { Property semanticBranch = getSemanticBranchEnd(associationBranchView); if (semanticBranch != null) { return semanticBranch; } Classifier target = (Classifier) (associationBranchView.getTarget().getElement()); // look for the property that is typed by the classifier Property propertyToDisplay = null; Iterator<Property> propertiesIterator = association.getMemberEnds().iterator(); while (propertiesIterator.hasNext()) { Property currentProperty = propertiesIterator.next(); if (currentProperty.getType().equals(target)) { propertyToDisplay = currentProperty; } } return propertyToDisplay; }
/** @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 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 */ private void addDestroyChildNodesCommand(ICompositeCommand cmd) { View view = (View) getHost().getModel(); for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) { Node node = (Node) nit.next(); switch (UMLVisualIDRegistry.getVisualID(node)) { case Port3EditPart.VISUAL_ID: for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (UMLVisualIDRegistry.getVisualID(incomingLink) == ConnectorEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == DependencyEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == UsageEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == ConstraintConstrainedElementEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == CommentAnnotatedElementEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == Dependency2EditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ConnectorEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == DependencyEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == UsageEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == PortProvidedEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == PortRequiredEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == Dependency2EditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), node.getElement(), false))); // directlyOwned: true // don't need explicit deletion of node as parent's view deletion would clean child views // as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node)); break; case ClassClass_contentsEditPart.VISUAL_ID: for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) { Node cnode = (Node) cit.next(); switch (UMLVisualIDRegistry.getVisualID(cnode)) { case Property3EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (UMLVisualIDRegistry.getVisualID(incomingLink) == ConnectorEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == DependencyEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == UsageEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == ConstraintConstrainedElementEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == CommentAnnotatedElementEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(incomingLink) == Dependency2EditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (UMLVisualIDRegistry.getVisualID(outgoingLink) == ConnectorEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == DependencyEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == UsageEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (UMLVisualIDRegistry.getVisualID(outgoingLink) == Dependency2EditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; } } break; } } }
/** @generated */ private void addDestroyChildNodesCommand(ICompositeCommand cmd) { View view = (View) getHost().getModel(); for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) { Node node = (Node) nit.next(); switch (CrystalVisualIDRegistry.getVisualID(node)) { case LoopLoopLoopStatementsCompartmentEditPart.VISUAL_ID: for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext(); ) { Node cnode = (Node) cit.next(); switch (CrystalVisualIDRegistry.getVisualID(cnode)) { case Expression6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Exception6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case If6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Case6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Insert6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Update6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Delete6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Select6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case While6EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case For4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Loop5EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Open4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Fetch4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Close4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case CallProcedure4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case CallFunction4EditPart.VISUAL_ID: for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext(); ) { Edge incomingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(incomingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CrystalVisualIDRegistry.getVisualID(outgoingLink) == TransitionEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; } } break; } } }
/** @generated */ private void addDestroyChildNodesCommand(ICompositeCommand cmd) { View view = (View) getHost().getModel(); for (Iterator nit = view.getChildren().iterator(); nit.hasNext(); ) { Node node = (Node) nit.next(); switch (BpeldiagVisualIDRegistry.getVisualID(node)) { case ForEachForEachCompartment9EditPart.VISUAL_ID: for (Iterator cit = node.getChildren().iterator(); cit.hasNext(); ) { Node cnode = (Node) cit.next(); switch (BpeldiagVisualIDRegistry.getVisualID(cnode)) { case Assign4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Compensate4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case CompensateScope4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Empty4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Exit4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case ExtensionActivity4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case ForEach3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case If2EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Invoke2EditPart.VISUAL_ID: for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink) == PartnerActivityOperationEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case OpaqueActivity2EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case PartnerActivity2EditPart.VISUAL_ID: for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink) == PartnerActivityOperationEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Pick2EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Receive3EditPart.VISUAL_ID: for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink) == PartnerActivityOperationEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case RepeatUntil4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Reply3EditPart.VISUAL_ID: for (Iterator it = cnode.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (BpeldiagVisualIDRegistry.getVisualID(outgoingLink) == PartnerActivityOperationEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false); cmd.add(new DestroyReferenceCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Rethrow3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Scope4EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Throw3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Validate3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case Wait3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; case While3EditPart.VISUAL_ID: cmd.add( new DestroyElementCommand( new DestroyElementRequest( getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child // views as well // cmd.add(new // org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), // cnode)); break; } } break; } } }
/** @generated */ private void createLinks(Diagram diagram) { for (boolean continueLinkCreation = true; continueLinkCreation; ) { continueLinkCreation = false; Collection additionalDescriptors = new LinkedList(); for (Iterator it = myLinkDescriptors.iterator(); it.hasNext(); ) { UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor) it.next(); if (!myDomain2NotationMap.containsKey(nextLinkDescriptor.getSource()) || !myDomain2NotationMap.containsKey(nextLinkDescriptor.getDestination())) { continue; } final String linkType = UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()); Edge edge = ViewService.getInstance() .createEdge( nextLinkDescriptor.getSemanticAdapter(), diagram, linkType, ViewUtil.APPEND, true, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); if (edge != null) { edge.setSource((View) myDomain2NotationMap.get(nextLinkDescriptor.getSource())); edge.setTarget((View) myDomain2NotationMap.get(nextLinkDescriptor.getDestination())); it.remove(); if (nextLinkDescriptor.getModelElement() != null) { myDomain2NotationMap.put(nextLinkDescriptor.getModelElement(), edge); } continueLinkCreation = true; switch (nextLinkDescriptor.getVisualID()) { case ExtensionEditPart.VISUAL_ID: additionalDescriptors.addAll(UMLDiagramUpdater.getExtension_1013OutgoingLinks(edge)); break; case AssociationEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getAssociation_4001OutgoingLinks(edge)); break; case ProfileApplicationEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getProfileApplication_1045OutgoingLinks(edge)); break; case AssociationBranchEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getAssociation_4019OutgoingLinks(edge)); break; case GeneralizationEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getGeneralization_4002OutgoingLinks(edge)); break; case DependencyEditPart.VISUAL_ID: additionalDescriptors.addAll(UMLDiagramUpdater.getDependency_4008OutgoingLinks(edge)); break; case DependencyBranchEditPart.VISUAL_ID: additionalDescriptors.addAll(UMLDiagramUpdater.getDependency_4018OutgoingLinks(edge)); break; case ElementImportEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getElementImport_1064OutgoingLinks(edge)); break; case PackageImportEditPart.VISUAL_ID: additionalDescriptors.addAll( UMLDiagramUpdater.getPackageImport_1065OutgoingLinks(edge)); break; } } } myLinkDescriptors.addAll(additionalDescriptors); } }
/** @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 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; } } }
/** @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 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 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 (CoordinationVisualIDRegistry.getVisualID(incomingLink) == CompositeProcessComposedOfEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == IfThenElseThenEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == IfThenElseElseEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == RepeatUntilUntilProcessEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == RepeatWhileWhileProcessEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == ControlConstructBagFirstEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } if (CoordinationVisualIDRegistry.getVisualID(incomingLink) == ControlConstructListFirstEditPart.VISUAL_ID) { DestroyReferenceRequest r = new DestroyReferenceRequest( incomingLink.getSource().getElement(), null, incomingLink.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(), incomingLink)); continue; } } for (Iterator it = view.getSourceEdges().iterator(); it.hasNext(); ) { Edge outgoingLink = (Edge) it.next(); if (CoordinationVisualIDRegistry.getVisualID(outgoingLink) == PerformProcessEditPart.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 (CoordinationVisualIDRegistry.getVisualID(outgoingLink) == PerformHasDataFromEditPart.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; } } 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()); }
/** @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 */ public ReconnectTransition4001TargetCommand(Edge edge, View newTarget) { this.edge = edge; this.newTarget = newTarget; this.oldTarget = edge.getTarget(); }
/** @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; } } }