public class Pagination extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RESULTS |
static String |
DEFAULT_POSITION |
static String |
PARAMETER_CURRENT_PAGE |
static String |
POSITION_TOP |
static String |
PROPERTY_MAX_RESULTS |
static String |
PROPERTY_POSITION |
Modifier | Constructor and Description |
---|---|
protected |
Pagination() |
|
Pagination(String link,
Collection items,
javax.jcr.Node content) |
Modifier and Type | Method and Description |
---|---|
int |
getBeginIndex()
Returns the index to be displayed before the current page.
|
int |
getCount() |
int |
getCurrentPage()
Returns the current page (according to the GET parameters value, see
PARAMETER_CURRENT_PAGE , or 1). |
int |
getEndIndex()
Returns the index to be displayed after the current page.
|
int |
getNumPages()
Returns the number of pages.
|
protected int |
getOffset()
Return the current offset.
|
Collection |
getPageItems()
Returns a sub-
List of all items from offset (see getOffset() ) to limit (calculated
from max results per page and the before mentioned offset). |
String |
getPageLink(int i)
Returns a link the n-th page.
|
String |
getPosition()
Returns the current position of the pagination element (see
DEFAULT_POSITION , POSITION_TOP ). |
protected void |
setCount(int count) |
protected void |
setResults(int maxResultsPerPage) |
public static final String PARAMETER_CURRENT_PAGE
public static final String PROPERTY_MAX_RESULTS
public static final String PROPERTY_POSITION
public static final String POSITION_TOP
public static final String DEFAULT_POSITION
public static final int DEFAULT_MAX_RESULTS
public Pagination(String link, Collection items, javax.jcr.Node content)
protected Pagination()
protected void setResults(int maxResultsPerPage)
protected void setCount(int count)
public int getCount()
public Collection getPageItems()
List
of all items from offset (see getOffset()
) to limit (calculated
from max results per page and the before mentioned offset).protected int getOffset()
public int getCurrentPage()
PARAMETER_CURRENT_PAGE
, or 1).public String getPageLink(int i)
public int getNumPages()
public int getBeginIndex()
public int getEndIndex()
public String getPosition()
DEFAULT_POSITION
, POSITION_TOP
).Copyright © 2017 Magnolia International Ltd.. All rights reserved.