Package org.gvt.command

Examples of org.gvt.command.DeleteCommand


      EditPart childEditPart = (EditPart) selectedObjects.next();
      // if selected one is a node or compound DeleteCommand is called
      if (childEditPart instanceof ChsNodeEditPart)
      {
        NodeModel node = (NodeModel) childEditPart.getModel();
        DeleteCommand command = new DeleteCommand();
        command.setChild(node);
        EditPart parent = childEditPart.getParent();
        command.setParent((CompoundModel) parent.getModel());
        command.execute();
      }
      // else if it is an edge, DeleteConnectionCommand is called
      else if (childEditPart instanceof ChsEdgeEditPart)
      {
        {
          DeleteConnectionCommand command
            = new DeleteConnectionCommand();
          command.setConnectionModel(childEditPart.getModel());
          command.execute();
        }
      }
    }
  }
View Full Code Here


  extends org.eclipse.gef.editpolicies.ComponentEditPolicy
{
  protected Command createDeleteCommand(GroupRequest request)
  {
    Object parent = getHost().getParent().getModel();
    DeleteCommand deleteCmd = new DeleteCommand();
    deleteCmd.setParent((CompoundModel) parent);
    deleteCmd.setChild((NodeModel) getHost().getModel());
    return deleteCmd;
  }
View Full Code Here

TOP

Related Classes of org.gvt.command.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.