Examples of CompoundCommand


Examples of org.eclipse.gef.commands.CompoundCommand

    if (getHost() instanceof VertexEditPart) {
      VertexEditPart part = (VertexEditPart) getHost();
      List<?> incoming = part.getSourceConnections();
      List<?> outgoing = part.getTargetConnections();
      if (!incoming.isEmpty() || !outgoing.isEmpty()) {
        CompoundCommand compound = new CompoundCommand();
        for (Object obj : incoming) {
          DeleteCommand command = new DeleteCommand(
              ((EdgeEditPart) obj).getModel());
          compound.add(command);
        }

        for (Object obj : outgoing) {
          DeleteCommand command = new DeleteCommand(
              ((EdgeEditPart) obj).getModel());
          compound.add(command);
        }

        DeleteCommand command = new DeleteCommand(getHost().getModel());
        compound.add(command);

        return compound;
      }
    }
View Full Code Here

Examples of org.eclipse.gef.commands.CompoundCommand

  public static Resource[] getResources(Command command) {
    if (command instanceof IEditModelCommand) {
      return ((IEditModelCommand)command).getResources();
    }
    if (command instanceof CompoundCommand) {
      CompoundCommand ccmd = (CompoundCommand) command;
     
      Set<Resource> set = new HashSet<Resource>();     
      for (Object n : ccmd.getChildren() ) {
        for (Resource r : getResources((Command)n)) {
          set.add(r);
        }               
      }
      if (set.isEmpty()) {
View Full Code Here

Examples of org.eclipse.gef.commands.CompoundCommand

   
    if (command instanceof IEditModelCommand) {
      return ((IEditModelCommand)command).getModifiedResources();
    }
    if (command instanceof CompoundCommand) {
      CompoundCommand ccmd = (CompoundCommand) command;
     
      Set<Resource> set = new HashSet<Resource>();     
      for (Object n : ccmd.getChildren() ) {
        for (Resource r : getModifiedResources((Command)n)) {
          set.add(r);
        }               
      }
      if (set.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.