Class NavigationGroup
java.lang.Object
org.patternfly.component.SubComponent<HTMLElement, NavigationGroup>
org.patternfly.component.navigation.NavigationGroup
- All Implemented Interfaces:
Iterable<NavigationItem>, ElementAttributeMethods<HTMLElement, NavigationGroup>, ElementClassListMethods<HTMLElement, NavigationGroup>, ElementConsumerMethods<HTMLElement, NavigationGroup>, ElementContainerDelegate<HTMLElement, NavigationGroup>, ElementContainerMethods<HTMLElement, NavigationGroup>, ElementEventMethods<HTMLElement, NavigationGroup>, ElementIdMethods<HTMLElement, NavigationGroup>, ElementQueryMethods<HTMLElement>, ElementTextDelegate<HTMLElement, NavigationGroup>, ElementTextMethods<HTMLElement, NavigationGroup>, HTMLElementAttributeMethods<HTMLElement, NavigationGroup>, HTMLElementDataMethods<HTMLElement, NavigationGroup>, HTMLElementStyleMethods<HTMLElement, NavigationGroup>, HTMLElementVisibilityMethods<HTMLElement, NavigationGroup>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, NavigationGroup>, HasIdentifier<HTMLElement, NavigationGroup>, HasItems<HTMLElement, NavigationGroup, NavigationItem>
public class NavigationGroup
extends SubComponent<HTMLElement, NavigationGroup>
implements ElementContainerDelegate<HTMLElement, NavigationGroup>, ElementTextDelegate<HTMLElement, NavigationGroup>, HasIdentifier<HTMLElement, NavigationGroup>, HasItems<HTMLElement, NavigationGroup, NavigationItem>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionadd(NavigationItem item) Adds an item to the component.voidclear()Clears all items from the component.booleanChecks whether the component contains an item associated with the given identifier.Retrieves the identifier associated with this component.insertItemAfter(NavigationItem item, String afterIdentifier) insertItemBefore(NavigationItem item, String beforeIdentifier) booleanisEmpty()Checks whether the collection of items in the component is empty.Retrieves the item associated with the specified identifier from the component.iterator()static NavigationGroupnavigationGroup(String identifier) static NavigationGroupnavigationGroup(String identifier, String text) onAdd(AddItemHandler<NavigationGroup, NavigationItem> onAdd) Registers a callback to be invoked whenever a new item is added to the component.onRemove(RemoveItemHandler<NavigationGroup, NavigationItem> onRemove) Registers a callback to be invoked whenever an item is removed from the component.onUpdate(UpdateItemHandler<NavigationGroup, NavigationItem> onUpdate) Registers a callback to be invoked whenever an item is updated in the component.voidremoveItem(String identifier) Removes an item from the component based on the provided identifier.intsize()Retrieves the total number of items currently contained in the component.that()voidupdateItem(NavigationItem 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 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 ElementContainerDelegate
add, add, addMethods inherited from interface ElementContainerMethods
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 ElementTextDelegate
text, textMethods 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, spliterator
-
Field Details
-
SUB_COMPONENT_NAME
- See Also:
-
-
Method Details
-
containerDelegate
- Specified by:
containerDelegatein interfaceElementContainerDelegate<HTMLElement, NavigationGroup>
-
textDelegate
- Specified by:
textDelegatein interfaceElementTextDelegate<HTMLElement, NavigationGroup>
-
addDivider
-
add
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, NavigationGroup>
-
onAdd
Description copied from interface:HasItemsRegisters a callback to be invoked whenever a new item is added to the component.- Specified by:
onAddin interfaceHasItems<HTMLElement, NavigationGroup, NavigationItem>- 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<HTMLElement, NavigationGroup, NavigationItem>- 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<HTMLElement, NavigationGroup, NavigationItem>- Parameters:
onRemove- aRemoveItemHandlerthat takes the component and the item being removed as arguments- Returns:
- the builder instance after adding the callback
-
identifier
Description copied from interface:HasIdentifierRetrieves the identifier associated with this component.- Specified by:
identifierin interfaceHasIdentifier<HTMLElement, NavigationGroup>- Returns:
- the identifier of the component
-
iterator
- Specified by:
iteratorin interfaceIterable<NavigationItem>
-
size
public int size()Description copied from interface:HasItemsRetrieves the total number of items currently contained in the component.- Specified by:
sizein interfaceHasItems<HTMLElement, NavigationGroup, NavigationItem>- Returns:
- the number of items contained in the component
-
isEmpty
public boolean isEmpty()Description copied from interface:HasItemsChecks whether the collection of items in the component is empty.- Specified by:
isEmptyin interfaceHasItems<HTMLElement, NavigationGroup, NavigationItem>- Returns:
trueif the component contains no items;falseotherwise
-
contains
Description copied from interface:HasItemsChecks whether the component contains an item associated with the given identifier.- Specified by:
containsin interfaceHasItems<HTMLElement, NavigationGroup, NavigationItem>- 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<HTMLElement, NavigationGroup, NavigationItem>- 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<HTMLElement, NavigationGroup, NavigationItem>- 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<HTMLElement, NavigationGroup, NavigationItem>