Class ComboButtonActionSupport
java.lang.Object
io.jmix.flowui.kit.component.combobutton.ComboButtonActionSupport
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Actionprotected com.vaadin.flow.shared.Registrationprotected final ComboButtonprotected com.vaadin.flow.shared.Registration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddActionVariant(ComboButton component, ActionVariant actionVariant) Returns the currentActioninstance associated with this object.protected voidprotected voidonButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.contextmenu.MenuItem> event) protected voidremoveActionVariant(ComboButton component, ActionVariant actionVariant) protected voidvoidSets theActionto be associated with the combo button and optionally overrides certain component properties based on the provided action.protected voidupdateActionVariant(boolean overrideComponentProperties) protected voidprotected voidupdateIcon(boolean overrideComponentProperties) protected voidupdateText(boolean overrideComponentProperties) protected voidupdateTitle(boolean overrideComponentProperties) protected void
-
Field Details
-
comboButton
-
action
-
comboButtonClickRegistration
protected com.vaadin.flow.shared.Registration comboButtonClickRegistration -
actionPropertyChangeRegistration
protected com.vaadin.flow.shared.Registration actionPropertyChangeRegistration
-
-
Constructor Details
-
ComboButtonActionSupport
-
-
Method Details
-
setAction
Sets theActionto 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 associationoverrideComponentProperties- if true, the combo button's properties (e.g., text, icon, descriptive text) will be overridden by the action's corresponding properties
-
getAction
Returns the currentActioninstance associated with this object.- Returns:
- the currently associated
Action, ornullif no action is set
-
addActionVariant
-
removeActionVariant
-
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
-