|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.html.Paginator
public class Paginator
Paginator provides a way to display a collection of items on severals pages.
Field Summary | |
---|---|
static java.lang.String |
PARAMETER_ITEMS_PER_PAGE
Default value for Items Per Page Parameter |
static java.lang.String |
PARAMETER_PAGE_INDEX
Default value for Page Index Parameter |
Constructor Summary | |
---|---|
Paginator(java.util.List list,
int nItemPerPage,
java.lang.String strBaseUrl,
java.lang.String strPageIndexParameterName,
java.lang.String strPageIndex)
Creates a new instance of Paginator |
Method Summary | |
---|---|
java.lang.String |
getFirstPageLink()
Returns the previous page link |
int |
getItemsCount()
Returns the number of items in the collection |
static int |
getItemsPerPage(javax.servlet.http.HttpServletRequest request,
java.lang.String strParameter,
int nCurrent,
int nDefault)
Gets the number of items per page from a request parameter |
java.lang.String |
getLastPageLink()
Returns the previous page link |
java.lang.String |
getNextPageLink()
Returns the previous page link |
int |
getPageCurrent()
Returns the current page index |
static java.lang.String |
getPageIndex(javax.servlet.http.HttpServletRequest request,
java.lang.String strParameter,
java.lang.String strCurrentPageIndex)
Gets the new page index from a request parameter |
java.util.List |
getPageItems()
Returns the List |
int |
getPagesCount()
Gets the number of pages |
java.util.List<PaginatorPage> |
getPagesLinks()
Returns Pages Links |
java.lang.String |
getPreviousPageLink()
Returns the previous page link |
int |
getRangeMax()
Returns the index of the last item of the current page range |
int |
getRangeMin()
Returns the index of the first item of the current page range |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAMETER_PAGE_INDEX
public static final java.lang.String PARAMETER_ITEMS_PER_PAGE
Constructor Detail |
---|
public Paginator(java.util.List list, int nItemPerPage, java.lang.String strBaseUrl, java.lang.String strPageIndexParameterName, java.lang.String strPageIndex)
list
- The collection to paginatenItemPerPage
- Number of items to display per pagestrBaseUrl
- The base Url for build links on each page linkstrPageIndexParameterName
- The parameter name for the page indexstrPageIndex
- The current page indexMethod Detail |
---|
public final int getPagesCount()
public java.util.List getPageItems()
public int getPageCurrent()
public java.lang.String getFirstPageLink()
public java.lang.String getPreviousPageLink()
public java.lang.String getLastPageLink()
public java.lang.String getNextPageLink()
public java.util.List<PaginatorPage> getPagesLinks()
public int getRangeMin()
public int getRangeMax()
public int getItemsCount()
public static int getItemsPerPage(javax.servlet.http.HttpServletRequest request, java.lang.String strParameter, int nCurrent, int nDefault)
request
- The HTTP requeststrParameter
- The request parameter namenCurrent
- The current number of itemsnDefault
- The default number of items
public static java.lang.String getPageIndex(javax.servlet.http.HttpServletRequest request, java.lang.String strParameter, java.lang.String strCurrentPageIndex)
request
- The HTTP requeststrParameter
- The request parameter namestrCurrentPageIndex
- The current page index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |