Package fr.paris.lutece.util.html
Class AbstractPaginator<E>
- java.lang.Object
-
- fr.paris.lutece.util.html.AbstractPaginator<E>
-
- Type Parameters:
E- the type
- All Implemented Interfaces:
IPaginator<E>,java.io.Serializable
- Direct Known Subclasses:
DelegatePaginator,Paginator
public abstract class AbstractPaginator<E> extends java.lang.Object implements IPaginator<E>
Abstract Paginator- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLABEL_FIRSTstatic java.lang.StringLABEL_LASTstatic java.lang.StringLABEL_NEXTstatic java.lang.StringLABEL_PREVIOUSstatic java.lang.StringPARAMETER_ITEMS_PER_PAGEDefault value for Items Per Page Parameterstatic java.lang.StringPARAMETER_PAGE_INDEXDefault value for Page Index Parameter
-
Constructor Summary
Constructors Constructor Description AbstractPaginator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFirstPageLink()Returns the previous page linkintgetItemsCount()Returns the number of items in the collectionintgetItemsPerPage()Gets the items count per page.static intgetItemsPerPage(javax.servlet.http.HttpServletRequest request, java.lang.String strParameter, int nCurrent, int nDefault)Gets the number of items per page from a request parameterjava.lang.StringgetItemsPerPageParameterName()Get the parameter name of theitems_per_pagejava.lang.StringgetLabelFirst()Get First labeljava.lang.StringgetLabelItemCount()Get Item Count labeljava.lang.StringgetLabelItemCountPerPage()Get Item Count per page labeljava.lang.StringgetLabelLast()Get First labeljava.lang.StringgetLabelNext()Get Next labeljava.lang.StringgetLabelPrevious()Get Previous labeljava.lang.StringgetLastPageLink()Returns the previous page linkjava.lang.StringgetNextPageLink()Returns the previous page linkintgetPageCurrent()Returns the current page indexstatic java.lang.StringgetPageIndex(javax.servlet.http.HttpServletRequest request, java.lang.String strParameter, java.lang.String strCurrentPageIndex)Gets the new page index from a request parameterintgetPagesCount()Gets the number of pagesjava.util.List<PaginatorPage>getPagesLinks()Returns Pages Linksjava.lang.StringgetPreviousPageLink()Returns the previous page linkintgetRangeMax()Returns the index of the last item of the current page rangeintgetRangeMin()Returns the index of the first item of the current page rangevoidsetItemsPerPageParameterName(java.lang.String strItemsPerPageParameterName)Set the parameter name of theitems_per_page-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.paris.lutece.util.html.IPaginator
getPageItems
-
-
-
-
Field Detail
-
PARAMETER_PAGE_INDEX
public static final java.lang.String PARAMETER_PAGE_INDEX
Default value for Page Index Parameter- See Also:
- Constant Field Values
-
PARAMETER_ITEMS_PER_PAGE
public static final java.lang.String PARAMETER_ITEMS_PER_PAGE
Default value for Items Per Page Parameter- See Also:
- Constant Field Values
-
LABEL_FIRST
public static final java.lang.String LABEL_FIRST
- See Also:
- Constant Field Values
-
LABEL_PREVIOUS
public static final java.lang.String LABEL_PREVIOUS
- See Also:
- Constant Field Values
-
LABEL_NEXT
public static final java.lang.String LABEL_NEXT
- See Also:
- Constant Field Values
-
LABEL_LAST
public static final java.lang.String LABEL_LAST
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPageCurrent
public int getPageCurrent()
Returns the current page index- Specified by:
getPageCurrentin interfaceIPaginator<E>- Returns:
- The current page index
-
getFirstPageLink
public java.lang.String getFirstPageLink()
Returns the previous page link- Specified by:
getFirstPageLinkin interfaceIPaginator<E>- Returns:
- The previous page link
-
getPreviousPageLink
public java.lang.String getPreviousPageLink()
Returns the previous page link- Specified by:
getPreviousPageLinkin interfaceIPaginator<E>- Returns:
- The previous page link
-
getLastPageLink
public java.lang.String getLastPageLink()
Returns the previous page link- Specified by:
getLastPageLinkin interfaceIPaginator<E>- Returns:
- The previous page link
-
getItemsPerPage
public int getItemsPerPage()
Gets the items count per page.- Specified by:
getItemsPerPagein interfaceIPaginator<E>- Returns:
- items count per page.
-
getNextPageLink
public java.lang.String getNextPageLink()
Returns the previous page link- Specified by:
getNextPageLinkin interfaceIPaginator<E>- Returns:
- The previous page link
-
getPagesLinks
public java.util.List<PaginatorPage> getPagesLinks()
Returns Pages Links- Specified by:
getPagesLinksin interfaceIPaginator<E>- Returns:
- Pages Links
-
getLabelFirst
public java.lang.String getLabelFirst()
Get First label- Specified by:
getLabelFirstin interfaceIPaginator<E>- Returns:
- The Label
-
getLabelPrevious
public java.lang.String getLabelPrevious()
Get Previous label- Specified by:
getLabelPreviousin interfaceIPaginator<E>- Returns:
- The Label
-
getLabelNext
public java.lang.String getLabelNext()
Get Next label- Specified by:
getLabelNextin interfaceIPaginator<E>- Returns:
- The Label
-
getLabelLast
public java.lang.String getLabelLast()
Get First label- Specified by:
getLabelLastin interfaceIPaginator<E>- Returns:
- The Label
-
getLabelItemCount
public java.lang.String getLabelItemCount()
Get Item Count label- Specified by:
getLabelItemCountin interfaceIPaginator<E>- Returns:
- The Label
-
getLabelItemCountPerPage
public java.lang.String getLabelItemCountPerPage()
Get Item Count per page label- Specified by:
getLabelItemCountPerPagein interfaceIPaginator<E>- Returns:
- The Label
-
getItemsPerPageParameterName
public java.lang.String getItemsPerPageParameterName()
Get the parameter name of theitems_per_page- Specified by:
getItemsPerPageParameterNamein interfaceIPaginator<E>- Returns:
- the parameter name
-
setItemsPerPageParameterName
public void setItemsPerPageParameterName(java.lang.String strItemsPerPageParameterName)
Set the parameter name of theitems_per_page- Specified by:
setItemsPerPageParameterNamein interfaceIPaginator<E>- Parameters:
strItemsPerPageParameterName- the parameter name
-
getPagesCount
public int getPagesCount()
Gets the number of pages- Specified by:
getPagesCountin interfaceIPaginator<E>- Returns:
- the number of pages
-
getRangeMin
public int getRangeMin()
Returns the index of the first item of the current page range- Specified by:
getRangeMinin interfaceIPaginator<E>- Returns:
- The index of the first item of the current page range
-
getRangeMax
public int getRangeMax()
Returns the index of the last item of the current page range- Specified by:
getRangeMaxin interfaceIPaginator<E>- Returns:
- The index of the last item of the current page range
-
getItemsCount
public int getItemsCount()
Returns the number of items in the collection- Specified by:
getItemsCountin interfaceIPaginator<E>- Returns:
- The number of items in the collection
-
getItemsPerPage
public 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- Parameters:
request- The HTTP requeststrParameter- The request parameter namenCurrent- The current number of itemsnDefault- The default number of items- Returns:
- The new number of items
-
getPageIndex
public 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- Parameters:
request- The HTTP requeststrParameter- The request parameter namestrCurrentPageIndex- The current page index- Returns:
- The new page index
-
-