Class MenuItem
- All Implemented Interfaces:
Attachable, ElementAttributeMethods<HTMLElement, MenuItem>, ElementClassListMethods<HTMLElement, MenuItem>, ElementConsumerMethods<HTMLElement, MenuItem>, ElementContainerMethods<HTMLElement, MenuItem>, ElementEventMethods<HTMLElement, MenuItem>, ElementIdMethods<HTMLElement, MenuItem>, ElementQueryMethods<HTMLElement>, ElementTextDelegate<HTMLElement, MenuItem>, ElementTextMethods<HTMLElement, MenuItem>, HTMLElementAttributeMethods<HTMLElement, MenuItem>, HTMLElementDataMethods<HTMLElement, MenuItem>, HTMLElementStyleMethods<HTMLElement, MenuItem>, HTMLElementVisibilityMethods<HTMLElement, MenuItem>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, MenuItem>, ComponentIcon<HTMLElement, MenuItem>, ComponentIconAndText<HTMLElement, MenuItem>, HasIdentifier<HTMLElement, MenuItem>, ComponentContext<HTMLElement, MenuItem>, Modifiers.Disabled<HTMLElement, MenuItem>
public class MenuItem
extends SubComponent<HTMLElement, MenuItem>
implements Attachable, ComponentContext<HTMLElement, MenuItem>, ComponentIcon<HTMLElement, MenuItem>, ComponentIconAndText<HTMLElement, MenuItem>, Modifiers.Disabled<HTMLElement, MenuItem>, ElementTextDelegate<HTMLElement, MenuItem>, HasIdentifier<HTMLElement, MenuItem>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionadd(MenuItemAction itemAction) addAction(MenuItemAction itemAction) ariaDisabled(boolean ariaDisabled) static MenuItemasyncMenuItem(String identifier, String text, AsyncItems<MenuList, MenuItem> loadItems) voidattach(MutationRecord mutationRecord) static MenuItemcheckboxMenuItem(String identifier, String text) Create a new menu item with typeMenuItemType.link.danger()description(HTMLElement element) description(String description) disabled(boolean disabled) Adds/removes modifier(disabled)external()<T> TRetrieves the value associated with the given key from the ComponentContext.booleanDetermines whether a value is stored with the specified key.iconAndText(Element icon, String text, IconPosition iconPosition) Retrieves the identifier associated with this component.static MenuItemlinkMenuItem(String identifier, String text, String href) Create a new menu item with typeMenuItemType.link.static MenuItemCreate a new menu item with typeMenuItemType.action.static MenuItemCreate a new menu item with typeMenuItemType.action.onClick(ComponentHandler<MenuItem> handler) Registers an event handler to be invoked when the menu item is clicked.selected()static MenuItemskeletonMenuItem(String identifier, String loading) <T> MenuItemStores a value associated with a key.text(HTMLElement element) that()Methods inherited from class SubComponent
element, registerSubComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Attachable
detachMethods inherited from interface ComponentContext
get, getMethods inherited from interface ComponentIcon
iconMethods inherited from interface ComponentIconAndText
iconAndText, iconAndTextMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface ElementTextDelegate
text, textMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hiddenMethods inherited from interface Modifiers.Disabled
disabled, isDisabled
-
Field Details
-
SUB_COMPONENT_NAME
- See Also:
-
-
Method Details
-
linkMenuItem
-
checkboxMenuItem
-
asyncMenuItem
-
skeletonMenuItem
-
attach
- Specified by:
attachin interfaceAttachable
-
textDelegate
- Specified by:
textDelegatein interfaceElementTextDelegate<HTMLElement, MenuItem>
-
ariaDisabled
-
ariaDisabled
-
danger
-
disabled
Description copied from interface:Modifiers.DisabledAdds/removes modifier(disabled)- Specified by:
disabledin interfaceModifiers.Disabled<HTMLElement, MenuItem>
-
description
-
description
-
external
-
href
-
icon
- Specified by:
iconin interfaceComponentIcon<HTMLElement, MenuItem>
-
iconAndText
- Specified by:
iconAndTextin interfaceComponentIconAndText<HTMLElement, MenuItem>
-
removeIcon
- Specified by:
removeIconin interfaceComponentIcon<HTMLElement, MenuItem>
-
selected
-
store
Description copied from interface:ComponentContextStores a value associated with a key.- Specified by:
storein interfaceComponentContext<HTMLElement, MenuItem>- Type Parameters:
T- the type of the value being stored- Parameters:
key- the key associated with the valuevalue- the value to be stored
-
text
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, MenuItem>
-
onClick
Registers an event handler to be invoked when the menu item is clicked. If the menu item has been marked as a favorite, the handler will be called with the original menu item, not the favorite item.- Parameters:
handler- the event handler to associate with this menu item. This handler is invoked with the event and the current menu item instance when a click event occurs.- Returns:
- the current
MenuIteminstance, allowing for method chaining.
-
identifier
Description copied from interface:HasIdentifierRetrieves the identifier associated with this component.- Specified by:
identifierin interfaceHasIdentifier<HTMLElement, MenuItem>- Returns:
- the identifier of the component
-
has
Description copied from interface:ComponentContextDetermines whether a value is stored with the specified key.- Specified by:
hasin interfaceComponentContext<HTMLElement, MenuItem>- Parameters:
key- the key to check- Returns:
- true if a value is stored with the specified key, false otherwise
-
get
Description copied from interface:ComponentContextRetrieves the value associated with the given key from the ComponentContext.- Specified by:
getin interfaceComponentContext<HTMLElement, MenuItem>- Type Parameters:
T- the type of the value being retrieved- Parameters:
key- the key associated with the value- Returns:
- the value associated with the key, or null if no value is found