public class DefaultPagingModel extends Object implements IPagingModel
| Constructor and Description |
|---|
DefaultPagingModel()
Constructs a new paging model.
|
DefaultPagingModel(List<Page> pages)
Constructs a new paging model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPage(Page page)
Adds a page to the model causing a
PagingEvent to be fired. |
void |
addPagingModelListener(IPagingModelListener l)
Adds a listener to the paging model.
|
void |
clearPages()
Clears / removes all pages from the model.
|
void |
earlierPage()
Goto the next page that has a smaller start time than the currently used
page.
|
protected void |
firePageChangedEvent(PagingEvent evt)
Sends a paging event to all listeners that are observing the model.
|
protected void |
firePageWillChangeEvent(PagingEvent evt) |
void |
firstPage()
Goto the first page.
|
Page |
getPage()
Returns the currently used page.
|
Page |
getPage(int index)
Returns the page for the given index.
|
int |
getPageCount()
Returns the total number of pages added to the model.
|
boolean |
hasEarlierPage()
Determines if the model has a page that starts earlier than the currently
used page.
|
boolean |
hasLaterPage()
Determines if the model has a page that starts later than the currently
used page.
|
void |
lastPage()
Goto the last page.
|
void |
laterPage()
Goto the next page that has a larger start time than the currently used
page.
|
void |
removePage(Page page)
Removes a page from the model causing a
PagingEvent to be fired. |
void |
removePagingModelListener(IPagingModelListener l)
Removes a listener from the paging model.
|
void |
setPage(Page page)
Sets a new page to be used.
|
void |
setPages(List<Page> pages)
Sets several pages at once after clearing the current list of pages.
|
public DefaultPagingModel(List<Page> pages)
pages - a list of pages to fill the modelpublic DefaultPagingModel()
public void setPages(List<Page> pages)
pages - the list of pages that will be served by the modelclearPages(),
addPage(Page)public void clearPages()
removePage(Page)public void addPage(Page page)
PagingEvent to be fired. The
ID of the event will be PagingEvent.ID.PAGE_ADDED.page - the page that will be added to the modelsetPages(List),
removePage(Page)public void removePage(Page page)
PagingEvent to be fired.
The ID of the event will be PagingEvent.ID.PAGE_REMOVED.page - the page that will be removed from the modelclearPages(),
addPage(Page)public Page getPage()
IPagingModelgetPage in interface IPagingModelIPagingModel.setPage(Page)public void setPage(Page page)
IPagingModelsetPage in interface IPagingModelpage - the new page to use for displaypublic int getPageCount()
IPagingModelgetPageCount in interface IPagingModelIPagingModel.getPage(int)public Page getPage(int index)
IPagingModelgetPage in interface IPagingModelIPagingModel.getPageCount()public void addPagingModelListener(IPagingModelListener l)
IPagingModeladdPagingModelListener in interface IPagingModell - the listener to add to the modelpublic void removePagingModelListener(IPagingModelListener l)
IPagingModelremovePagingModelListener in interface IPagingModell - the listener to remove from the modelprotected void firePageWillChangeEvent(PagingEvent evt) throws PagingVetoException
evt - PagingVetoExceptionprotected void firePageChangedEvent(PagingEvent evt)
evt - the event used for notifying the listeners about a change
within the modelpublic void firstPage()
IPagingModelfirstPage in interface IPagingModelpublic void earlierPage()
IPagingModelearlierPage in interface IPagingModelpublic void laterPage()
IPagingModellaterPage in interface IPagingModelpublic void lastPage()
IPagingModellastPage in interface IPagingModelpublic boolean hasEarlierPage()
IPagingModelhasEarlierPage in interface IPagingModelIPagingModel.earlierPage()public boolean hasLaterPage()
IPagingModelhasLaterPage in interface IPagingModelIPagingModel.laterPage()Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.