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) 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.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 org.patternfly.component.SubComponent
element, registerSubComponentMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.elemento.Attachable
detachMethods inherited from interface org.patternfly.core.ComponentContext
get, getMethods inherited from interface org.patternfly.component.ComponentIcon
iconMethods inherited from interface org.patternfly.component.ComponentIconAndText
iconAndText, iconAndTextMethods inherited from interface org.jboss.elemento.ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface org.jboss.elemento.ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface org.jboss.elemento.ElementConsumerMethods
apply, runMethods inherited from interface org.jboss.elemento.ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface org.jboss.elemento.ElementEventMethods
on, on, onMethods inherited from interface org.jboss.elemento.ElementIdMethods
id, uniqueIdMethods inherited from interface org.jboss.elemento.ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface org.jboss.elemento.ElementTextDelegate
text, textMethods inherited from interface org.jboss.elemento.HTMLElementAttributeMethods
titleMethods inherited from interface org.jboss.elemento.HTMLElementDataMethods
dataMethods inherited from interface org.jboss.elemento.HTMLElementStyleMethods
style, style, style, style, style, styleMethods inherited from interface org.jboss.elemento.HTMLElementVisibilityMethods
hiddenMethods inherited from interface org.patternfly.style.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
- Specified by:
identifierin interfaceHasIdentifier<HTMLElement, MenuItem>
-
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