Interface Pagination
-
- All Superinterfaces:
SimpleGraphicElement
- All Known Implementing Classes:
AbstractPagination
,PaginationSP
public interface Pagination extends SimpleGraphicElement
Pagination is an interface to be implemented by a graphic element to print a pages index or a elements counter.- Author:
- neysseri
-
-
Field Summary
Fields Modifier and Type Field Description static String
INDEX_PARAMETER_NAME
static String
ITEMS_PER_PAGE_PARAM
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getFirstItemIndex()
int
getIndexForCurrentPage()
int
getIndexForDirectPage(int page)
int
getIndexForNextPage()
int
getIndexForPreviousPage()
int
getLastItemIndex()
int
getNbItems()
default <T> SilverpeasList<T>
getPaginatedListFrom(List<T> list)
static PaginationPage
getPaginationPageFrom(Map<String,String> params, PaginationPage currentPagination)
Gets a new pagination page instance from given parameters and current pagination.static PaginationPage
getPaginationPageFrom(javax.portlet.RenderRequest request, PaginationPage currentPagination)
Gets a new pagination page instance from given request and current pagination.static PaginationPage
getPaginationPageFrom(javax.servlet.http.HttpServletRequest request, PaginationPage currentPagination)
Gets a new pagination page instance from given request and current pagination.default org.apache.commons.lang3.tuple.Pair<Integer,Integer>
getStartLastIndexes()
Gets the start index and the last index.void
init(int nbItems, int nbItemsPerPage, int firstItemIndex)
boolean
isLastPage()
String
printCounter()
Method declarationString
printIndex()
Method declarationString
printIndex(String text)
String
printIndex(String text, boolean nbItemsPerPage)
void
setActionSuffix(String actionSuffix)
void
setAltNextPage(String text)
void
setAltPreviousPage(String text)
void
setBaseURL(String baseUrl)
void
setMultilang(org.silverpeas.kernel.bundle.LocalizationBundle multilang)
-
Methods inherited from interface org.silverpeas.core.web.util.viewgenerator.html.SimpleGraphicElement
print
-
-
-
-
Field Detail
-
ITEMS_PER_PAGE_PARAM
static final String ITEMS_PER_PAGE_PARAM
- See Also:
- Constant Field Values
-
INDEX_PARAMETER_NAME
static final String INDEX_PARAMETER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPaginationPageFrom
static PaginationPage getPaginationPageFrom(javax.portlet.RenderRequest request, PaginationPage currentPagination)
Gets a new pagination page instance from given request and current pagination.If current pagination is null, a default one is taken into account
- Parameters:
request
- the request.currentPagination
- the current pagination.- Returns:
- the new pagination page.
-
getPaginationPageFrom
static PaginationPage getPaginationPageFrom(javax.servlet.http.HttpServletRequest request, PaginationPage currentPagination)
Gets a new pagination page instance from given request and current pagination.If current pagination is null, a default one is taken into account
- Parameters:
request
- the request.currentPagination
- the current pagination.- Returns:
- the new pagination page.
-
getPaginationPageFrom
static PaginationPage getPaginationPageFrom(Map<String,String> params, PaginationPage currentPagination)
Gets a new pagination page instance from given parameters and current pagination.If current pagination is null, a default one is taken into account
- Parameters:
params
- the pagination params.currentPagination
- the current pagination.- Returns:
- the new pagination page.
-
getStartLastIndexes
default org.apache.commons.lang3.tuple.Pair<Integer,Integer> getStartLastIndexes()
Gets the start index and the last index.- Returns:
- the indexes.
-
getPaginatedListFrom
default <T> SilverpeasList<T> getPaginatedListFrom(List<T> list)
-
init
void init(int nbItems, int nbItemsPerPage, int firstItemIndex)
-
setAltPreviousPage
void setAltPreviousPage(String text)
-
setAltNextPage
void setAltNextPage(String text)
-
setActionSuffix
void setActionSuffix(String actionSuffix)
-
getIndexForPreviousPage
int getIndexForPreviousPage()
-
getIndexForDirectPage
int getIndexForDirectPage(int page)
-
getIndexForCurrentPage
int getIndexForCurrentPage()
-
getIndexForNextPage
int getIndexForNextPage()
-
isLastPage
boolean isLastPage()
-
printIndex
String printIndex()
Method declaration- Returns:
-
getNbItems
int getNbItems()
-
getFirstItemIndex
int getFirstItemIndex()
-
getLastItemIndex
int getLastItemIndex()
-
printCounter
String printCounter()
Method declaration- Returns:
-
setBaseURL
void setBaseURL(String baseUrl)
-
setMultilang
void setMultilang(org.silverpeas.kernel.bundle.LocalizationBundle multilang)
-
-