Class MenuList
java.lang.Object
org.patternfly.component.SubComponent<elemental2.dom.HTMLUListElement, MenuList>
org.patternfly.component.menu.MenuList
- All Implemented Interfaces:
Iterable<MenuItem>, Attachable, ElementAttributeMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementClassListMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementConsumerMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementContainerMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementEventMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementIdMethods<elemental2.dom.HTMLUListElement, MenuList>, ElementQueryMethods<elemental2.dom.HTMLUListElement>, HTMLElementAttributeMethods<elemental2.dom.HTMLUListElement, MenuList>, HTMLElementDataMethods<elemental2.dom.HTMLUListElement, MenuList>, HTMLElementStyleMethods<elemental2.dom.HTMLUListElement, MenuList>, HTMLElementVisibilityMethods<elemental2.dom.HTMLUListElement, MenuList>, IsElement<elemental2.dom.HTMLUListElement>, TypedBuilder<elemental2.dom.HTMLUListElement, MenuList>, HasAsyncItems<MenuList,MenuItem>, HasItems<elemental2.dom.HTMLUListElement, MenuList, MenuItem>, Ordered<elemental2.dom.HTMLUListElement, MenuList, MenuItem>, OuiaSupport<elemental2.dom.HTMLUListElement, MenuList>
public class MenuList
extends SubComponent<elemental2.dom.HTMLUListElement, MenuList>
implements HasAsyncItems<MenuList,MenuItem>, Ordered<elemental2.dom.HTMLUListElement, MenuList, MenuItem>, Attachable
A menu list within a
Menu component.-
Field Summary
FieldsFields inherited from interface Ordered
DATA_ORDER -
Method Summary
Modifier and TypeMethodDescriptionadd(AsyncItems<MenuList, MenuItem> items) Adds an item to the component.voidattach(elemental2.dom.MutationRecord mutationRecord) voidclear()Removes all items from the DOM and the internal map.Retrieves the comparator used for ordering elements in a component.booleanChecks whether the component contains an item associated with the given identifier.Sets a custom supplier for the error indicator shown when async items fail to load.booleanisEmpty()Checks whether the collection of items in the component is empty.Retrieves the item associated with the specified identifier from the component.iterator()load()Fetches items for the first time.Sets a custom supplier for the loading indicator shown while async items are being loaded.static MenuListmenuList()Creates a new menu list component.Sets a custom supplier for the "no items" indicator shown when async items return an empty result.onAdd(AddItemHandler<MenuList, MenuItem> onAdd) Registers a callback to be invoked whenever a new item is added to the component.onRemove(RemoveItemHandler<MenuList, MenuItem> onRemove) Registers a callback to be invoked whenever an item is removed from the component.onUpdate(UpdateItemHandler<MenuList, MenuItem> onUpdate) Registers a callback to be invoked whenever an item is updated in the component.ordered(Comparator<MenuItem> comparator) Orders the elements contained in the component using the specified comparator.refresh()Re-fetches items while keeping old items visible, then swaps them after the new items arrive.voidremoveItem(String identifier) Removes an item from the component based on the provided identifier.voidreset()Clears all items and sets status back toAsyncStatus.pending.intsize()Retrieves the total number of items currently contained in the component.status()that()voidupdateItem(MenuItem item) Updates an existing item in the component.Methods inherited from class SubComponent
element, ouiaComponentType, registerSubComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Attachable
detachMethods 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 HasAsyncItems
addItemsMethods inherited from interface HasItems
addItem, addItems, items, replaceItemElement, updateItem, updateItemMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hiddenMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Ordered
addOrdered, defaultOrder, orderedMethods inherited from interface OuiaSupport
initOuia, ouiaId, ouiaSafe, ouiaTransition
-
Field Details
-
SUB_COMPONENT_ID
- See Also:
-
SUB_COMPONENT_NAME
- See Also:
-
-
Method Details
-
attach
public void attach(elemental2.dom.MutationRecord mutationRecord) - Specified by:
attachin interfaceAttachable
-
add
- Specified by:
addin interfaceHasAsyncItems<MenuList,MenuItem>
-
addDivider
-
loading
-
noItems
-
error
-
ordered
Description copied from interface:OrderedOrders the elements contained in the component using the specified comparator. The comparator determines the order in which the elements are arranged. -
that
- Specified by:
thatin interfaceTypedBuilder<elemental2.dom.HTMLUListElement, MenuList>
-
onAdd
Description copied from interface:HasItemsRegisters a callback to be invoked whenever a new item is added to the component.- Specified by:
onAddin interfaceHasItems<elemental2.dom.HTMLUListElement, MenuList, MenuItem>- Parameters:
onAdd- aAddItemHandlerthat takes the builder instance and the item being added as arguments- Returns:
- the builder instance after adding the callback
-
onUpdate
Description copied from interface:HasItemsRegisters a callback to be invoked whenever an item is updated in the component.- Specified by:
onUpdatein interfaceHasItems<elemental2.dom.HTMLUListElement, MenuList, MenuItem>- Parameters:
onUpdate- aUpdateItemHandlerthat takes the component, the previous state of the item, and the updated state of the item as arguments- Returns:
- the builder instance after adding the callback
-
onRemove
Description copied from interface:HasItemsRegisters a callback to be invoked whenever an item is removed from the component.- Specified by:
onRemovein interfaceHasItems<elemental2.dom.HTMLUListElement, MenuList, MenuItem>- Parameters:
onRemove- aRemoveItemHandlerthat takes the component and the item being removed as arguments- Returns:
- the builder instance after adding the callback
-
comparator
Description copied from interface:OrderedRetrieves the comparator used for ordering elements in a component.- Specified by:
comparatorin interfaceOrdered<elemental2.dom.HTMLUListElement, MenuList, MenuItem>- Returns:
- the comparator that determines the order of elements
-
load
Description copied from interface:HasAsyncItemsFetches items for the first time. Only runs when status isAsyncStatus.pending. Idempotent.- Specified by:
loadin interfaceHasAsyncItems<MenuList,MenuItem>
-
refresh
Description copied from interface:HasAsyncItemsRe-fetches items while keeping old items visible, then swaps them after the new items arrive.- Specified by:
refreshin interfaceHasAsyncItems<MenuList,MenuItem>
-
reset
public void reset()Description copied from interface:HasAsyncItemsClears all items and sets status back toAsyncStatus.pending. Does not fetch.- Specified by:
resetin interfaceHasAsyncItems<MenuList,MenuItem>
-
status
- Specified by:
statusin interfaceHasAsyncItems<MenuList,MenuItem>
-
iterator
-
size
-
isEmpty
-
contains
Description copied from interface:HasItemsChecks whether the component contains an item associated with the given identifier. -
item
Description copied from interface:HasItemsRetrieves the item associated with the specified identifier from the component. -
removeItem
Description copied from interface:HasItemsRemoves an item from the component based on the provided identifier.- Specified by:
removeItemin interfaceHasItems<elemental2.dom.HTMLUListElement, MenuList, MenuItem>- Parameters:
identifier- the identifier of the item to be removed
-
clear