Skip to content

Breadcrumb

Interactive navigation trail widget displaying hierarchical breadcrumb items with customizable separators and selection handling.

Overview

Interactive navigation trail widget displaying hierarchical breadcrumb items with customizable separators and selection handling. Provides extensive layout configuration and interaction capabilities.

Basic Usage

Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.addItem("Home").addItem("Settings");
  • BreadcrumbItem: Navigation item descriptor representing a step or crumb in a breadcrumb trail.

API

Constructs an empty Breadcrumb navigation bar.

Breadcrumb::addItem(BreadcrumbItem)

Appends a BreadcrumbItem instance to the trail.

Parameter Type Description
item BreadcrumbItem The target item.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::addItem(RichText)

Appends a RichText formatted item to the trail.

Parameter Type Description
text RichText The text label.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::addItem(String)

Appends a plain text item to the trail.

Parameter Type Description
text String The text label.

Returns Breadcrumb: This instance for chaining..

Replaces the trail with BreadcrumbItem instances.

Parameter Type Description
items List The collection of items.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::clearItems()

Clears all items from the breadcrumb trail.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::host()

Returns the internal WrapPanel container hosting the breadcrumb buttons.

Returns WrapPanel: The container hosting items..

Breadcrumb::itemButton(int)

Returns the Button widget representing the item at the specified index.

Parameter Type Description
index int The index position.

Returns Button: The associated button component..

Breadcrumb::itemCount()

Returns the total number of items in the breadcrumb trail.

Returns int: The total item count..

Breadcrumb::items()

Returns an unmodifiable list of breadcrumb items.

Returns List: An unmodifiable list of node items..

Breadcrumb::items(List)

Replaces the trail with plain-text items.

Parameter Type Description
items List The collection of items.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::lineSpacing(float)

Sets the vertical line spacing when items wrap to multiple lines.

Parameter Type Description
lineSpacing float The line spacing distance in pixels.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::onSelectionChanged(EventListener)

Registers a listener invoked when the selected breadcrumb step changes.

Parameter Type Description
listener EventListener The event listener callback.

Returns EventSubscription: The event subscription handle..

Breadcrumb::removeItem(int)

Removes the breadcrumb item at the specified index.

Parameter Type Description
index int The index position.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::richItems(List)

Replaces the trail with RichText formatted items.

Parameter Type Description
items List The collection of items.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::selectedIndex()

Returns the zero-based index of the currently selected breadcrumb item.

Returns int: The result value..

Breadcrumb::selectedIndex(int)

Selects the item at the specified index and dispatches a selection changed event.

Parameter Type Description
index int The index position.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::selectedItem()

Returns the currently selected BreadcrumbItem, or null if none.

Returns BreadcrumbItem: The node item instance, or null if not found..

Breadcrumb::selectedPath()

Returns a sublist of items from index 0 up to the selected index inclusive.

Returns List: An unmodifiable list of node items..

Breadcrumb::separator()

Returns the separator string placed between items.

Returns String: The separator widget instance..

Breadcrumb::separator(String)

Sets the separator string displayed between breadcrumb items.

Parameter Type Description
separator String The custom separator widget.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::silentSelectedIndex(int)

Selects the item at the specified index without firing event callbacks.

Parameter Type Description
index int The index position.

Returns Breadcrumb: This instance for chaining..

Breadcrumb::spacing(float)

Sets the horizontal spacing between items and separators.

Parameter Type Description
spacing float The spacing distance in pixels.

Returns Breadcrumb: This instance for chaining..