This component displays locations with the ability to navigate between them and highlighting the current one, each location can have text and icon with a click listener.
See also :
Clicking a BreadcrumbItem would trigger change listeners defined on the Breadcrumb, the library user can use them to navigate the user to different views or pages.
See also :
public void Breadcrumb()
public static Breadcrumb create()
new breadcrumb instance
public Breadcrumb appendChild(String text, EventListener onClick)
text and onClick listener
text
the label of the location
onClick
EventListener that will be called when the location is clicked
same breadcrumb instance
public Breadcrumb appendChild(Icon<?> icon, String text, EventListener onClick)
icon
the Icon of the location
text
the label of the location
onClick
EventListener that will be called when the location is clicked
same breadcrumb instance
public Breadcrumb appendChild(BreadcrumbItem[] items)
items
the BreadcrumbItem s to be added
same breadcrumb instance
public Breadcrumb appendChild(boolean silent, BreadcrumbItem[] items)
silent
boolean, if true to ignore the change listeners, otherwise change listeners will be triggered.
items
the BreadcrumbItem s to be added
same breadcrumb instance
public Breadcrumb appendChild(BreadcrumbItem item)
item
the BreadcrumbItem to be added
same breadcrumb instance
public Breadcrumb removeChildFrom(int itemFromIndex, boolean silent)
itemFromIndex
the starting index from of the breadcrumb items to be removed
silent
boolean, if true dont trigger change listeners
same breadcrumb instance
public Breadcrumb setActiveItem(BreadcrumbItem item)
item
The item be set as active one
same breadcrumb instance
public Breadcrumb setActiveItem(BreadcrumbItem item, boolean silent)
item
The item be set as active one
silent
boolean, if true dont trigger change handlers
same breadcrumb instance
public Breadcrumb setRemoveActiveTailItem(boolean removeTail)
Default to false
Example:
removeTail is true and having 4 locations as follows:
A -> B -> C -> D
when selecting location B , then the new locations will be as follows:
A -> B
removeTail is false and having 4 locations as follows:
A -> B -> C -> D
when selecting location B , then the new locations will be as follows:
A -> B -> C -> D
removeTail
true to enable remove tail on item activation, false to disable it.
same breadcrumb instance
public Breadcrumb removeAll()
same breadcrumb instance
public BreadcrumbItem getActiveItem()
public List<BreadcrumbItem> getItems()
a List of all breadcrumb items currently available in the breadcrumb instance.
public void BreadcrumbItem(String text)
text
The label text for the BreadcrumbItem
public void BreadcrumbItem(String text, Icon<?> icon)
text
The label text for the BreadcrumbItem
icon
An Icon that prefix the BreadcrumbItem labels
public void BreadcrumbItem(Icon<?> icon, String text)
icon
An Icon that prefix the BreadcrumbItem labels
text
The label text for the BreadcrumbItem
public static BreadcrumbItem create(String text)
text
The label text for the BreadcrumbItem
new BreadcrumbItem instance
public static BreadcrumbItem create(Icon<?> icon, String text)
icon
An Icon that prefix the BreadcrumbItem labels
text
The label text for the BreadcrumbItem
new BreadcrumbItem instance
public HTMLAnchorElement getClickableElement()
the element instance within this component that would receive the clicks when we register a click event listener directly to the BreadcrumbItem
public Text getTextElement()
public Icon<?> getIcon()
public boolean isActive()
true if the item is active, false otherwise.
public BreadcrumbItem withAnchor(ChildHandler<BreadcrumbItem, AnchorElement> handler)
handler
A ChildHandler that will apply the desired customization, holds a reference to both the BreadcrumbItem and the AnchorElement
same BreadcrumbItem instance