Interface BookmarkList
public interface BookmarkList
The client side
BookmarkList holds client side Bookmark-objects and provides some
basic access methods.
The list is stored on the client side in the properties of the document (
PropertiesProvider.getProperties()) under the key PROPERTY_KEY_BOOKMARK_LIST.
Client side bookmarks can be created via BookmarkFactory (webtoolkit-client)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given bookmark to the listvoidAdds a property change listener to this bookmark list to receive events when bookmark entries are added or deleted.voidclear()Removes allBookmarks from this list.getAll()Returns a list of allBookmarks.getBookmarkAfterPage(Document document, Page page) Returns the nextBookmarkafter the given page.getBookmarkBeforePage(Document document, Page page) Returns the previousBookmarkfrom a page before the given page.getBookmarkOnPage(Document document, Page page) Returns theBookmarkof the given page.getFirstBookmark(Document document) Returns the firstBookmarkof the document.getLastBookmark(Document document) Returns the lastBookmarkof the document.getNextBookmark(Bookmark bookmark) Returns the nextBookmarkafter the given Bookmark.getPreviousBookmark(Bookmark bookmark) Returns the previousBookmarkto the given bookmark.voidRemoves the given bookmark from the listintsize()Returns the size of the list.
-
Field Details
-
PROPERTY_KEY_BOOKMARK_LIST
- See Also:
-
BOOKMARK_ADD
- See Also:
-
BOOKMARK_REMOVE
- See Also:
-
-
Method Details
-
getAll
Returns a list of allBookmarks. The returned list should only be used for read operations. Modifications can be made with theadd(Bookmark)andremove(Bookmark)methods.- Returns:
- a list of all
Bookmark
-
getBookmarkAfterPage
Returns the nextBookmarkafter the given page. This method does not return Bookmarks on the given page.- Parameters:
document- the documentpage- the currentPage- Returns:
- the next bookmark or null, if there is no next bookmark
-
getBookmarkBeforePage
Returns the previousBookmarkfrom a page before the given page. This method does not return Bookmarks which are on the given page.- Parameters:
document- the documentpage- the currentPage- Returns:
- the previous bookmark or null, if there is no previous bookmark
-
getBookmarkOnPage
Returns theBookmarkof the given page.If a subclass can handle multiple Bookmarks per Page, this method should return the first Bookmark of the given page. With the
getNextBookmark(Bookmark)/getPreviousBookmark(Bookmark)methods a navigation between those bookmarks is possible.The default implementation just handles one bookmark per page.
-
getFirstBookmark
Returns the firstBookmarkof the document.- Parameters:
document- the document- Returns:
- the first bookmark or null, if there is no bookmark.
-
getLastBookmark
Returns the lastBookmarkof the document.- Parameters:
document- the document- Returns:
- the last bookmark or null, if there is no bookmark.
-
clear
void clear()Removes allBookmarks from this list. -
size
int size()Returns the size of the list.- Returns:
- the size of the list
-
addPropertyChangeListener
Adds a property change listener to this bookmark list to receive events when bookmark entries are added or deleted.- Parameters:
listener- the listener which should be added