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 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 modelCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.