|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.model.bookmarks.DefaultBookmarkModel
public class DefaultBookmarkModel
The default implementation of a paging model, which stores pages in a simple sorted list.
Constructor Summary | |
---|---|
DefaultBookmarkModel()
Constructs a new paging model. |
|
DefaultBookmarkModel(java.util.List<Bookmark> pages)
Constructs a new paging model. |
Method Summary | |
---|---|
void |
addBookmark(Bookmark bookmark)
Adds a bookmark to the model causing a BookmarkEvent to be fired. |
void |
addBookmarkModelListener(IBookmarkModelListener l)
Adds a listener to the bookmark model. |
void |
clearBookmarks()
Clears / removes all pages from the model. |
protected void |
fireBookmarksChangedEvent(BookmarkEvent evt)
Sends a paging event to all listeners that are observing the model. |
Bookmark |
getBookmark(int index)
Returns the bookmark for the given index. |
int |
getBookmarkCount()
Returns the total number of bookmarks added to the model. |
void |
removeBookmark(Bookmark bookmark)
Removes a bookmark from the model causing a BookmarkEvent to be
fired. |
void |
removeBookmarkModelListener(IBookmarkModelListener l)
Removes a listener from the bookmark model. |
void |
setBookmarks(java.util.List<Bookmark> 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 DefaultBookmarkModel(java.util.List<Bookmark> pages)
pages
- a list of pages to fill the modelpublic DefaultBookmarkModel()
Method Detail |
---|
public void setBookmarks(java.util.List<Bookmark> pages)
pages
- the list of pages that will be served by the modelclearBookmarks()
,
addBookmark(Bookmark)
public void clearBookmarks()
removeBookmark(Bookmark)
public void addBookmark(Bookmark bookmark)
BookmarkEvent
to be fired.
The ID of the event will be BookmarkEvent.ID.BOOKMARK_ADDED
.
addBookmark
in interface IBookmarkModel
bookmark
- the bookmark that will be added to the modelsetBookmarks(List)
,
removeBookmark(Bookmark)
public void removeBookmark(Bookmark bookmark)
BookmarkEvent
to be
fired. The ID of the event is BookmarkEvent.ID.BOOKMARK_REMOVED
.
removeBookmark
in interface IBookmarkModel
bookmark
- the bookmark that will be removed from the modelclearBookmarks()
,
addBookmark(Bookmark)
public int getBookmarkCount()
IBookmarkModel
getBookmarkCount
in interface IBookmarkModel
IBookmarkModel.getBookmark(int)
public Bookmark getBookmark(int index)
IBookmarkModel
getBookmark
in interface IBookmarkModel
IBookmarkModel.getBookmarkCount()
public void addBookmarkModelListener(IBookmarkModelListener l)
IBookmarkModel
addBookmarkModelListener
in interface IBookmarkModel
l
- the listener to add to the modelpublic void removeBookmarkModelListener(IBookmarkModelListener l)
IBookmarkModel
removeBookmarkModelListener
in interface IBookmarkModel
l
- the listener to remove from the modelprotected void fireBookmarksChangedEvent(BookmarkEvent evt)
evt
- the event used for notifying the listeners about a change
within the model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |