com.holonplatform.vaadin.components.builders

## Interface ButtonConfigurator<B extends ButtonConfigurator<B>>

- Type Parameters:
    `B` - Concrete configurator type
  All Superinterfaces:
    ComponentConfigurator<B>
  All Known Subinterfaces:
    ButtonBuilder, ButtonConfigurator.BaseButtonConfigurator

      public interface ButtonConfigurator<B extends ButtonConfigurator<B>>
      extends ComponentConfigurator<B>

  Interface to configure a `Button`.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `ButtonConfigurator.BaseButtonConfigurator` Base button configurator.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.components.builders.ComponentConfigurator

      `ComponentConfigurator.BaseComponentConfigurator`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `clickShortcut(int keyCode, int... modifiers)` Makes it possible to invoke a click on this button by pressing the given `ShortcutAction.KeyCode` and (optional) `ShortcutAction.ModifierKey`s.
    `B` | `disableOnClick()` Automatically disables button when clicked, typically to prevent (accidental) extra clicks on a button.
    `B` | `iconAlternateText(String iconAltText)` Sets the button icon's alternate text
    `B` | `onClick(com.vaadin.ui.Button.ClickListener listener)` Add a listener to button to listen to user click events
    `B` | `tabIndex(int tabIndex)` Sets the tabulator index of the component.
    `B` | `withBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)` Adds a listener which gets fired when the the keyboard focus is lost.
    `B` | `withFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)` Adds a listener which gets fired when the component receives keyboard focus.

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.ComponentConfigurator

      `caption, caption, caption, captionAsHtml, description, description, description, disabled, errorHandler, fullHeight, fullSize, fullWidth, height, height, heightUndefined, hidden, icon, id, notVisible, primaryStyleName, replaceStyleName, responsive, sizeUndefined, styleName, width, width, widthUndefined, withAttachListener, withContextClickListener, withData, withDetachListener, withShortcutListener`

- - ### Method Detail

    - #### tabIndex

          B tabIndex(int tabIndex)

      Sets the tabulator index of the component. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.

      If the tab index is not set (is set to zero), the default tab order is used. The order is somewhat browser-dependent, but generally follows the HTML structure of the page.

      A negative value means that the component is completely removed from the tabulation order and can not be reached by pressing the Tab key at all.

      Parameters:
        `tabIndex` - The tab order of this component. Indexes usually start from 1. Zero means that default tab order should be used. A negative value means that the field should not be included in the tabbing sequence.
      Returns:
        this

    - #### withFocusListener

          B withFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)

      Adds a listener which gets fired when the component receives keyboard focus.
      Parameters:
        `listener` - Focus listener to add
      Returns:
        this

    - #### withBlurListener

          B withBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)

      Adds a listener which gets fired when the the keyboard focus is lost.
      Parameters:
        `listener` - Blur listener to add
      Returns:
        this

    - #### iconAlternateText

          B iconAlternateText(String iconAltText)

      Sets the button icon's alternate text
      Parameters:
        `iconAltText` - Icon alternate text
      Returns:
        this

    - #### disableOnClick

          B disableOnClick()

      Automatically disables button when clicked, typically to prevent (accidental) extra clicks on a button.

      Note that this is only used when the click comes from the user, not when calling `Button.click()` method programmatically. Also, if developer wants to re-enable the button, it needs to be done programmatically.

      Returns:
        this

    - #### onClick

          B onClick(com.vaadin.ui.Button.ClickListener listener)

      Add a listener to button to listen to user click events
      Parameters:
        `listener` - Click listener to add
      Returns:
        this

    - #### clickShortcut

          B clickShortcut(int keyCode,
                          int... modifiers)

      Makes it possible to invoke a click on this button by pressing the given `ShortcutAction.KeyCode` and (optional) `ShortcutAction.ModifierKey`s. The shortcut is global.
      Parameters:
        `keyCode` - the keycode for invoking the shortcut
        `modifiers` - the (optional) modifiers for invoking the shortcut, null for none
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.