public class Pagination extends java.lang.Object implements IPagination
| Modifier and Type | Class and Description |
|---|---|
static interface |
Pagination.OnTableViewPageTurnedListener
Listener interface for changing of TableView page.
|
| Constructor and Description |
|---|
Pagination(ITableView tableView)
Basic constructor, TableView instance is required.
|
Pagination(ITableView tableView,
int itemsPerPage)
Applies pagination to the supplied TableView with number of items per page.
|
Pagination(ITableView tableView,
int itemsPerPage,
Pagination.OnTableViewPageTurnedListener listener)
Applies pagination to the supplied TableView with number of items per page and an
OnTableViewPageTurnedListener for handling changes in the TableView pagination.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrentPage() |
int |
getItemsPerPage() |
int |
getPageCount() |
void |
goToPage(int page)
Loads the data set of the specified page to the table view.
|
boolean |
isPaginated() |
void |
nextPage()
Loads the next page of the data set to the table view.
|
void |
previousPage()
Loads the previous page of the data set to the table view.
|
void |
removeOnTableViewPageTurnedListener()
Removes the OnTableViewPageTurnedListener for this Pagination.
|
void |
setItemsPerPage(int numItems)
Sets the number of items (rows) per page to be displayed in the table view.
|
void |
setOnTableViewPageTurnedListener(Pagination.OnTableViewPageTurnedListener onTableViewPageTurnedListener)
Sets the OnTableViewPageTurnedListener for this Pagination.
|
public Pagination(@NonNull
ITableView tableView)
tableView - The TableView to be paginated.public Pagination(@NonNull
ITableView tableView,
int itemsPerPage)
tableView - The TableView to be paginated.itemsPerPage - The number of items per page.public Pagination(@NonNull
ITableView tableView,
int itemsPerPage,
@Nullable
Pagination.OnTableViewPageTurnedListener listener)
tableView - The TableView to be paginated.itemsPerPage - The number of items per page.listener - The OnTableViewPageTurnedListener for the TableView.public void nextPage()
IPaginationnextPage in interface IPaginationpublic void previousPage()
IPaginationpreviousPage in interface IPaginationpublic void goToPage(int page)
IPaginationgoToPage in interface IPaginationpage - The page to be loaded.public void setItemsPerPage(int numItems)
IPaginationsetItemsPerPage in interface IPaginationnumItems - The number of items per page.public void setOnTableViewPageTurnedListener(@Nullable
Pagination.OnTableViewPageTurnedListener onTableViewPageTurnedListener)
IPaginationsetOnTableViewPageTurnedListener in interface IPaginationonTableViewPageTurnedListener - The OnTableViewPageTurnedListener.public void removeOnTableViewPageTurnedListener()
IPaginationremoveOnTableViewPageTurnedListener in interface IPaginationpublic int getCurrentPage()
getCurrentPage in interface IPaginationpublic int getItemsPerPage()
getItemsPerPage in interface IPaginationpublic int getPageCount()
getPageCount in interface IPaginationpublic boolean isPaginated()
isPaginated in interface IPagination