Package org.patternfly.component.tabs
Class Tabs
- java.lang.Object
-
- org.patternfly.component.BaseComponentFlat<HTMLElement,Tabs>
-
- org.patternfly.component.tabs.Tabs
-
- All Implemented Interfaces:
Attachable,Finder<HTMLElement>,HasElement<HTMLElement,Tabs>,HasHTMLElement<HTMLElement,Tabs>,IsElement<HTMLElement>,TypedBuilder<HTMLElement,Tabs>,Component,Expandable<HTMLElement,Tabs>,Modifiers.Box<HTMLElement,Tabs>,Modifiers.Fill<HTMLElement,Tabs>,Modifiers.PageInsets<HTMLElement,Tabs>,Modifiers.Secondary<HTMLElement,Tabs>,Modifiers.Vertical<HTMLElement,Tabs>
public class Tabs extends BaseComponentFlat<HTMLElement,Tabs> implements Attachable, Modifiers.Box<HTMLElement,Tabs>, Expandable<HTMLElement,Tabs>, Modifiers.Fill<HTMLElement,Tabs>, Modifiers.PageInsets<HTMLElement,Tabs>, Modifiers.Secondary<HTMLElement,Tabs>, Modifiers.Vertical<HTMLElement,Tabs>
Tabs allow users to navigate between views within the same page or context.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tabsadd(Tab tab)TabsaddTab(Tab tab)<T> TabsaddTabs(Iterable<T> items, Function<T,Tab> display)TabsariaAddLabel(String label)Aria-label for the add button.TabsariaLabel(String label)Provides an accessible label for the tabs.TabsariaOverflowLabel(String label)The aria label applied to the button which toggles the tab overflow menuTabsariaScrollBackLabel(String label)Aria-label for the back scroll buttonTabsariaScrollForwardLabel(String label)Aria-label for the forward scroll buttonTabsariaToggleLabel(String label)Aria-label for the expandable togglevoidattach(MutationRecord mutationRecord)Tabsbox(boolean box)voidclose(String id)voidclose(Tab tab)Tabscloseable()Tabscloseable(CloseHandler<Tab> closeHandler)voidcollapse(boolean fireEvent)TabcurrentTab()voiddetach(MutationRecord mutationRecord)voidexpand(boolean fireEvent)Tabsexpandable(Breakpoints<ExpandableModifier> expandable)Enable expandable vertical tabs at various breakpoints (Modifiers.Vertical.vertical()should be set to true for this to work).booleanexpanded()Tabsfill(boolean fill)Tabsinset(Breakpoints<Inset> inset)Insets at various breakpoints.TabslightTabs()Same as lightTabs(true)TabslightTabs(boolean lightTabs)Enables lightTabs styling to the tab componentTabsnoBorderBottom()Same as noBorderBottom(true)TabsnoBorderBottom(boolean noBorderBottom)Disables border bottom tab styling on tabs.TabsnoInitialSelection()By default, the first tab is selected initially.TabsonAdd(Function<Tabs,Tab> addHandler)Callback for the add button.TabsonClose(CloseHandler<Tab> closeHandler)TabsonSelect(SelectHandler<Tab> selectHandler)TabsonToggle(ToggleHandler<Tabs> toggleHandler)TabsoverflowHorizontal()Flag which places overflowing tabs into a menu triggered by the last tab.TabsoverflowHorizontal(String overflowText)Flag which places overflowing tabs into a menu triggered by the last tab.TabspageInsets(boolean pageInsets)Tabssecondary(boolean secondary)Enables secondary styling to the tab componentvoidselect(String id)voidselect(Tab tab)TabsshowTabCount()Same as showTabCount(true)TabsshowTabCount(boolean showTabCount)Flag which shows the count of overflowing tabs when enabledTabtab(String id)static Tabstabs()static <E extends HTMLElement>
Tabstabs(HTMLContainerBuilder<E> builder)Tabsthat()TabstoggleText(String text)Text that appears in the expandable toggle.Tabsvertical(boolean vertical)-
Methods inherited from class org.patternfly.component.BaseComponentFlat
componentType, element
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.patternfly.component.Expandable
collapse, expand, toggle, toggle
-
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, classList, classList, css, id, id, innerHtml, 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.Box
box
-
Methods inherited from interface org.patternfly.style.Modifiers.Fill
fill
-
Methods inherited from interface org.patternfly.style.Modifiers.PageInsets
pageInsets
-
Methods inherited from interface org.patternfly.style.Modifiers.Secondary
secondary
-
Methods inherited from interface org.patternfly.style.Modifiers.Vertical
vertical
-
-
-
-
Method Detail
-
tabs
public static Tabs tabs()
-
tabs
public static <E extends HTMLElement> Tabs tabs(HTMLContainerBuilder<E> builder)
-
attach
public void attach(MutationRecord mutationRecord)
- Specified by:
attachin interfaceAttachable
-
detach
public void detach(MutationRecord mutationRecord)
- Specified by:
detachin interfaceAttachable
-
box
public Tabs box(boolean box)
- Specified by:
boxin interfaceModifiers.Box<HTMLElement,Tabs>
-
closeable
public Tabs closeable()
-
closeable
public Tabs closeable(CloseHandler<Tab> closeHandler)
-
expandable
public Tabs expandable(Breakpoints<ExpandableModifier> expandable)
Enable expandable vertical tabs at various breakpoints (Modifiers.Vertical.vertical()should be set to true for this to work).
-
fill
public Tabs fill(boolean fill)
- Specified by:
fillin interfaceModifiers.Fill<HTMLElement,Tabs>
-
lightTabs
public Tabs lightTabs()
Same as lightTabs(true)
-
lightTabs
public Tabs lightTabs(boolean lightTabs)
Enables lightTabs styling to the tab component
-
inset
public Tabs inset(Breakpoints<Inset> inset)
Insets at various breakpoints.
-
noBorderBottom
public Tabs noBorderBottom()
Same as noBorderBottom(true)
-
noBorderBottom
public Tabs noBorderBottom(boolean noBorderBottom)
Disables border bottom tab styling on tabs. Defaults to false. To remove the bottom border, set this prop to true.
-
pageInsets
public Tabs pageInsets(boolean pageInsets)
- Specified by:
pageInsetsin interfaceModifiers.PageInsets<HTMLElement,Tabs>
-
overflowHorizontal
public Tabs overflowHorizontal()
Flag which places overflowing tabs into a menu triggered by the last tab. Unlike other flags, this can only be turned on, but not off.
-
overflowHorizontal
public Tabs overflowHorizontal(String overflowText)
Flag which places overflowing tabs into a menu triggered by the last tab. Unlike other flags, this can only be turned on, but not off.
-
noInitialSelection
public Tabs noInitialSelection()
By default, the first tab is selected initially. Call this method to disable thi default behaviour.
-
secondary
public Tabs secondary(boolean secondary)
Enables secondary styling to the tab component- Specified by:
secondaryin interfaceModifiers.Secondary<HTMLElement,Tabs>
-
showTabCount
public Tabs showTabCount()
Same as showTabCount(true)
-
showTabCount
public Tabs showTabCount(boolean showTabCount)
Flag which shows the count of overflowing tabs when enabled
-
toggleText
public Tabs toggleText(String text)
Text that appears in the expandable toggle. If not set, the text of the selected tab is used.
-
vertical
public Tabs vertical(boolean vertical)
- Specified by:
verticalin interfaceModifiers.Vertical<HTMLElement,Tabs>
-
that
public Tabs that()
- Specified by:
thatin interfaceTypedBuilder<HTMLElement,Tabs>
-
ariaLabel
public Tabs ariaLabel(String label)
Provides an accessible label for the tabs. Labels should be unique for each set of tabs that are present on a page. When component is set to nav, this prop should be defined to differentiate the tabs from other navigation regions on the page.
-
ariaScrollBackLabel
public Tabs ariaScrollBackLabel(String label)
Aria-label for the back scroll button
-
ariaScrollForwardLabel
public Tabs ariaScrollForwardLabel(String label)
Aria-label for the forward scroll button
-
ariaOverflowLabel
public Tabs ariaOverflowLabel(String label)
The aria label applied to the button which toggles the tab overflow menu
-
onAdd
public Tabs onAdd(Function<Tabs,Tab> addHandler)
Callback for the add button. Passing this property inserts the add button.
-
onClose
public Tabs onClose(CloseHandler<Tab> closeHandler)
-
onSelect
public Tabs onSelect(SelectHandler<Tab> selectHandler)
-
onToggle
public Tabs onToggle(ToggleHandler<Tabs> toggleHandler)
-
expanded
public boolean expanded()
- Specified by:
expandedin interfaceExpandable<HTMLElement,Tabs>- Returns:
trueif the elements class list has the modifierClasses.expanded,falseotherwise.
-
collapse
public void collapse(boolean fireEvent)
- Specified by:
collapsein interfaceExpandable<HTMLElement,Tabs>
-
expand
public void expand(boolean fireEvent)
- Specified by:
expandin interfaceExpandable<HTMLElement,Tabs>
-
close
public void close(String id)
-
close
public void close(Tab tab)
-
select
public void select(String id)
-
select
public void select(Tab tab)
-
currentTab
public Tab currentTab()
-
-