|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.click.control.AbstractControl
net.sf.clickclick.control.paginator.SimplePaginator
public class SimplePaginator
Provides a simple independent paginator control.
The Paginator is based on the following article: http://woork.blogspot.com/2008/03/perfect-pagination-style-using-css.html.
| Field Summary | |
|---|---|
protected ActionLink |
controlLink
The link to render. |
protected int |
itemsPerPage
|
protected int |
lowerBound
Indicates the lower bound for rendering paging links. |
static String |
PAGE
The control ActionLink page number parameter name: "page". |
protected String |
styleClass
The css style class, default is "pagination-digg". |
protected int |
totalItems
|
protected int |
upperBound
Indicates the upper bound for rendering paging links. |
| Fields inherited from class org.apache.click.control.AbstractControl |
|---|
actionListener, attributes, behaviors, headElements, listener, listenerMethod, messages, name, parent, styles |
| Fields inherited from interface org.apache.click.Control |
|---|
CONTROL_MESSAGES |
| Constructor Summary | |
|---|---|
SimplePaginator()
Create a default SimplePaginator. |
|
SimplePaginator(String name)
Create a SimplePaginator for the given name. |
|
| Method Summary | |
|---|---|
protected void |
calcLowerAndUpperBound()
Calculate the lowerBound and upperBound values. |
ActionLink |
getControlLink()
Return the page link. |
int |
getCurrentPage()
Return the current page value. |
int |
getFirstItem()
Return the index of the first item to display. |
String |
getFirstLabelMessage()
Return the label of the first page link. |
String |
getFirstTitleMessage()
Return the title of the first page link. |
String |
getGotoPageTitleMessage()
Return the title of the page link. |
List<Element> |
getHeadElements()
Return the following head elements for the paginator: "/clickclick/core/paginator/SimplePaginator.css" |
int |
getItemsPerPage()
|
int |
getLastItem()
Return the index of the last item to display. |
String |
getLastLabelMessage()
Return the label of the last page link. |
String |
getLastTitleMessage()
Return the title of the last page link. |
String |
getNextLabelMessage()
Return the label of the next page link. |
String |
getNextTitleMessage()
Return the title of the next page link. |
int |
getPageTotal()
Return the total number of pages. |
String |
getPreviousLabelMessage()
Return the label of the previous page link. |
String |
getPreviousTitleMessage()
Return the title of the previous page link. |
int |
getTotalItems()
|
void |
onDestroy()
|
void |
render(HtmlStringBuffer buffer)
Render the paginator output to the specified buffer. |
protected void |
renderFirst(HtmlStringBuffer buffer)
Render the first paginator link. |
protected void |
renderLast(HtmlStringBuffer buffer)
Render the last paginator link. |
protected void |
renderNext(HtmlStringBuffer buffer)
Render the next paginator link. |
protected void |
renderPagingLink(HtmlStringBuffer buffer,
int pageNumber)
Render the page link for the given page number. |
protected void |
renderPagingLinkContainer(HtmlStringBuffer buffer,
int pageNumber)
Render the page link container. |
protected void |
renderPagingLinkSeparator(HtmlStringBuffer buffer)
Render a separator between page links. |
protected void |
renderPrevious(HtmlStringBuffer buffer)
Render the previous paginator link. |
void |
setClass(String value)
Set the HTML class attribute. |
void |
setControlLink(ActionLink controlLink)
Set the page link. |
void |
setCurrentPage(int currentPage)
Set the current page value. |
void |
setItemsPerPage(int itemsPerPage)
Set the number of items per page. |
void |
setTotalItems(int totalItems)
Set the total number of items the paginator is presenting. |
String |
toString()
Render the HTML representation of the paginator. |
| Methods inherited from class org.apache.click.control.AbstractControl |
|---|
addBehavior, addStyleClass, appendAttributes, dispatchActionEvent, getActionListener, getAttribute, getAttributes, getBehaviors, getContext, getControlSizeEst, getCssSelector, getHtmlImports, getId, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, getTag, hasAttribute, hasAttributes, hasBehaviors, hasStyles, isAjaxTarget, onDeploy, onInit, onProcess, onRender, removeBehavior, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setListener, setName, setParent, setStyle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PAGE
protected int lowerBound
protected int upperBound
protected String styleClass
protected ActionLink controlLink
protected int totalItems
protected int itemsPerPage
| Constructor Detail |
|---|
public SimplePaginator()
public SimplePaginator(String name)
name - the name of the paginator| Method Detail |
|---|
public String getFirstTitleMessage()
public String getFirstLabelMessage()
public String getLastTitleMessage()
public String getLastLabelMessage()
public String getNextTitleMessage()
public String getNextLabelMessage()
public String getPreviousTitleMessage()
public String getPreviousLabelMessage()
public String getGotoPageTitleMessage()
public void setControlLink(ActionLink controlLink)
pageLink - the page linkpublic ActionLink getControlLink()
public void setClass(String value)
value - the HTML class attributepublic void setCurrentPage(int currentPage)
setCurrentPage in interface PaginatorcurrentPage - the current page valuepublic int getCurrentPage()
getCurrentPage in interface Paginatorpublic int getPageTotal()
public int getTotalItems()
public void setTotalItems(int totalItems)
Paginator
setTotalItems in interface PaginatortotalItems - the totalItems to setpublic int getItemsPerPage()
public void setItemsPerPage(int itemsPerPage)
Paginator
setItemsPerPage in interface PaginatoritemsPerPage - the itemsPerPage to setpublic int getFirstItem()
items per page must be set for
this method to correctly calculate the first item index, otherwise this
method will return 0.
public int getLastItem()
total items and
items per page must be set for this method to
correctly calculate the last item, otherwise this method will return 0.
public List<Element> getHeadElements()
getHeadElements in interface ControlgetHeadElements in class AbstractControlpublic void onDestroy()
onDestroy in interface ControlonDestroy in class AbstractControlpublic void render(HtmlStringBuffer buffer)
render in interface Controlrender in interface Renderablerender in class AbstractControlbuffer - the buffer to render output topublic String toString()
toString in class AbstractControl
protected void renderPagingLinkContainer(HtmlStringBuffer buffer,
int pageNumber)
buffer - the buffer to render topageNumber - the page number of the page link to render
protected void renderPagingLink(HtmlStringBuffer buffer,
int pageNumber)
buffer - the buffer to render topageNumber - the page number of the page link to renderprotected void renderPagingLinkSeparator(HtmlStringBuffer buffer)
buffer - the buffer to render toprotected void renderFirst(HtmlStringBuffer buffer)
buffer - the buffer to render toprotected void renderPrevious(HtmlStringBuffer buffer)
buffer - the buffer to render toprotected void renderLast(HtmlStringBuffer buffer)
buffer - the buffer to render toprotected void renderNext(HtmlStringBuffer buffer)
buffer - the buffer to render toprotected void calcLowerAndUpperBound()
lowerBound and upperBound values.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||