Package org.patternfly.component.menu
Class Menu
- All Implemented Interfaces:
Container<HTMLDivElement,
,Menu> Finder<HTMLDivElement>
,HasElement<HTMLDivElement,
,Menu> HasHTMLElement<HTMLDivElement,
,Menu> IsElement<HTMLDivElement>
,TypedBuilder<HTMLDivElement,
,Menu> Component
,Modifiers.Plain<HTMLDivElement,
Menu>
- Direct Known Subclasses:
DropdownMenu
,SingleSelectMenu
public class Menu
extends BaseComponent<HTMLDivElement,Menu>
implements Modifiers.Plain<HTMLDivElement,Menu>
A menu is a list of options or actions that users can choose from. It can be used in a variety of contexts whenever the user
needs to choose between multiple values, options, or actions. A menu is most often paired with a
MenuToggle
as its
trigger, but can also be used inline or can be attached to other interactable elements to toggle it open and close.
Menu menu = menu(MenuType.menu, click)
.scrollable()
.height("200px")
.addHeader("Header")
.addContent(menuContent()
.addList(menuList()
.addItem(MenuItem.actionMenuItem("1", "Item 1"))
.addItem(MenuItem.actionMenuItem("2", "Item 2"))
.addDivider()
.addItem(MenuItem.linkMenuItem("3", "Item 3", "#third"))))
.addFooter(menuFooter()
.add(button("Footer")));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd
(MenuContent content) addContent
(MenuContent content) Shortcut foraddFooter(menuFooter(text))
addFooter
(MenuFooter footer) Shortcut foraddHeader(menuHeader(text))
addHeader
(MenuHeader header) addSearchInput
(MenuSearchInput searchInput) addSearchInput
(MenuSearchInput searchInput, boolean noSeparator) flyout()
Sets the--pf-v5-c-menu__content--MaxHeight
variable to the specified valuestatic Menu
menu
(MenuType menuType, SelectionMode selectionMode) static Menu
menu
(SelectionMode selectionMode) onAction
(MenuActionHandler actionHandler) onMultiSelect
(MultiSelectHandler<Menu, MenuItem> selectHandler) onSingleSelect
(SelectHandler<MenuItem> selectHandler) void
void
void
void
void
void
that()
Methods inherited from class org.patternfly.component.BaseComponent
componentType, element
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.elemento.Container
add, add, add, addAll, addAll, addAll, addAll, addAll, addAll
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, classList, classList, css, id, innerHtml, on, on, on, run, textContent, textNode, toggle, toggle, toggle, uniqueId
Methods inherited from interface org.jboss.elemento.HasHTMLElement
data, hidden, style, style, style, style, style, style, title
Methods inherited from interface org.patternfly.style.Modifiers.Plain
plain, plain
-
Method Details
-
addHeader
Shortcut foraddHeader(menuHeader(text))
-
addDivider
-
flyout
-
scrollable
-
favorites
-
height
Sets the--pf-v5-c-menu__content--MaxHeight
variable to the specified value -
that
- Specified by:
that
in interfaceTypedBuilder<HTMLDivElement,
Menu>
-
onSingleSelect
-
onMultiSelect
-
select
-
select
-
select