All Implemented Interfaces:
IBootstrapButton<BootstrapButton>, Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<String,FormComponent<String>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormSubmitter, IFormSubmittingComponent, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
DefaultBootstrapButton, MenuButton

public class BootstrapButton extends Button implements IBootstrapButton<BootstrapButton>
A bootstrap styled Button
Author:
miha
See Also:
  • Constructor Details

    • BootstrapButton

      public BootstrapButton(String componentId, Buttons.Type type)
      Construct.
      Parameters:
      componentId - The component id
      type - The type of the button
    • BootstrapButton

      public BootstrapButton(String componentId, IModel<String> model, Buttons.Type type)
      Construct.
      Parameters:
      componentId - The component id
      model - The label model
      type - The type of the button
  • 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, IModel<String> 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 or if useSplitter is true.
      Parameters:
      markupId - the component id of the splitter
      Returns:
      new splitter component
    • onConfigure

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

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

      public BootstrapButton setLabel(IModel<String> label)
      sets the label of the button.
      Overrides:
      setLabel in class FormComponent<String>
      Parameters:
      label - the new button label
      Returns:
      reference to the current instance
    • setIconType

      public BootstrapButton 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
    • setSize

      public BootstrapButton setSize(Buttons.Size size)
      Description copied from interface: IBootstrapButton
      sets the size of a button
      Specified by:
      setSize in interface IBootstrapButton<BootstrapButton>
      Parameters:
      size - The button size to use
      Returns:
      instance for chaining
    • setType

      public BootstrapButton setType(Buttons.Type type)
      Description copied from interface: IBootstrapButton
      sets the type of a button
      Specified by:
      setType in interface IBootstrapButton<BootstrapButton>
      Parameters:
      type - The button type to use
      Returns:
      instance for chaining
    • useSplitter

      public BootstrapButton useSplitter(boolean value)
      Parameters:
      value - whether to use splitter between the icon and the label or not
      Returns:
      this instance for chaining