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 Action
protected com.vaadin.flow.shared.Registration
protected final ComboButton
protected com.vaadin.flow.shared.Registration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addActionVariant
(ComboButton component, ActionVariant actionVariant) Returns the currentAction
instance associated with this object.protected void
protected void
onButtonClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.contextmenu.MenuItem> event) protected void
removeActionVariant
(ComboButton component, ActionVariant actionVariant) protected void
void
Sets theAction
to be associated with the combo button and optionally overrides certain component properties based on the provided action.protected void
updateActionVariant
(boolean overrideComponentProperties) protected void
protected void
updateIcon
(boolean overrideComponentProperties) protected void
updateText
(boolean overrideComponentProperties) protected void
updateTitle
(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 theAction
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 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 currentAction
instance associated with this object.- Returns:
- the currently associated
Action
, ornull
if 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
-