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 Details

  • Method Details

    • add

      void add(Bookmark bookmark)
      Adds the given bookmark to the list
      Parameters:
      bookmark - The object to be added.
    • remove

      void remove(Bookmark bookmark)
      Removes the given bookmark from the list
      Parameters:
      bookmark - The object to be removed.
    • getAll

      List<Bookmark> getAll()
      Returns a list of all Bookmarks. The returned list should only be used for read operations. Modifications can be made with the add(Bookmark) and remove(Bookmark) methods.
      Returns:
      a list of all Bookmark
    • getBookmarkAfterPage

      Bookmark getBookmarkAfterPage(Document document, Page page)
      Returns the next Bookmark after the given page. This method does not return Bookmarks on the given page.
      Parameters:
      document - the document
      page - the current Page
      Returns:
      the next bookmark or null, if there is no next bookmark
    • getBookmarkBeforePage

      Bookmark getBookmarkBeforePage(Document document, Page page)
      Returns the previous Bookmark from a page before the given page. This method does not return Bookmarks which are on the given page.
      Parameters:
      document - the document
      page - the current Page
      Returns:
      the previous bookmark or null, if there is no previous bookmark
    • getBookmarkOnPage

      Bookmark getBookmarkOnPage(Document document, Page page)
      Returns the Bookmark 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.

      Parameters:
      document - the document
      page - the current Page
      Returns:
      the Bookmark for the given page or null if there is no Bookmark
    • getFirstBookmark

      Bookmark getFirstBookmark(Document document)
      Returns the first Bookmark of the document.
      Parameters:
      document - the document
      Returns:
      the first bookmark or null, if there is no bookmark.
    • getLastBookmark

      Bookmark getLastBookmark(Document document)
      Returns the last Bookmark of the document.
      Parameters:
      document - the document
      Returns:
      the last bookmark or null, if there is no bookmark.
    • getNextBookmark

      Bookmark getNextBookmark(Bookmark bookmark)
      Returns the next Bookmark after the given Bookmark.
      Parameters:
      bookmark - the "current" bookmark
      Returns:
      the next bookmark or null, if there is no next bookmark.
    • getPreviousBookmark

      Bookmark getPreviousBookmark(Bookmark bookmark)
      Returns the previous Bookmark to the given bookmark.
      Parameters:
      bookmark - the "current" bookmark
      Returns:
      the previous bookmark or null, if there is no previous bookmark
    • clear

      void clear()
      Removes all Bookmarks from this list.
    • size

      int size()
      Returns the size of the list.
      Returns:
      the size of the list
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
      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