Package org.zkoss.zul.ext
Interface Pageable
-
- All Known Subinterfaces:
PageableModel,Paginal
- All Known Implementing Classes:
AbstractListModel,AbstractTreeModel,DefaultTreeModel,GroupsListModel,ListModelArray,ListModelList,ListModelMap,ListModelSet,MeshElement.InternalPaging,Paging,SimpleListModel
public interface PageableRepresents a component that can be displayed in multiple pages but cannot be controlled by an external paging controller.Paginated: a multi-page component whose pagination is controlled by an external page controller (Paginal).Paginal: the paging controller used to control the pagination ofPaginated.Pageable: a multi-page component that handles pagination by itself.
Note: a component that can be displayed in multiple pages can be implemented in two ways.
1) If it can be controlled by an external paging controller (i.e.,
Paginal), it shall hold an reference to one of the paging controllers. And, it doesn't need to implementPageable. Example: grid, listbox and tree.2) If it cannot be controlled by external controller, it shall implement the
Pageableinterface.- Since:
- 2.4.1
- Author:
- tomyeh
- See Also:
Paginal
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetActivePage()Returns the active page (starting from 0).intgetPageCount()Returns the number of pages.intgetPageSize()Returns the number of items per page.voidsetActivePage(int pg)Sets the active page (starting from 0).voidsetPageSize(int size)Sets the number of items per page.
-
-
-
Method Detail
-
getPageSize
int getPageSize()
Returns the number of items per page.Default: 20.
-
setPageSize
void setPageSize(int size) throws org.zkoss.zk.ui.WrongValueExceptionSets the number of items per page.- Throws:
org.zkoss.zk.ui.WrongValueException
-
getPageCount
int getPageCount()
Returns the number of pages. Note: there is at least one page even no item at all.
-
getActivePage
int getActivePage()
Returns the active page (starting from 0).
-
setActivePage
void setActivePage(int pg) throws org.zkoss.zk.ui.WrongValueExceptionSets the active page (starting from 0).- Throws:
org.zkoss.zk.ui.WrongValueException
-
-