Class ComboButtonActionSupport

java.lang.Object
io.jmix.flowui.kit.component.combobutton.ComboButtonActionSupport

public class ComboButtonActionSupport extends Object
Provides support for associating an Action with a ComboButton. Enables the synchronization of the button's state, appearance, and behavior based on the properties of the associated action and manages event handling for the action and button interaction.
  • Field Details

    • comboButton

      protected final ComboButton comboButton
    • action

      protected Action action
    • comboButtonClickRegistration

      protected com.vaadin.flow.shared.Registration comboButtonClickRegistration
    • actionPropertyChangeRegistration

      protected com.vaadin.flow.shared.Registration actionPropertyChangeRegistration
  • Constructor Details

    • ComboButtonActionSupport

      public ComboButtonActionSupport(ComboButton comboButton)
  • Method Details

    • setAction

      public void setAction(@Nullable Action action, boolean overrideComponentProperties)
      Sets the Action to be associated with the combo button and optionally overrides certain component properties based on the provided action.

      If the action is already set to the same value, the method performs no operations. Otherwise, it updates the combo button's state (e.g., text, icon, visibility) and registers necessary listeners to synchronize the combo button with the action.

      Parameters:
      action - the action to associate with the combo button; can be null to remove the current association
      overrideComponentProperties - if true, the combo button's properties (e.g., text, icon, descriptive text) will be overridden by the action's corresponding properties
    • getAction

      @Nullable public Action getAction()
      Returns the current Action instance associated with this object.
      Returns:
      the currently associated Action, or null if no action is set
    • addActionVariant

      protected void addActionVariant(ComboButton component, ActionVariant actionVariant)
    • removeActionVariant

      protected void removeActionVariant(ComboButton component, ActionVariant actionVariant)
    • removeRegistrations

      protected void removeRegistrations()
    • updateText

      protected void updateText(boolean overrideComponentProperties)
    • updateEnabled

      protected void updateEnabled()
    • updateVisible

      protected void updateVisible()
    • updateActionVariant

      protected void updateActionVariant(boolean overrideComponentProperties)
    • updateIcon

      protected void updateIcon(boolean overrideComponentProperties)
    • updateTitle

      protected void updateTitle(boolean overrideComponentProperties)
    • onButtonClick

      protected void onButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.contextmenu.MenuItem> event)
    • onActionPropertyChange

      protected void onActionPropertyChange(PropertyChangeEvent event)