|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.displaytag.pagination.SmartListHelper
public class SmartListHelper
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 Summary | |
|---|---|
protected |
SmartListHelper()
Constructor that can be used by subclasses. |
|
SmartListHelper(java.util.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. |
| Method Summary | |
|---|---|
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. |
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. |
java.util.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 java.util.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. |
java.lang.String |
getPageNavigationBar(Href baseHref,
java.lang.String pageParameter)
Returns a string containing the nagivation bar that allows the user to move between pages within the list. |
java.lang.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. |
void |
setCurrentPage(int pageNumber)
Set's the page number that the user is viewing. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SmartListHelper(java.util.List list,
int fullSize,
int itemsInPage,
TableProperties tableProperties,
boolean partialList)
list - ListfullSize - size of the full listitemsInPage - number of items in a page (int > 0)tableProperties - TablePropertiesprotected SmartListHelper()
| Method Detail |
|---|
protected int computedPageCount()
public int getFirstIndexForCurrentPage()
protected int getLastIndexForCurrentPage()
protected int getFirstIndexForPage(int pageNumber)
pageNumber - page number
protected int getLastIndexForPage(int pageNumber)
pageNumber - page number
public java.util.List getListForCurrentPage()
protected java.util.List getListForPage(int pageNumber)
pageNumber - page number
public void setCurrentPage(int pageNumber)
pageNumber - page numberpublic java.lang.String getSearchResultsSummary()
public java.lang.String getPageNavigationBar(Href baseHref,
java.lang.String pageParameter)
baseHref - Href used for linkspageParameter - name for the page parameter
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||