Class Breadcrumbs
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.breadcrumbs.Breadcrumbs
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.shared.HasThemeVariant<BreadcrumbsVariant>,Serializable
@Tag("vaadin-breadcrumbs")
@NpmPackage(value="@vaadin/breadcrumbs",
version="25.2.3")
@JsModule("@vaadin/breadcrumbs/src/vaadin-breadcrumbs.js")
public class Breadcrumbs
extends com.vaadin.flow.component.Component
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>, com.vaadin.flow.component.shared.HasThemeVariant<BreadcrumbsVariant>
Breadcrumbs is a component for displaying a navigation trail that shows the
user's location within a hierarchy of pages.
This component is experimental and needs to be enabled with the
com.vaadin.experimental.breadcrumbsComponent feature flag.
- Since:
- 25.2
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe internationalization properties forBreadcrumbs.static enumThe mode that determines how the breadcrumb trail is populated. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new breadcrumbs component inBreadcrumbs.Mode.ROUTERmode.Breadcrumbs(Breadcrumbs.Mode mode) Creates a new breadcrumbs component in the given mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(BreadcrumbsItem... components) voidadd(Collection<BreadcrumbsItem> components) voidaddComponentAsFirst(BreadcrumbsItem component) voidaddComponentAtIndex(int index, BreadcrumbsItem component) <V extends @Nullable Object,S extends com.vaadin.flow.signals.Signal<V>>
voidbindChildren(com.vaadin.flow.signals.Signal<List<S>> list, com.vaadin.flow.function.SerializableFunction<S, BreadcrumbsItem> childFactory) getI18n()Gets the internationalization object previously set for this component.getMode()Gets the mode that determines how the breadcrumb trail is populated.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) voidremove(BreadcrumbsItem... components) voidremove(Collection<BreadcrumbsItem> components) voidvoidreplace(BreadcrumbsItem oldComponent, BreadcrumbsItem newComponent) voidSets the internationalization properties for this component.voidsetMode(Breadcrumbs.Mode newMode) Sets the mode that determines how the breadcrumb trail is populated.Methods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy, setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
getChildren, getComponentAt, getComponentCount, indexOfMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
-
Constructor Details
-
Breadcrumbs
public Breadcrumbs()Creates a new breadcrumbs component inBreadcrumbs.Mode.ROUTERmode. -
Breadcrumbs
Creates a new breadcrumbs component in the given mode.- Parameters:
mode- the mode that determines how the trail is populated, notnull
-
-
Method Details
-
getMode
Gets the mode that determines how the breadcrumb trail is populated.- Returns:
- the current mode
-
setMode
Sets the mode that determines how the breadcrumb trail is populated.Switching to a different mode discards the existing children: both the
ROUTER -> MANUALandMANUAL -> ROUTERtransitions clear the current trail so the new mode can start fresh. Setting the mode to its current value is a no-op and leaves the children untouched.- Parameters:
newMode- the mode that determines how the trail is populated, notnull- Throws:
IllegalStateException- if a children binding set viabindChildrenis active; such a binding takes over the trail and cannot be handed back to component-controlled population
-
add
- Specified by:
addin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
add
- Specified by:
addin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
remove
- Specified by:
removein interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
remove
- Specified by:
removein interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
removeAll
public void removeAll()- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
addComponentAsFirst
- Specified by:
addComponentAsFirstin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
addComponentAtIndex
- Specified by:
addComponentAtIndexin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
replace
- Specified by:
replacein interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
bindChildren
public <V extends @Nullable Object,S extends com.vaadin.flow.signals.Signal<V>> void bindChildren(com.vaadin.flow.signals.Signal<List<S>> list, com.vaadin.flow.function.SerializableFunction<S, BreadcrumbsItem> childFactory) - Specified by:
bindChildrenin interfacecom.vaadin.flow.component.HasComponentsOfType<BreadcrumbsItem>
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
getI18n
Gets the internationalization object previously set for this component.NOTE: Updating the instance that is returned from this method will not update the component if not set again using
setI18n(BreadcrumbsI18n)- Returns:
- the i18n object or
nullif no i18n object has been set
-
setI18n
Sets the internationalization properties for this component.- Parameters:
i18n- the i18n object, notnull
-