|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.web.action.util.lists.ListPager<T>
public abstract class ListPager<T>
This is a simple pager that can reduce a big list into paged sizes. Its designed for use within webwork actions/jsp in that it is immutable (eg one page per created ListPager) and actions can only really show one page of data per render.
You need to specify the page number you want to go to, the number of rows per page and the full list you want to page.
Constructor Summary | |
---|---|
ListPager(List<T> fullList,
int pageNo,
int rowsPerPage)
Creates a ListPager that pages a list from a certain page number. |
Method Summary | |
---|---|
protected abstract String |
generatePageURL(int targetPageNo,
int rowsPerPage)
Each implementation of this class is expected to generate their own URLS based on the passed in page number |
String |
getEndPageURL()
|
int |
getFromIndex()
|
int |
getFullListSize()
|
List<T> |
getList()
|
String |
getNextPageURL()
|
int |
getPageNumber()
|
String |
getPrevPageURL()
|
int |
getRowsPerPage()
|
String |
getStartPageURL()
|
int |
getToIndex()
|
boolean |
hasMultiplePages()
Returns true if the pager has multiple pages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListPager(List<T> fullList, int pageNo, int rowsPerPage)
fullList
- is the full list of objectpageNo
- is a zero based indexrowsPerPage
- must be > 0Method Detail |
---|
public String getPrevPageURL()
generatePageURL(int, int)
to
generate an URLpublic String getNextPageURL()
generatePageURL(int, int)
to generate
an URLpublic String getStartPageURL()
public String getEndPageURL()
protected abstract String generatePageURL(int targetPageNo, int rowsPerPage)
targetPageNo
- the target page numberrowsPerPage
- the rows per page
public List<T> getList()
public int getPageNumber()
public int getRowsPerPage()
public int getFullListSize()
public int getFromIndex()
public int getToIndex()
public boolean hasMultiplePages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |