Class JmixUserMenuItemsDelegate.SeparatorUserMenuItem
java.lang.Object
io.jmix.flowui.kit.component.usermenu.JmixUserMenuItemsDelegate.SeparatorUserMenuItem
- All Implemented Interfaces:
com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.shared.HasThemeVariant<UserMenuItemVariant>,HasSubParts,UserMenuItem,Serializable
- Enclosing class:
- JmixUserMenuItemsDelegate
protected static class JmixUserMenuItemsDelegate.SeparatorUserMenuItem
extends Object
implements UserMenuItem
Blank item needed for correct insertion by index.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.kit.component.usermenu.UserMenuItem
UserMenuItem.HasClickListener<ITEM extends UserMenuItem>, UserMenuItem.HasSubMenu -
Field Summary
FieldsFields inherited from interface io.jmix.flowui.kit.component.usermenu.UserMenuItem
PROP_CHECKABLE, PROP_CHECKED, PROP_ENABLED, PROP_VISIBLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSeparatorUserMenuItem(com.vaadin.flow.component.Component separator) -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddPropertyChangeListener(Consumer<PropertyChangeEvent> listener) Adds a listener to be notified about changes in the properties of the action.com.vaadin.flow.dom.ElementgetId()Returns the unique identifier of the user menu item.getSubPart(String name) Returns a sub part object by its name.booleanReturns whether this item toggles a checkmark icon when clicked.booleanReturns the checked state of this item.booleanChecks whether the user menu item is currently enabled.booleanChecks whether the user menu item is currently visible.voidsetCheckable(boolean checkable) Sets the checkable state of this menu item.voidsetChecked(boolean checked) Sets the checked state of this item.voidsetEnabled(boolean enabled) Enables or disables the user menu item.voidsetVisible(boolean visible) Sets the visibility of the user menu item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants
-
Field Details
-
separator
protected final com.vaadin.flow.component.Component separator
-
-
Constructor Details
-
SeparatorUserMenuItem
protected SeparatorUserMenuItem(com.vaadin.flow.component.Component separator)
-
-
Method Details
-
getId
Description copied from interface:UserMenuItemReturns the unique identifier of the user menu item.- Specified by:
getIdin interfaceUserMenuItem- Returns:
- the unique identifier of the menu item
-
setVisible
public void setVisible(boolean visible) Description copied from interface:UserMenuItemSets the visibility of the user menu 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 interfaceUserMenuItem- Parameters:
visible- if true, the item will be visible; otherwise, it will be hidden
-
isVisible
public boolean isVisible()Description copied from interface:UserMenuItemChecks whether the user menu 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 interfaceUserMenuItem- Returns:
- true if the item is visible, false otherwise
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:UserMenuItemEnables or disables the user menu item. When the item is disabled, it cannot be interacted with.- Specified by:
setEnabledin interfaceUserMenuItem- Parameters:
enabled- iftrue, the item will be enabled; otherwise, it will be disabled
-
isEnabled
public boolean isEnabled()Description copied from interface:UserMenuItemChecks whether the user menu item is currently enabled. An enabled item can be interacted with, whereas a disabled item cannot.- Specified by:
isEnabledin interfaceUserMenuItem- Returns:
trueif the item is enabled,falseotherwise
-
isCheckable
public boolean isCheckable()Description copied from interface:UserMenuItemReturns whether this item toggles a checkmark icon when clicked.- Specified by:
isCheckablein interfaceUserMenuItem- Returns:
- the checkable state of the item
- See Also:
-
setCheckable
public void setCheckable(boolean checkable) Description copied from interface:UserMenuItemSets the checkable state of this menu item. A checkable item toggles a checkmark icon when clicked. Changes in the checked state can be handled in the item's click handler withUserMenuItem.isChecked().Setting a checked item un-checkable also makes it un-checked.
- Specified by:
setCheckablein interfaceUserMenuItem- Parameters:
checkable-trueto enable toggling the checked-state of this menu item by clicking,falseto disable it.
-
isChecked
public boolean isChecked()Description copied from interface:UserMenuItemReturns the checked state of this item. The item can be checked and un-checked withUserMenuItem.setChecked(boolean)or by clicking it when it is checkable. A checked item displays a checkmark icon inside it.- Specified by:
isCheckedin interfaceUserMenuItem- Returns:
trueif the item is checked,falseotherwise- See Also:
-
setChecked
public void setChecked(boolean checked) Description copied from interface:UserMenuItemSets the checked state of this item. A checked item displays a checkmark icon next to it. The checked state is also toggled by clicking the item.Note that the item needs to be explicitly set as checkable via
UserMenuItem.setCheckable(boolean)in order to check it.- Specified by:
setCheckedin interfaceUserMenuItem- Parameters:
checked-trueto check this item,falseto un-check it
-
addPropertyChangeListener
public com.vaadin.flow.shared.Registration addPropertyChangeListener(Consumer<PropertyChangeEvent> listener) Description copied from interface:UserMenuItemAdds a listener to be notified about changes in the properties of the action.- Specified by:
addPropertyChangeListenerin interfaceUserMenuItem- Parameters:
listener- listener to add- Returns:
- a registration object for removing an event listener
-
getElement
public com.vaadin.flow.dom.Element getElement()- Specified by:
getElementin interfacecom.vaadin.flow.component.HasElement
-
getSubPart
Description copied from interface:HasSubPartsReturns a sub part object by its name.- Specified by:
getSubPartin interfaceHasSubParts- Parameters:
name- sub part name, e.g. component id- Returns:
- a sub part object by its name, or
nullif not found
-