|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.model.paging.DefaultPagingModel
public class DefaultPagingModel
The default implementation of a paging model, which stores pages in a simple sorted list.
Constructor Summary | |
---|---|
DefaultPagingModel()
Constructs a new paging model. |
|
DefaultPagingModel(java.util.List<Page> pages)
Constructs a new paging model. |
Method Summary | |
---|---|
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(java.util.List<Page> pages)
Sets several pages at once after clearing the current list of pages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultPagingModel(java.util.List<Page> pages)
pages
- a list of pages to fill the modelpublic DefaultPagingModel()
Method Detail |
---|
public void setPages(java.util.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()
IPagingModel
getPage
in interface IPagingModel
IPagingModel.setPage(Page)
public void setPage(Page page)
IPagingModel
setPage
in interface IPagingModel
page
- the new page to use for displaypublic int getPageCount()
IPagingModel
getPageCount
in interface IPagingModel
IPagingModel.getPage(int)
public Page getPage(int index)
IPagingModel
getPage
in interface IPagingModel
IPagingModel.getPageCount()
public void addPagingModelListener(IPagingModelListener l)
IPagingModel
addPagingModelListener
in interface IPagingModel
l
- the listener to add to the modelpublic void removePagingModelListener(IPagingModelListener l)
IPagingModel
removePagingModelListener
in interface IPagingModel
l
- the listener to remove from the modelprotected void firePageWillChangeEvent(PagingEvent evt) throws PagingVetoException
evt
-
PagingVetoException
protected void firePageChangedEvent(PagingEvent evt)
evt
- the event used for notifying the listeners about a change
within the modelpublic void firstPage()
IPagingModel
firstPage
in interface IPagingModel
public void earlierPage()
IPagingModel
earlierPage
in interface IPagingModel
public void laterPage()
IPagingModel
laterPage
in interface IPagingModel
public void lastPage()
IPagingModel
lastPage
in interface IPagingModel
public boolean hasEarlierPage()
IPagingModel
hasEarlierPage
in interface IPagingModel
IPagingModel.earlierPage()
public boolean hasLaterPage()
IPagingModel
hasLaterPage
in interface IPagingModel
IPagingModel.laterPage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |