Class ComboButton

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixMenuBar>
io.jmix.flowui.kit.component.dropdownbutton.AbstractDropdownButton
io.jmix.flowui.kit.component.combobutton.ComboButton
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<AbstractDropdownButton>, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.contextmenu.MenuItem>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<AbstractDropdownButton>, com.vaadin.flow.component.FocusNotifier<AbstractDropdownButton>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasOverlayClassName, com.vaadin.flow.component.shared.HasThemeVariant<ComboButtonVariant>, DropdownButtonComponent, HasAction, HasShortcutCombination, HasSubParts, HasTitle, Serializable

public class ComboButton extends AbstractDropdownButton implements com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.contextmenu.MenuItem>, HasAction, HasShortcutCombination, com.vaadin.flow.component.shared.HasThemeVariant<ComboButtonVariant>
ComboButton is a UI component that provides a combination of a button and a dropdown menu, allowing users to trigger an action or open a menu of options.
See Also:
  • Field Details

    • ATTRIBUTE_JMIX_ROLE_VALUE

      protected static final String ATTRIBUTE_JMIX_ROLE_VALUE
      See Also:
    • buttonItem

      protected JmixMenuItem buttonItem
    • actionSupport

      protected ComboButtonActionSupport actionSupport
    • shortcutRegistration

      protected com.vaadin.flow.component.ShortcutRegistration shortcutRegistration
    • shortcutCombination

      protected KeyCombination shortcutCombination
  • Constructor Details

    • ComboButton

      public ComboButton()
  • Method Details

    • initContent

      protected JmixMenuBar initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<JmixMenuBar>
    • getButtonItem

      protected JmixMenuItem getButtonItem()
    • getDropdownItem

      protected JmixMenuItem getDropdownItem()
      Specified by:
      getDropdownItem in class AbstractDropdownButton
    • setText

      public void setText(String text)
      Specified by:
      setText in interface com.vaadin.flow.component.HasText
    • getText

      public String getText()
      Specified by:
      getText in interface com.vaadin.flow.component.HasText
    • setWhiteSpace

      public void setWhiteSpace(com.vaadin.flow.component.HasText.WhiteSpace value)
      Specified by:
      setWhiteSpace in interface com.vaadin.flow.component.HasText
    • getWhiteSpace

      public com.vaadin.flow.component.HasText.WhiteSpace getWhiteSpace()
      Specified by:
      getWhiteSpace in interface com.vaadin.flow.component.HasText
    • setIcon

      public void setIcon(@Nullable com.vaadin.flow.component.icon.Icon icon)
      Description copied from interface: DropdownButtonComponent
      Sets the icon for the component.
      Specified by:
      setIcon in interface DropdownButtonComponent
      Parameters:
      icon - the icon to set. Can be null to clear the current icon.
    • updateIconSlot

      protected void updateIconSlot()
    • addClickListener

      public com.vaadin.flow.shared.Registration addClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.contextmenu.MenuItem>> listener)
      Specified by:
      addClickListener in interface com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.contextmenu.MenuItem>
    • addClickShortcut

      public com.vaadin.flow.component.ShortcutRegistration addClickShortcut(com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers)
      Specified by:
      addClickShortcut in interface com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.contextmenu.MenuItem>
    • setAction

      public void setAction(@Nullable Action action, boolean overrideComponentProperties)
      Description copied from interface: HasAction
      Sets the action to the component. If overrideComponentProperties is true then the action properties will override component's properties, otherwise the component's properties will be overridden if they are null.

      List of properties that the action and the component have and which can be overridden:

      • text
      • description
      • shortcutCombination
      • enabled
      • visible
      • icon
      • variant
      Specified by:
      setAction in interface HasAction
      Parameters:
      action - an action to set
      overrideComponentProperties - whether action properties override component properties
    • getAction

      @Nullable public Action getAction()
      Specified by:
      getAction in interface HasAction
      Returns:
      an action or null
    • getDropdownIcon

      @Nullable public com.vaadin.flow.component.icon.Icon getDropdownIcon()
      Returns the icon to be displayed in the dropdown area of the component.
      Returns:
      the icon to be displayed in the dropdown area of the component
    • setDropdownIcon

      public void setDropdownIcon(@Nullable com.vaadin.flow.component.icon.Icon icon)
      Sets the icon to be displayed in the dropdown area of the component.
      Parameters:
      icon - the icon to be set, or null to remove the dropdown icon
    • setShortcutCombination

      public void setShortcutCombination(@Nullable KeyCombination shortcutCombination)
      Description copied from interface: HasShortcutCombination
      Sets object that stores information about keys, modifiers and additional settings that describe shortcut combinations.
      Specified by:
      setShortcutCombination in interface HasShortcutCombination
      Parameters:
      shortcutCombination - key combination to set or null to remove
    • getShortcutCombination

      @Nullable public KeyCombination getShortcutCombination()
      Specified by:
      getShortcutCombination in interface HasShortcutCombination
      Returns:
      object that stores information about keys, modifiers and additional settings that describe shortcut combinations or null if not set
    • getActionSupport

      protected ComboButtonActionSupport getActionSupport()