Package org.patternfly.component.menu
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> org.patternfly.core.ComponentContext<HTMLElement,,MenuItem> org.patternfly.style.Modifiers.Disabled<HTMLElement,MenuItem>
public class MenuItem
extends SubComponent<HTMLElement,MenuItem>
implements Attachable, org.patternfly.core.ComponentContext<HTMLElement,MenuItem>, ComponentIcon<HTMLElement,MenuItem>, ComponentIconAndText<HTMLElement,MenuItem>, org.patternfly.style.Modifiers.Disabled<HTMLElement,MenuItem>, ElementTextDelegate<HTMLElement,MenuItem>, HasIdentifier<HTMLElement,MenuItem>
-
Method Summary
Modifier and TypeMethodDescriptionadd(MenuItemAction itemAction) addAction(MenuItemAction itemAction) ariaDisabled(boolean ariaDisabled) static MenuItemvoidattach(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) 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.Registers an event handler to be invoked when the menu item is clicked.selected()<T> MenuItemtext(HTMLElement element) that()Methods inherited from class org.patternfly.component.SubComponent
elementMethods 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
-
Method Details
-
linkMenuItem
Create a new menu item with typeMenuItemType.link. -
checkboxMenuItem
Create a new menu item with typeMenuItemType.link. -
asyncMenuItem
-
attach
- Specified by:
attachin interfaceAttachable
-
textDelegate
- Specified by:
textDelegatein interfaceElementTextDelegate<HTMLElement,MenuItem>
-
ariaDisabled
-
ariaDisabled
-
danger
-
disabled
- Specified by:
disabledin interfaceorg.patternfly.style.Modifiers.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 interfaceorg.patternfly.core.ComponentContext<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
- Specified by:
identifierin interfaceHasIdentifier<HTMLElement,MenuItem>
-
has
- Specified by:
hasin interfaceorg.patternfly.core.ComponentContext<HTMLElement,MenuItem>
-
get
- Specified by:
getin interfaceorg.patternfly.core.ComponentContext<HTMLElement,MenuItem>