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

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

Introduction

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

Prototype

public int getNrOfElements() 

Source Link

Document

Return the total number of elements in the source list.

Usage

From source file:de.iteratec.iteraplan.presentation.dialog.GuiSearchController.java

/**
 * Calculates/sets the page size and calls further calculation, if a navigation action has been performed. 
 *//*  w  w  w  .j  a  v a  2  s  .  com*/
private void performPaginationCalculation(T dialogMemory, PagedListHolder<?> results) {

    int pageSize = (dialogMemory.getPageSize() > 0) ? dialogMemory.getPageSize() : results.getNrOfElements();
    results.setPageSize(pageSize);

    if (dialogMemory.isNextPageToShow() != null && dialogMemory.isNextPageToShow().booleanValue()) {

        // for navigation actions with changed page number (e.g. goto first, last, next, previous, column sort)
        choosePageToShow(dialogMemory, results);
    } else {
        results.setPage(dialogMemory.getCurrentPageNumber());
    }
}