All Implemented Interfaces:
IBootstrapButton<BootstrapAjaxLink<T>>, Serializable, Iterable<Component>, IAjaxLink, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,AjaxLink<T>>, IMetadataContext<Serializable,Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public abstract class BootstrapAjaxLink<T> extends AjaxLink<T> implements IBootstrapButton<BootstrapAjaxLink<T>>
Default AjaxLink which is styled by bootstrap
Author:
miha
See Also:
  • Constructor Details

    • BootstrapAjaxLink

      public BootstrapAjaxLink(String id, Buttons.Type type)
      Construct.
      Parameters:
      id - the components id
      type - the type of the button
    • BootstrapAjaxLink

      public BootstrapAjaxLink(String id, IModel<T> model, Buttons.Type type)
      Construct.
      Parameters:
      id - The component id
      model - The component model
      type - the type of the button
    • BootstrapAjaxLink

      public BootstrapAjaxLink(String id, IModel<T> model, Buttons.Type type, IModel<L> labelModel)
      Construct.
      Parameters:
      id - The component id
      model - The component model
      type - the type of the button
      labelModel - The model for the link's label
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class AjaxLink<T>
    • 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 <L extends Serializable> Component newLabel(String markupId, IModel<L> model)
      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 and useSplitter is true.
      Parameters:
      markupId - the component id of the splitter
      Returns:
      new splitter component
    • newMarkupSourcingStrategy

      protected IMarkupSourcingStrategy newMarkupSourcingStrategy()
      Overrides:
      newMarkupSourcingStrategy in class Component
    • onConfigure

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

      public <L extends Serializable> BootstrapAjaxLink<T> setLabel(IModel<L> label)
      Sets the label of the button.
      Parameters:
      label - the new button label
      Returns:
      reference to the current instance
    • setIconType

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

      public BootstrapAjaxLink<T> setSize(Buttons.Size size)
      Sets the size.
      Specified by:
      setSize in interface IBootstrapButton<T>
      Parameters:
      size - The button size to use
      Returns:
      instance for chaining
    • setType

      public BootstrapAjaxLink<T> setType(Buttons.Type type)
      Sets the type.
      Specified by:
      setType in interface IBootstrapButton<T>
      Parameters:
      type - The button type to use
      Returns:
      instance for chaining
    • useSplitter

      public BootstrapAjaxLink<T> useSplitter(boolean value)
      Parameters:
      value - whether to use splitter between the icon and the label or not
      Returns:
      this instance for chaining
    • detachModel

      protected void detachModel()
      Overrides:
      detachModel in class Component