Interface Button

All Superinterfaces:
ActionOwner, Component, Component.BelongToFrame, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
All Known Subinterfaces:
LinkButton
All Known Implementing Classes:
ButtonImpl, LinkButtonImpl, PaletteButton

@StudioComponent(caption="Button", category="Components", xmlElement="button", icon="io/jmix/ui/icon/component/button.svg", canvasTextProperty="caption", canvasBehaviour=BUTTON, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/button.html") public interface Button extends Component, Component.HasCaption, Component.BelongToFrame, ActionOwner, Component.HasIcon, Component.Focusable, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
  • Field Details

  • Method Details

    • setDisableOnClick

      @StudioProperty(defaultValue="false") void setDisableOnClick(boolean disableOnClick)
      Determines if a button is automatically disabled when clicked. If this is set to true the button will be automatically disabled when clicked, typically to prevent (accidental) extra clicks on a button.
      Parameters:
      disableOnClick - disable on click option.
    • isDisableOnClick

      boolean isDisableOnClick()
      Returns:
      true if the button is disabled when clicked.
    • getShortcutCombination

      @Nullable KeyCombination getShortcutCombination()
      Returns:
      action's shortcut
    • setShortcutCombination

      void setShortcutCombination(@Nullable KeyCombination shortcut)
      Sets shortcut combination.
      Parameters:
      shortcut - key combination
    • setShortcut

      @StudioProperty(type=SHORTCUT) void setShortcut(@Nullable String shortcut)
      Sets shortcut from string representation.
      Parameters:
      shortcut - string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.
    • click

      void click()
      Simulates a button click, notifying all server-side listeners.

      No action is taken if the button is disabled.

    • addClickListener

      Subscription addClickListener(Consumer<Button.ClickEvent> listener)