Class SerializableBookmark

  • All Implemented Interfaces:
    com.google.gwt.user.client.rpc.IsSerializable

    public class SerializableBookmark
    extends Object
    implements com.google.gwt.user.client.rpc.IsSerializable
    A serializable representation of a Bookmark intended to be used on the server side.

    When invoking a ServerOperation all client side bookmarks are serialized as instances of this class and added to a SerializableBookmarkList. Use it in your server operation implementation to e.g. persist bookmarks in a third party system.

    Use it in your DocumentDataProvider to attach a persisted bookmark while loading a document. The bookmark will be added automatically on the client side.

    For further details and code examples take a look at https://webtoolkit.jadice.com/showcase.

    It differs from the client side Bookmark by replacing the Page with a page index and by omitting the Document completely. This is necessary as the document and pages are available on the server only after loading the document. The bookmarks have to be attached before loading the document in order to send them to the client via document property.

    • Constructor Detail

      • SerializableBookmark

        @Deprecated
        public SerializableBookmark()
        Deprecated.
        for GWT only
      • SerializableBookmark

        public SerializableBookmark​(Integer pageIndex)
        Constructs a serializable bookmark that belongs to a specific page.

        May only be called on the server side in DocumentDataProviders.

        Parameters:
        pageIndex - the index of the page the bookmark shall be placed on.
      • SerializableBookmark

        public SerializableBookmark​(Integer pageIndex,
                                    Point2D panPoint,
                                    Float zoomfactor,
                                    BaseRenderSettings.Rotation rotation)
        Constructs a serializable bookmark that belongs to a specific page and that stores optional render parameters. See Bookmark for details to the render parameters.

        May only be called on the server side in DocumentDataProviders.

        Parameters:
        pageIndex - the index of the page this bookmark belongs to
        panPoint - the panPoint attribute of the corresponding bookmark
        zoomfactor - the zoomfactor attribute of the corresponding bookmark
        rotation - the rotation attribute of the corresponding
    • Method Detail

      • getZoomfactor

        public Float getZoomfactor()
        Returns the zoomfactor that was stored when creating the corresponding Bookmark on the client side
        Returns:
        the zoomfactor of the corresponding Bookmark or null if none was set
      • setZoomfactor

        public void setZoomfactor​(Float zoomfactor)
        Sets the zoomfactor
        Parameters:
        zoomfactor - the zoomfactor
      • getRotation

        public BaseRenderSettings.Rotation getRotation()
        Returns the rotation that was stored when creating the corresponding Bookmark on the client side
        Returns:
        the rotation of the corresponding Bookmark or null if none was set
      • setRotation

        public void setRotation​(BaseRenderSettings.Rotation rotation)
        Sets the rotation
        Parameters:
        rotation - the rotation
      • getPanPoint

        public Point2D getPanPoint()
        Returns the pan point that was stored when creating the corresponding Bookmark on the client side
        Returns:
        the pan point
      • setPanPoint

        public void setPanPoint​(Point2D panPoint)
        Sets the pan point
        Parameters:
        panPoint - the pan point
      • getPageIndex

        public Integer getPageIndex()
        Returns the page index of the page the corresponding Bookmark belongs to
        Returns:
        the page index of the corresponding Bookmark
      • setPageIndex

        public void setPageIndex​(Integer pageIndex)
        Sets the page index
        Parameters:
        pageIndex - the page index