コード例 #1
0
 /** @generated */
 static {
   registerSnapBackPosition(
       UMLVisualIDRegistry.getType(
           org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationBranchRoleEditPart
               .VISUAL_ID),
       new Point(0, -20));
 }
コード例 #2
0
 /** @generated */
 public IParser getParser() {
   if (parser == null) {
     parser =
         UMLParserProvider.getParser(
             UMLElementTypes.Association_4019,
             getParserElement(),
             UMLVisualIDRegistry.getType(
                 org.eclipse.papyrus.uml.diagram.profile.edit.parts.AssociationBranchRoleEditPart
                     .VISUAL_ID));
   }
   return parser;
 }
コード例 #3
0
 /** @generated */
 public IParser getParser() {
   if (parser == null) {
     parser =
         UMLParserProvider.getParser(
             UMLElementTypes.Enumeration_3025,
             getParserElement(),
             UMLVisualIDRegistry.getType(
                 org.eclipse.papyrus.uml.diagram.profile.edit.parts.EnumerationNameEditPartCN
                     .VISUAL_ID));
   }
   return parser;
 }
コード例 #4
0
  /** @generated */
  protected void addDestroyChildNodesCommand(ICompositeCommand cmd) {
    View view = (View) getHost().getModel();
    for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext(); ) {
      Node node = (Node) nit.next();
      switch (UMLVisualIDRegistry.getVisualID(node)) {
        case 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;
      }
    }
  }
コード例 #5
0
 /** @generated */
 public EditPart getPrimaryChildEditPart() {
   return getChildBySemanticHint(UMLVisualIDRegistry.getType(MetaclassNameEditPart.VISUAL_ID));
 }
コード例 #6
0
ファイル: ProfileEditPartTN.java プロジェクト: go2zo/ju4pa
 /** @generated */
 public EditPart getPrimaryChildEditPart() {
   return getChildBySemanticHint(UMLVisualIDRegistry.getType(ProfileNameEditPartTN.VISUAL_ID));
 }