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) external()<T> TbooleaniconAndText(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> MenuItemtext(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
Create a new menu item with typeMenuItemType.link. -
checkboxMenuItem
Create a new menu item with typeMenuItemType.link. -
asyncMenuItem
-
skeletonMenuItem
-
attach
- Specified by:
attachin interfaceAttachable
-
textDelegate
- Specified by:
textDelegatein interfaceElementTextDelegate<HTMLElement, MenuItem>
-
ariaDisabled
-
ariaDisabled
-
danger
-
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
- Specified by:
storein interfaceComponentContext<HTMLElement, MenuItem>
-
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
- Specified by:
hasin interfaceComponentContext<HTMLElement, MenuItem>
-
get
- Specified by:
getin interfaceComponentContext<HTMLElement, MenuItem>