public class DefaultBookmarkModel extends Object implements IBookmarkModel
| Constructor and Description |
|---|
DefaultBookmarkModel()
Constructs a new paging model.
|
DefaultBookmarkModel(List<Bookmark> pages)
Constructs a new paging model.
|
| Modifier and Type | Method and Description |
|---|---|
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(List<Bookmark> pages)
Sets several pages at once after clearing the current list of pages.
|
public DefaultBookmarkModel(List<Bookmark> pages)
pages - a list of pages to fill the modelpublic DefaultBookmarkModel()
public void setBookmarks(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 IBookmarkModelbookmark - 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 IBookmarkModelbookmark - the bookmark that will be removed from the modelclearBookmarks(),
addBookmark(Bookmark)public int getBookmarkCount()
IBookmarkModelgetBookmarkCount in interface IBookmarkModelIBookmarkModel.getBookmark(int)public Bookmark getBookmark(int index)
IBookmarkModelgetBookmark in interface IBookmarkModelIBookmarkModel.getBookmarkCount()public void addBookmarkModelListener(IBookmarkModelListener l)
IBookmarkModeladdBookmarkModelListener in interface IBookmarkModell - the listener to add to the modelpublic void removeBookmarkModelListener(IBookmarkModelListener l)
IBookmarkModelremoveBookmarkModelListener in interface IBookmarkModell - the listener to remove from the modelprotected void fireBookmarksChangedEvent(BookmarkEvent evt)
evt - the event used for notifying the listeners about a change
within the modelCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.