Package com.storedobject.vaadin
Class BreadcrumbsTree
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
com.storedobject.vaadin.BreadcrumbsTree
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
public class BreadcrumbsTree
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
Breadcrumb Tree component. It contains a tree of "Breadcrumbs" and each node
BreadcrumbsTree.Node of the tree can
hold a Component and some sort of ad-hoc data. From a specific branch of the tree, only the component
corresponding to the last expanded node is displayed and all other component in that branch hierarchy is hidden.
However, all the nodes, up to the last expanded node, are displayed as part of the breadcrumb and any node can be
clicked to jump to that node.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThe node of the breadcrumb tree.static interfaceListener that can be added to theBreadcrumbsTreefor monitoring the visibility changes of the nodes (and its associated components). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a root node to this tree.com.vaadin.flow.shared.Registrationvoidclear()Clear this tree by removing all nodes and its associated data.getRoots()Get the root nodes.protected com.vaadin.flow.component.orderedlayout.VerticalLayoutbooleanremove(BreadcrumbsTree.Node node) Remove a node from this tree.voidvisit(Consumer<BreadcrumbsTree.Node> visitor) Visit all nodes.Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, 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.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
BreadcrumbsTree
public BreadcrumbsTree()Constructor.
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.orderedlayout.VerticalLayout initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
-
add
Add a root node to this tree.- Parameters:
caption- Caption for the new root node.component- Component associated with the node.- Returns:
- Newly created nde.
-
remove
Remove a node from this tree.- Parameters:
node- Node to be removed.- Returns:
- True if removed. False if it was not located and thus, not removed.
-
getRoots
-
visit
Visit all nodes.- Parameters:
visitor- The visitor who consumes each node.
-
clear
public void clear()Clear this tree by removing all nodes and its associated data. -
addNodeVisibilityListener
public com.vaadin.flow.shared.Registration addNodeVisibilityListener(BreadcrumbsTree.NodeVisibilityListener listener) - Parameters:
listener- Listener.- Returns:
- Registration instance that can be used to remove the listener.
-