Example usage for org.springframework.beans.support PagedListHolder setMaxLinkedPages

List of usage examples for org.springframework.beans.support PagedListHolder setMaxLinkedPages

Introduction

In this page you can find the example usage for org.springframework.beans.support PagedListHolder setMaxLinkedPages.

Prototype

public void setMaxLinkedPages(int maxLinkedPages) 

Source Link

Document

Set the maximum number of page links to a few pages around the current one.

Usage

From source file:es.itecban.deployment.executionmanager.gui.swf.service.CommonCreationManager.java

public void findListDeploymentUnitsPaginated(RequestContext context) {

    Calendar list = Calendar.getInstance();
    PagedListHolder duList = null;
    String lock = "selectEnvironment_lock";
    synchronized (lock) {
        if (context.getCurrentEvent().getId().equals("findDeploymentUnit")) {
            duList = new PagedListHolder(Arrays.asList(this.findDeploymentUnit(context)));
        } else if (context.getCurrentEvent().getId().equals("findDeploymentUnitByName")) {
            duList = new PagedListHolder(Arrays.asList(this.findDeploymentUnitByName(context)));
        } else if (context.getCurrentEvent().getId().equals("viewAllAvailableDeploymentUnits")) {
            duList = new PagedListHolder(Arrays.asList(this.findAllAvailableDeploymentUnits(context)));
        } else if (context.getCurrentEvent().getId().equals("findDeploymentUnitByResource")) {
            duList = new PagedListHolder(Arrays.asList(this.findDeploymentUnitByResource(context)));
        } else if (context.getCurrentEvent().getId().equals("paginatedListDU")) {
            duList = (PagedListHolder) context.getFlowScope().get("availableDeploymentUnits",
                    PagedListHolder.class);
        }/*  ww  w.  ja v a 2 s. c o m*/

        if (duList != null) {
            if (context.getRequestParameters().get("p") != null) {
                duList.setPage(Integer.parseInt(context.getRequestParameters().get("p")));
            }
        }

        duList.setMaxLinkedPages(50);
        duList.setPageSize(10);
        Calendar list2 = Calendar.getInstance();
        Utils.getTimeOfExecution(list, list2, "Time of executing getUnitList: ");
        context.getFlowScope().put(Constants.FLOW_DEPLOYMENT_UNIT_LIST, duList);
    }
    lock = null;
}