Home » displaytag-1.1.1-src » org » displaytag » pagination » [javadoc | source]
org.displaytag.pagination
public class: SmartListHelper [javadoc | source]
java.lang.Object
   org.displaytag.pagination.SmartListHelper

Direct Known Subclasses:
    PaginatedListSmartListHelper

Utility class that chops up a List of objects into small bite size pieces that are more suitable for display.

This class is a stripped down version of the WebListHelper from Tim Dawson (tdawson@is.com)

Constructor:
 protected SmartListHelper() 
 public SmartListHelper(List list,
    int fullSize,
    int itemsInPage,
    TableProperties tableProperties,
    boolean partialList) 
    Creates a SmarListHelper instance that will help you chop up a list into bite size pieces that are suitable for display.
    Parameters:
    list - List
    fullSize - size of the full list
    itemsInPage - number of items in a page (int > 0)
    tableProperties - TableProperties
Method from org.displaytag.pagination.SmartListHelper Summary:
computedPageCount,   getFirstIndexForCurrentPage,   getFirstIndexForPage,   getLastIndexForCurrentPage,   getLastIndexForPage,   getListForCurrentPage,   getListForPage,   getPageNavigationBar,   getSearchResultsSummary,   setCurrentPage,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.displaytag.pagination.SmartListHelper Detail:
 protected int computedPageCount() 
    Returns the computed number of pages it would take to show all the elements in the list given the pageSize we are working with.
 public int getFirstIndexForCurrentPage() 
    Returns the index into the master list of the first object that should appear on the current page that the user is viewing.
 protected int getFirstIndexForPage(int pageNumber) 
    Returns the index into the master list of the first object that should appear on the given page.
 protected int getLastIndexForCurrentPage() 
    Returns the index into the master list of the last object that should appear on the current page that the user is viewing.
 protected int getLastIndexForPage(int pageNumber) 
    Returns the index into the master list of the last object that should appear on the given page.
 public List getListForCurrentPage() 
    Returns a subsection of the list that contains just the elements that are supposed to be shown on the current page the user is viewing.
 protected List getListForPage(int pageNumber) 
    Returns a subsection of the list that contains just the elements that are supposed to be shown on the given page.
 public String getPageNavigationBar(Href baseHref,
    String pageParameter) 
    Returns a string containing the nagivation bar that allows the user to move between pages within the list. The urlFormatString should be a URL that looks like the following: somepage.page?page={0}
 public String getSearchResultsSummary() 
    Return the little summary message that lets the user know how many objects are in the list they are viewing, and where in the list they are currently positioned. The message looks like: nnn [item(s)] found, displaying nnn to nnn. [item(s)] is replaced by either itemName or itemNames depending on if it should be signular or plural.
 public  void setCurrentPage(int pageNumber) 
    Set's the page number that the user is viewing.
 public String toString()