Class BootstrapBookmarkablePageLink<T>

Type Parameters:
T - The type of the model object for this link
All Implemented Interfaces:
Activatable, IBootstrapButton<BootstrapBookmarkablePageLink<T>>, Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,Link<T>>, IMetadataContext<Serializable,Component>, IRequestListener, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
MenuBookmarkablePageLink, NavbarButton

public class BootstrapBookmarkablePageLink<T> extends BookmarkablePageLink<T> implements IBootstrapButton<BootstrapBookmarkablePageLink<T>>, Activatable
Renders a stable button link which can be cached in a web browser and used at a later time. The button will be styled according to the given button type and size.

// creates a big red bookmarkable page link that looks like a button new BootstrapBookmarkablePageLink("componentId", Page.class, Type.Danger).setSize(Size.Large);

Author:
miha
See Also:
  • Constructor Details

    • BootstrapBookmarkablePageLink

      public BootstrapBookmarkablePageLink(String componentId, Class<P> pageClass, Buttons.Type type)
      Constructor.
      Type Parameters:
      P - type of the page class
      Parameters:
      componentId - The non-null id of this component
      pageClass - The class of page to link to
      type - The type of the button, e.g. Success, Warn, Default, Menu...
    • BootstrapBookmarkablePageLink

      public BootstrapBookmarkablePageLink(String componentId, Class<P> pageClass, PageParameters parameters, Buttons.Type type)
      Constructor.
      Type Parameters:
      P - type of the page class
      Parameters:
      componentId - The non-null id of this component
      pageClass - The class of page to link to
      parameters - The parameters to pass to the new page when the link is clicked
      type - The type of the button, e.g. Success, Warn, Default, Menu...
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class MarkupContainer
    • newIcon

      protected Icon newIcon(String markupId)
      creates a new icon component
      Parameters:
      markupId - the component id of the icon
      Returns:
      new icon component
    • newLabel

      protected Component newLabel(String markupId)
      creates a new label component
      Parameters:
      markupId - the component id of the label
      Returns:
      new label component
    • newSplitter

      protected Component newSplitter(String markupId)
      creates a new splitter component. The splitter is visible only if icon is visible.
      Parameters:
      markupId - the component id of the splitter
      Returns:
      new splitter component
    • newMarkupSourcingStrategy

      protected final IMarkupSourcingStrategy newMarkupSourcingStrategy()
      Overrides:
      newMarkupSourcingStrategy in class Component
    • setSize

      sets the size of the button according to the given Buttons.Size.
      Specified by:
      setSize in interface IBootstrapButton<T>
      Parameters:
      size - the size of the button
      Returns:
      reference to the current instance
    • setType

      Description copied from interface: IBootstrapButton
      sets the type of a button
      Specified by:
      setType in interface IBootstrapButton<T>
      Parameters:
      type - The button type to use
      Returns:
      instance for chaining
    • setLabel

      public BootstrapBookmarkablePageLink<T> setLabel(IModel<?> label)
      sets the label of the button.
      Parameters:
      label - the new button label
      Returns:
      reference to the current instance
    • setIconType

      public BootstrapBookmarkablePageLink<T> setIconType(IconType iconType)
      sets the button's icon which will be rendered in front of the label.
      Parameters:
      iconType - the new button icon
      Returns:
      reference to the current instance
    • onConfigure

      protected void onConfigure()
      Overrides:
      onConfigure in class Component
    • isActive

      public boolean isActive(Component button)
      Description copied from interface: Activatable
      Decides whether the current instance (this) is the active item.
      Specified by:
      isActive in interface Activatable
      Parameters:
      button - the current instance as a Component
      Returns:
      true if the item is the current active one