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 String
protected com.vaadin.flow.component.contextmenu.MenuItem
protected com.vaadin.flow.shared.Registration
protected DropdownButtonComponent
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDropdownButtonItem
(String id, com.vaadin.flow.component.contextmenu.MenuItem item, DropdownButtonComponent parent) -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
Adds a listener to handle click events for the dropdown button item.protected EventBus
getId()
Returns the unique identifier of the dropdown button item.com.vaadin.flow.component.contextmenu.MenuItem
getItem()
Returns the parent dropdown button component to which this item belongs.protected void
boolean
Checks whether the dropdown button item is currently enabled.boolean
Checks whether the dropdown button item is currently visible.void
setEnabled
(boolean enabled) Enables or disables the dropdown button item.void
setItem
(com.vaadin.flow.component.contextmenu.MenuItem item) void
setVisible
(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:DropdownButtonItem
Returns the unique identifier of the dropdown button item.- Specified by:
getId
in 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:
getItem
in interfaceAbstractDropdownButton.HasMenuItem
-
getParent
Description copied from interface:DropdownButtonItem
Returns the parent dropdown button component to which this item belongs.- Specified by:
getParent
in interfaceDropdownButtonItem
- Returns:
- the parent
DropdownButtonComponent
of this item
-
setVisible
public void setVisible(boolean visible) Description copied from interface:DropdownButtonItem
Sets 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:
setVisible
in interfaceDropdownButtonItem
- Parameters:
visible
- if true, the item will be visible; otherwise, it will be hidden
-
isVisible
public boolean isVisible()Description copied from interface:DropdownButtonItem
Checks 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:
isVisible
in interfaceDropdownButtonItem
- Returns:
- true if the item is visible, false otherwise
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:DropdownButtonItem
Enables or disables the dropdown button item. When the item is disabled, it cannot be interacted with.- Specified by:
setEnabled
in interfaceDropdownButtonItem
- Parameters:
enabled
- iftrue
, the item will be enabled; otherwise, it will be disabled
-
isEnabled
public boolean isEnabled()Description copied from interface:DropdownButtonItem
Checks whether the dropdown button item is currently enabled. An enabled item can be interacted with, whereas a disabled item cannot.- Specified by:
isEnabled
in interfaceDropdownButtonItem
- Returns:
true
if the item is enabled,false
otherwise
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(Consumer<DropdownButtonItem.ClickEvent> listener) Description copied from interface:DropdownButtonItem
Adds a listener to handle click events for the dropdown button item. When the item is clicked, the providedConsumer
processes the associatedDropdownButtonItem.ClickEvent
.- Specified by:
addClickListener
in interfaceDropdownButtonItem
- Parameters:
listener
- theConsumer
to handle theDropdownButtonItem.ClickEvent
triggered by a click on the item- Returns:
- a
Registration
object that can be used to remove the added listener
-
internalRemoveDropdownButtonItemClickListener
protected void internalRemoveDropdownButtonItemClickListener(Consumer<DropdownButtonItem.ClickEvent> listener) -
getEventBus
-