Class BookmarkablePageLink<T>

Type Parameters:
T - type of model object, if any
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,Link<T>>, IMetadataContext<Serializable,Component>, IRequestListener, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
AutoLinkResolver.AutolinkBookmarkablePageLink

public class BookmarkablePageLink<T> extends Link<T>
Renders a stable link which can be cached in a web browser and used at a later time.
Author:
Jonathan Locke
See Also:
  • Field Details

  • Constructor Details

    • BookmarkablePageLink

      public BookmarkablePageLink(String id, Class<C> pageClass)
      Constructor.
      Type Parameters:
      C - type of page
      Parameters:
      id - The name of this component
      pageClass - The class of page to link to
    • BookmarkablePageLink

      public BookmarkablePageLink(String id, Class<C> pageClass, PageParameters parameters)
      Constructor.
      Type Parameters:
      C -
      Parameters:
      id - See Component
      pageClass - The class of page to link to
      parameters - The parameters to pass to the new page when the link is clicked
  • Method Details

    • getPageParameters

      Returns:
      page parameters
    • getPageClass

      public final Class<? extends Page> getPageClass()
      Get the page class registered with the link
      Returns:
      Page class
    • linksTo

      public boolean linksTo(Page page)
      Whether this link refers to the given page.
      Overrides:
      linksTo in class Link<T>
      Parameters:
      page - the page
      Returns:
      True if this link goes to the given page
      See Also:
    • getStatelessHint

      protected boolean getStatelessHint()
      Description copied from class: Component
      Returns whether the component can be stateless. Also the component behaviors must be stateless, otherwise the component will be treat as stateful. In order for page to be stateless (and not to be stored in session), all components (and component behaviors) must be stateless.
      Overrides:
      getStatelessHint in class Link<T>
      Returns:
      whether the component can be stateless
      See Also:
    • onClick

      public final void onClick()
      THIS METHOD IS NOT USED! Bookmarkable links do not have a click handler. It is here to satisfy the interface only, as bookmarkable links will be dispatched by the handling servlet.
      Specified by:
      onClick in class Link<T>
      See Also:
    • getURL

      protected CharSequence getURL()
      Gets the url to use for this link.
      Overrides:
      getURL in class Link<T>
      Returns:
      The URL that this link links to
      See Also: