Class MenuList
java.lang.Object
org.patternfly.component.SubComponent<HTMLUListElement, MenuList>
org.patternfly.component.menu.MenuList
- All Implemented Interfaces:
Iterable<MenuItem>, Attachable, ElementAttributeMethods<HTMLUListElement, MenuList>, ElementClassListMethods<HTMLUListElement, MenuList>, ElementConsumerMethods<HTMLUListElement, MenuList>, ElementContainerMethods<HTMLUListElement, MenuList>, ElementEventMethods<HTMLUListElement, MenuList>, ElementIdMethods<HTMLUListElement, MenuList>, ElementQueryMethods<HTMLUListElement>, HTMLElementAttributeMethods<HTMLUListElement, MenuList>, HTMLElementDataMethods<HTMLUListElement, MenuList>, HTMLElementStyleMethods<HTMLUListElement, MenuList>, HTMLElementVisibilityMethods<HTMLUListElement, MenuList>, IsElement<HTMLUListElement>, TypedBuilder<HTMLUListElement, MenuList>, HasItems<HTMLUListElement, MenuList, MenuItem>, Ordered<HTMLUListElement, MenuList, MenuItem>
public class MenuList
extends SubComponent<HTMLUListElement, MenuList>
implements Ordered<HTMLUListElement, MenuList, MenuItem>, Attachable
-
Field Summary
FieldsFields inherited from interface Ordered
DATA_ORDER -
Method Summary
Modifier and TypeMethodDescriptionadd(AsyncItems<MenuList, MenuItem> items) Adds an item to the component.addItems(AsyncItems<MenuList, MenuItem> items) voidattach(MutationRecord mutationRecord) voidclear()Clears all items from the component.Retrieves the comparator used for ordering elements in a component.booleanChecks whether the component contains an item associated with the given identifier.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()static MenuListmenuList()Creates a new menu list component.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.reload()voidremoveItem(String identifier) Removes an item from the component based on the provided identifier.voidreset()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, 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 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, ordered
-
Field Details
-
SUB_COMPONENT_NAME
- See Also:
-
-
Method Details
-
attach
- Specified by:
attachin interfaceAttachable
-
addItems
-
add
-
addDivider
-
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.- Specified by:
orderedin interfaceOrdered<HTMLUListElement, MenuList, MenuItem>- Parameters:
comparator- the comparator used to define the ordering of the elements- Returns:
- the builder instance with the elements ordered
-
that
- Specified by:
thatin interfaceTypedBuilder<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<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<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<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<HTMLUListElement, MenuList, MenuItem>- Returns:
- the comparator that determines the order of elements
-
load
-
reset
public void reset() -
reload
-
status
-
iterator
-
size
-
isEmpty
-
contains
Description copied from interface:HasItemsChecks whether the component contains an item associated with the given identifier.- Specified by:
containsin interfaceHasItems<HTMLUListElement, MenuList, MenuItem>- Parameters:
identifier- the identifier of the item to be checked- Returns:
- true if the component contains an item associated with the provided identifier, false otherwise
-
item
Description copied from interface:HasItemsRetrieves the item associated with the specified identifier from the component.- Specified by:
itemin interfaceHasItems<HTMLUListElement, MenuList, MenuItem>- Parameters:
identifier- the identifier of the item to be retrieved- Returns:
- the item associated with the given identifier, or
nullif no item is found
-
removeItem
Description copied from interface:HasItemsRemoves an item from the component based on the provided identifier.- Specified by:
removeItemin interfaceHasItems<HTMLUListElement, MenuList, MenuItem>- Parameters:
identifier- the identifier of the item to be removed
-
clear
public void clear()Description copied from interface:HasItemsClears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.- Specified by:
clearin interfaceHasItems<HTMLUListElement, MenuList, MenuItem>