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;
}
Aggregations