Package org.eclipse.gmf.runtime.diagram.core.commands

Examples of org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand


        .hasNext();) {
      View nextView = (View) it.next();
      if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
        continue;
      }
      cmd.add(new DeleteCommand(getEditingDomain(), nextView));
    }
  }
View Full Code Here


      Edge incomingLink = (Edge) it.next();
      if (DispelVisualIDRegistry.getVisualID(incomingLink) == ConnectionExpressionEditPart.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 (DispelVisualIDRegistry.getVisualID(outgoingLink) == ConnectionExpressionEditPart.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());
  }
View Full Code Here

      // 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());
  }
View Full Code Here

      // 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());
  }
View Full Code Here

      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
      cmd.add(new DestroyElementCommand(req));
    } else {
      cmd.add(new DeleteCommand(getEditingDomain(), view));
    }
    return getGEFWrapper(cmd.reduce());
  }
View Full Code Here

              if (DispelVisualIDRegistry
                  .getVisualID(incomingLink) == ConnectionExpressionEditPart.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 (DispelVisualIDRegistry
                  .getVisualID(outgoingLink) == ConnectionExpressionEditPart.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;
      case ProcessingElementInstanceOutputsCompartmentEditPart.VISUAL_ID:
        for (Iterator<?> cit = node.getChildren().iterator(); cit
            .hasNext();) {
          Node cnode = (Node) cit.next();
          switch (DispelVisualIDRegistry.getVisualID(cnode)) {
          case OutputEditPart.VISUAL_ID:
            for (Iterator<?> it = cnode.getTargetEdges().iterator(); it
                .hasNext();) {
              Edge incomingLink = (Edge) it.next();
              if (DispelVisualIDRegistry
                  .getVisualID(incomingLink) == ConnectionExpressionEditPart.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 (DispelVisualIDRegistry
                  .getVisualID(outgoingLink) == ConnectionExpressionEditPart.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;
      case ProcessingElementInstanceDefinitionCompartmentEditPart.VISUAL_ID:
        for (Iterator<?> cit = node.getChildren().iterator(); cit
            .hasNext();) {
          Node cnode = (Node) cit.next();
          switch (DispelVisualIDRegistry.getVisualID(cnode)) {
          case ProcessingElementMethodDefinitionEditPart.VISUAL_ID:
            for (Iterator<?> it = cnode.getSourceEdges().iterator(); it
                .hasNext();) {
              Edge outgoingLink = (Edge) it.next();
              if (DispelVisualIDRegistry
                  .getVisualID(outgoingLink) == MethodCall2EditPart.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(
View Full Code Here

      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
      cmd.add(new DestroyElementCommand(req));
    } else {
      cmd.add(new DeleteCommand(getEditingDomain(), view));
    }
    return getGEFWrapper(cmd.reduce());
  }
View Full Code Here

      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
      cmd.add(new DestroyElementCommand(req));
    } else {
      cmd.add(new DeleteCommand(getEditingDomain(), view));
    }
    return getGEFWrapper(cmd.reduce());
  }
View Full Code Here

      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
      cmd.add(new DestroyElementCommand(req));
    } else {
      cmd.add(new DeleteCommand(getEditingDomain(), view));
    }
    return getGEFWrapper(cmd.reduce());
  }
View Full Code Here

      Edge incomingLink = (Edge) it.next();
      if (DispelVisualIDRegistry.getVisualID(incomingLink) == ConnectionExpressionEditPart.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 (DispelVisualIDRegistry.getVisualID(outgoingLink) == ConnectionExpressionEditPart.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());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.