Class AbstractDropdownButton.AbstractDropdownButtonItem
java.lang.Object
io.jmix.flowui.kit.component.dropdownbutton.AbstractDropdownButton.AbstractDropdownButtonItem
- All Implemented Interfaces:
AbstractDropdownButton.HasMenuItem,DropdownButtonItem
- Direct Known Subclasses:
AbstractDropdownButton.ActionItemImpl,AbstractDropdownButton.ComponentItemImpl,AbstractDropdownButton.TextItemImpl
- Enclosing class:
- AbstractDropdownButton
protected abstract static class AbstractDropdownButton.AbstractDropdownButtonItem
extends Object
implements AbstractDropdownButton.HasMenuItem, DropdownButtonItem
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.kit.component.dropdownbutton.DropdownButtonItem
DropdownButtonItem.ClickEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected com.vaadin.flow.component.contextmenu.MenuItemprotected com.vaadin.flow.shared.Registrationprotected DropdownButtonComponent -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDropdownButtonItem(String id, com.vaadin.flow.component.contextmenu.MenuItem item, DropdownButtonComponent parent) -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationAdds a listener to handle click events for the dropdown button item.protected EventBusgetId()Returns the unique identifier of the dropdown button item.com.vaadin.flow.component.contextmenu.MenuItemgetItem()Returns the parent dropdown button component to which this item belongs.protected voidbooleanChecks whether the dropdown button item is currently enabled.booleanChecks whether the dropdown button item is currently visible.voidsetEnabled(boolean enabled) Enables or disables the dropdown button item.voidsetItem(com.vaadin.flow.component.contextmenu.MenuItem item) voidsetVisible(boolean visible) Sets the visibility of the dropdown button item.
-
Field Details
-
id
-
item
protected com.vaadin.flow.component.contextmenu.MenuItem item -
parent
-
-
Constructor Details
-
Method Details
-
getId
Description copied from interface:DropdownButtonItemReturns the unique identifier of the dropdown button item.- Specified by:
getIdin interfaceDropdownButtonItem- Returns:
- the identifier of the item as a string, or null if not set
-
getItem
public com.vaadin.flow.component.contextmenu.MenuItem getItem()- Specified by:
getItemin interfaceAbstractDropdownButton.HasMenuItem
-
getParent
Description copied from interface:DropdownButtonItemReturns the parent dropdown button component to which this item belongs.- Specified by:
getParentin interfaceDropdownButtonItem- Returns:
- the parent
DropdownButtonComponentof this item
-
setVisible
public void setVisible(boolean visible) Description copied from interface:DropdownButtonItemSets the visibility of the dropdown button item. A visible item is rendered and can interact with users, while an invisible item is not displayed and cannot be interacted with.- Specified by:
setVisiblein interfaceDropdownButtonItem- Parameters:
visible- if true, the item will be visible; otherwise, it will be hidden
-
isVisible
public boolean isVisible()Description copied from interface:DropdownButtonItemChecks whether the dropdown button item is currently visible. A visible item is displayed in the dropdown and can interact with users, whereas an invisible item is hidden and cannot be interacted with.- Specified by:
isVisiblein interfaceDropdownButtonItem- Returns:
- true if the item is visible, false otherwise
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:DropdownButtonItemEnables or disables the dropdown button item. When the item is disabled, it cannot be interacted with.- Specified by:
setEnabledin interfaceDropdownButtonItem- Parameters:
enabled- iftrue, the item will be enabled; otherwise, it will be disabled
-
isEnabled
public boolean isEnabled()Description copied from interface:DropdownButtonItemChecks whether the dropdown button item is currently enabled. An enabled item can be interacted with, whereas a disabled item cannot.- Specified by:
isEnabledin interfaceDropdownButtonItem- Returns:
trueif the item is enabled,falseotherwise
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(Consumer<DropdownButtonItem.ClickEvent> listener) Description copied from interface:DropdownButtonItemAdds a listener to handle click events for the dropdown button item. When the item is clicked, the providedConsumerprocesses the associatedDropdownButtonItem.ClickEvent.- Specified by:
addClickListenerin interfaceDropdownButtonItem- Parameters:
listener- theConsumerto handle theDropdownButtonItem.ClickEventtriggered by a click on the item- Returns:
- a
Registrationobject that can be used to remove the added listener
-
internalRemoveDropdownButtonItemClickListener
protected void internalRemoveDropdownButtonItemClickListener(Consumer<DropdownButtonItem.ClickEvent> listener) -
getEventBus
-