Search in sources :

Example 1 with CreateLeafNodeCommand

use of com.cubrid.cubridmanager.ui.replication.editor.commands.CreateLeafNodeCommand in project cubrid-manager by CUBRID.

the class ContainerNodeLayoutEditPolicy method getCreateCommand.

/**
	 * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
	 * @param request the CreateRequest
	 * @return a Command to perform a create
	 * 
	 */
protected Command getCreateCommand(CreateRequest request) {
    if (!(request.getNewObject() instanceof LeafNode)) {
        return null;
    }
    CreateLeafNodeCommand cmd = new CreateLeafNodeCommand();
    cmd.setContainerNode((ContainerNode) getHost().getModel());
    cmd.setLeafNode((LeafNode) request.getNewObject());
    Rectangle constraint = (Rectangle) getConstraintFor(request);
    cmd.setLocation(constraint.getLocation());
    return cmd;
}
Also used : LeafNode(com.cubrid.cubridmanager.ui.replication.editor.model.LeafNode) Rectangle(org.eclipse.draw2d.geometry.Rectangle) CreateLeafNodeCommand(com.cubrid.cubridmanager.ui.replication.editor.commands.CreateLeafNodeCommand)

Aggregations

CreateLeafNodeCommand (com.cubrid.cubridmanager.ui.replication.editor.commands.CreateLeafNodeCommand)1 LeafNode (com.cubrid.cubridmanager.ui.replication.editor.model.LeafNode)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1