Class Navigation
java.lang.Object
org.patternfly.component.BaseComponent<HTMLElement,Navigation>
org.patternfly.component.navigation.Navigation
- All Implemented Interfaces:
Iterable<NavigationItem>
,Attachable
,Container<HTMLElement,
,Navigation> Finder<HTMLElement>
,HasElement<HTMLElement,
,Navigation> HasHTMLElement<HTMLElement,
,Navigation> IsElement<HTMLElement>
,TypedBuilder<HTMLElement,
,Navigation> Component
,HasItems<HTMLElement,
Navigation, NavigationItem>
public class Navigation
extends BaseComponent<HTMLElement,Navigation>
implements HasItems<HTMLElement,Navigation,NavigationItem>, Attachable
A navigation organizes an application's structure and content, making it easy to find information and accomplish tasks.
Navigation communicates relationships, context, and actions a user can take within an application.
navigation(primary)
.addItem(navigationItem("itm-1", "Item 1", "#itm-1"))
.addItem(navigationItem("itm-2", "Item 2", "#itm-2"))
.addItem(navigationItem("itm-3", "Item 3", "#itm-3"));
navigation(grouped)
.addGroup(navigationGroup("grp-1", "Group 1")
.addItem(navigationItem("grp-1-itm-1", "Item 1", "#grp-1-itm-1"))
.addItem(navigationItem("grp-1-itm-2", "Item 2", "#grp-1-itm-2"))
.addItem(navigationItem("grp-1-itm-3", "Item 3", "#grp-1-itm-3")))
.addGroup(navigationGroup("grp-2", "Group 2")
.addItem(navigationItem("grp-2-itm-1", "Item 1", "#grp-2-itm-1"))
.addItem(navigationItem("grp-2-itm-2", "Item 2", "#grp-2-itm-2"))
.addDivider()
.addItem(navigationItem("grp-2-itm-3", "Item 3", "#grp-2-itm-3")));
navigation(expandable)
.addItem(navigationItem("itm-1", "Item 1", "#itm-1"))
.addDivider()
.addGroup(expandableNavigationGroup("grp-1", "Group 1")
.addItem(navigationItem("grp-1-itm-1", "Item 1", "#grp-1-itm-1"))
.addItem(navigationItem("grp-1-itm-2", "Item 2", "#grp-1-itm-2"))
.addDivider()
.addItem(navigationItem("grp-1-itm-3", "Item 3", "#grp-1-itm-3")))
.addItem(navigationItem("itm-2", "Item 2", "#itm-2"))
.addItem(navigationItem("itm-3", "Item 3", "#itm-3"))
.addGroup(expandableNavigationGroup("grp-2", "Group 2")
.addItem(navigationItem("grp-2-itm-1", "Item 1", "#grp-2-itm-1"))
.addItem(navigationItem("grp-2-itm-2", "Item 2", "#grp-2-itm-2"))
.addGroup(expandableNavigationGroup("nested-grp-1", "Nested Group")
.addItem(navigationItem("nested-grp-1-itm-1", "Item 1", "#nested-grp-1-itm-1"))
.addDivider()
.addItem(navigationItem("nested-grp-1-itm-2", "Item 2", "#nested-grp-1-itm-2"))));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd
(ExpandableNavigationGroup group) add
(NavigationGroup group) add
(NavigationItem item) addGroup
(NavigationGroup group) addItem
(NavigationItem item) <T> Navigation
addItems
(Iterable<T> items, Function<T, NavigationItem> display) ariaScrollBackLabel
(String label) Aria-label for the back scroll buttonariaScrollForwardLabel
(String label) Aria-label for the forward scroll buttonvoid
attach
(MutationRecord mutationRecord) void
clear()
void
detach
(MutationRecord mutationRecord) insertGroupAfter
(ExpandableNavigationGroup group, String afterIdentifier) insertGroupAfter
(NavigationGroup group, String afterIdentifier) insertGroupBefore
(ExpandableNavigationGroup group, String beforeIdentifier) insertGroupBefore
(NavigationGroup group, String beforeIdentifier) insertItemAfter
(NavigationItem item, String afterIdentifier) insertItemBefore
(NavigationItem item, String beforeIdentifier) boolean
isEmpty()
iterator()
static Navigation
navigation
(NavigationType type) onSelect
(SelectHandler<NavigationItem> selectHandler) onToggle
(ToggleHandler<ExpandableNavigationGroup> toggleHandler) void
void
void
select
(NavigationItem item) void
select
(NavigationItem item, boolean fireEvent) int
size()
that()
theme
(Brightness theme) 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 java.lang.Iterable
forEach, spliterator
-
Method Details
-
attach
- Specified by:
attach
in interfaceAttachable
-
detach
- Specified by:
detach
in interfaceAttachable
-
addItems
- Specified by:
addItems
in interfaceHasItems<HTMLElement,
Navigation, NavigationItem>
-
addDivider
-
add
-
theme
-
that
- Specified by:
that
in interfaceTypedBuilder<HTMLElement,
Navigation>
-
ariaScrollBackLabel
Aria-label for the back scroll button -
ariaScrollForwardLabel
Aria-label for the forward scroll button -
onSelect
-
onToggle
-
select
-
select
-
iterator
- Specified by:
iterator
in interfaceIterable<NavigationItem>
-
size
public int size()- Specified by:
size
in interfaceHasItems<HTMLElement,
Navigation, NavigationItem>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceHasItems<HTMLElement,
Navigation, NavigationItem>
-
clear
public void clear()- Specified by:
clear
in interfaceHasItems<HTMLElement,
Navigation, NavigationItem>