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 TypeMethodDescriptionvoid
Adds the given bookmark to the listvoid
Adds a property change listener to this bookmark list to receive events when bookmark entries are added or deleted.void
clear()
Removes allBookmark
s from this list.getAll()
Returns a list of allBookmark
s.getBookmarkAfterPage
(Document document, Page page) Returns the nextBookmark
after the given page.getBookmarkBeforePage
(Document document, Page page) Returns the previousBookmark
from a page before the given page.getBookmarkOnPage
(Document document, Page page) Returns theBookmark
of the given page.getFirstBookmark
(Document document) Returns the firstBookmark
of the document.getLastBookmark
(Document document) Returns the lastBookmark
of the document.getNextBookmark
(Bookmark bookmark) Returns the nextBookmark
after the given Bookmark.getPreviousBookmark
(Bookmark bookmark) Returns the previousBookmark
to the given bookmark.void
Removes the given bookmark from the listint
size()
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 allBookmark
s. 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 nextBookmark
after 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 previousBookmark
from 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 theBookmark
of 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 firstBookmark
of the document.- Parameters:
document
- the document- Returns:
- the first bookmark or null, if there is no bookmark.
-
getLastBookmark
Returns the lastBookmark
of the document.- Parameters:
document
- the document- Returns:
- the last bookmark or null, if there is no bookmark.
-
clear
void clear()Removes allBookmark
s 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