Class Tree<T>
- Type Parameters:
T- the data type
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable,com.vaadin.flow.component.FocusNotifier,com.vaadin.flow.component.HasComponents,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.data.provider.hierarchy.HasHierarchicalDataProvider<T>,Serializable
- Author:
- Tatu Lund
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component> -
Constructor Summary
ConstructorsConstructorDescriptionTree(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T, ?> dataProvider, com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Constructs a new Tree Component with given caption andHierarchicalDataProvider.Tree(com.vaadin.flow.data.provider.hierarchy.TreeData<T> treeData, com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Constructs a new Tree Component with given caption andTreeData.Constructs a new Tree Component. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddCollapseListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.treegrid.CollapseEvent<T, com.vaadin.flow.component.treegrid.TreeGrid<T>>> listener) Adds a CollapseListener to this Tree.com.vaadin.flow.component.grid.contextmenu.GridContextMenu<T> com.vaadin.flow.shared.RegistrationaddDragEndListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDragEndEvent<T>> listener) Adds a drag end listener to this component.com.vaadin.flow.shared.RegistrationaddDragStartListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDragStartEvent<T>> listener) Adds a drag start listener to this component.com.vaadin.flow.shared.RegistrationaddDropListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDropEvent<T>> listener) Adds a drop listener to this component.com.vaadin.flow.shared.RegistrationaddExpandListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.treegrid.ExpandEvent<T, com.vaadin.flow.component.treegrid.TreeGrid<T>>> listener) Adds an ExpandListener to this Tree.com.vaadin.flow.shared.RegistrationaddItemClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemClickEvent<T>> listener) Adds an item click listener.com.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.component.ComponentEventListener<SelectionChangedEvent<T, Tree<T>>> listener) Adds a selection listener to the current selection model.voidaddThemeVariants(com.vaadin.flow.component.grid.GridVariant... gridVariants) Use this tree as a multi select in Binder.Use this tree as a single select in Binder.voidcollapse(Collection<T> items) Collapse the given items.voidCollapse the given items.voidcollapseRecursively(Collection<T> items, int depth) Collapse the given items and their children recursively until the given depth.Create innerTreeGridobject.voidThis method is a shorthand that delegates to the currently set selection model.voidexpand(Collection<T> items) Expands the given items.voidExpands the given items.voidexpandRecursively(Collection<T> items, int depth) Expands the given items and their children recursively until the given depth.protected voidfireCollapseEvent(Collection<T> collection, boolean userOriginated) Fires a collapse event with given item.protected voidfireExpandEvent(Collection<T> collection, boolean userOriginated) Fires an expand event with given item.voidfocus()Gets the CSS class names for this component.com.vaadin.flow.data.provider.hierarchy.HierarchicalDataCommunicator<T> Returns the data communicator of this Grid.com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T, com.vaadin.flow.function.SerializablePredicate<T>> com.vaadin.flow.component.grid.dnd.GridDropModeGets the drop mode of this drop target.com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.icon.VaadinIcon> Gets the item icon provider.com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.server.StreamResource> Gets the item icon provider.getId()com.vaadin.flow.function.ValueProvider<T, ?> Gets the item caption provider.This method is a shorthand that delegates to the currently set selection model.com.vaadin.flow.component.grid.GridSelectionModel<T> Returns the selection model for this Tree.intcom.vaadin.flow.dom.ThemeListGets the item description generator.booleanisExpanded(T item) Returns whether a given item is expanded or collapsed.booleanGets whether rows of the tree can be dragged.booleanremoveClassName(String className) Removes a CSS class name from this component.voidremoveThemeVariants(com.vaadin.flow.component.grid.GridVariant... gridVariants) voidScrolls to the end of the last data row.voidscrollToIndex(int row) Scrolls to a certain item.voidscrollToIndex(int... indexes) Scrolls to a nested item within the tree.voidScrolls to the beginning of the first data row.voidThis method is a shorthand that delegates to the currently set selection model.voidsetAllRowsVisible(boolean heightByRows) voidsetClassName(String className) Sets the CSS class names of this component.voidsetDataProvider(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T, ?> dataProvider) voidsetDropMode(com.vaadin.flow.component.grid.dnd.GridDropMode dropMode) Sets the drop mode of this drop target.voidsetHtmlProvider(com.vaadin.flow.function.ValueProvider<T, ?> htmlProvider) Sets the item generator that is used to produce the html content shown for each item.voidvoidsetItemCaptionProvider(com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Sets the item caption generator that is used to produce the strings shown as the text for each item.voidsetItemIconProvider(com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.icon.VaadinIcon> iconProvider) Sets the item icon generator that is used to produce custom icons for items.voidsetItemIconSrcProvider(com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.server.StreamResource> iconSrcProvider) Sets the item icon src generator that is used to produce custom icons for items.voidsetItemTooltipProvider(com.vaadin.flow.function.ValueProvider<T, String> tooltipProvider) Sets the tooltip generator that is used for generating tooltip descriptions for items.voidsetPartNameGenerator(com.vaadin.flow.function.SerializableFunction<T, String> partNameGenerator) Sets the function that is used for generating CSS part names for all the cells in the rows in this tree.voidsetRowsDraggable(boolean rowsDraggable) Sets whether the user can drag the tree rows or not.voidsetSanitize(boolean sanitize) By default html content is sanitized, if you have custom web components to or other offending content that you want to render, set to false.com.vaadin.flow.component.grid.GridSelectionModel<T> setSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) Sets the tree's selection mode.voidsetSelectOnlyLeafs(boolean selectOnlyLeafs) When true, only selecting leafs is accepted.voidsetTabIndex(int tabIndex) voidsetThemeName(String theme) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, 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.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focusMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider
getTreeData, setItems, setItems, setTreeDataMethods inherited from interface com.vaadin.flow.component.HasSize
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, getClassNames, getStyle, hasClassName, removeClassNames, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName
-
Constructor Details
-
Tree
Constructs a new Tree Component.- Parameters:
valueProvider- the item caption provider to use, notnull
-
Tree
public Tree(com.vaadin.flow.data.provider.hierarchy.TreeData<T> treeData, com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Constructs a new Tree Component with given caption andTreeData.- Parameters:
treeData- the tree data for componentvalueProvider- the item caption provider to use, notnull
-
Tree
public Tree(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T, ?> dataProvider, com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Constructs a new Tree Component with given caption andHierarchicalDataProvider.- Parameters:
dataProvider- the hierarchical data provider for componentvalueProvider- the item caption provider to use, notnull
-
-
Method Details
-
createTreeGrid
Create innerTreeGridobject. May be overridden in subclasses.- Returns:
- new
TreeGrid
-
getDataProvider
public com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,com.vaadin.flow.function.SerializablePredicate<T>> getDataProvider()- Specified by:
getDataProviderin interfacecom.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>
-
addExpandListener
public com.vaadin.flow.shared.Registration addExpandListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.treegrid.ExpandEvent<T, com.vaadin.flow.component.treegrid.TreeGrid<T>>> listener) Adds an ExpandListener to this Tree.- Parameters:
listener- the listener to add- Returns:
- a registration for the listener
- See Also:
-
addCollapseListener
public com.vaadin.flow.shared.Registration addCollapseListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.treegrid.CollapseEvent<T, com.vaadin.flow.component.treegrid.TreeGrid<T>>> listener) Adds a CollapseListener to this Tree.- Parameters:
listener- the listener to add- Returns:
- a registration for the listener
- See Also:
-
fireExpandEvent
Fires an expand event with given item.- Parameters:
collection- the expanded itemuserOriginated- whether the expand was triggered by a user interaction or the server
-
fireCollapseEvent
Fires a collapse event with given item.- Parameters:
collection- the collapsed itemuserOriginated- whether the collapse was triggered by a user interaction or the server
-
expand
Expands the given items.If an item is currently expanded, does nothing. If an item does not have any children, does nothing.
- Parameters:
items- the items to expand
-
expand
Expands the given items.If an item is currently expanded, does nothing. If an item does not have any children, does nothing.
- Parameters:
items- the items to expand
-
expandRecursively
Expands the given items and their children recursively until the given depth.depthdescribes the maximum distance between a given item and its descendant, meaning thatexpandRecursively(items, 0)expands only the given items whileexpandRecursively(items, 2)expands the given items as well as their children and grandchildren.- Parameters:
items- the items to expand recursivelydepth- the maximum depth of recursion
-
collapse
Collapse the given items.For items that are already collapsed, does nothing.
- Parameters:
items- the collection of items to collapse
-
collapse
Collapse the given items.For items that are already collapsed, does nothing.
- Parameters:
items- the collection of items to collapse
-
collapseRecursively
Collapse the given items and their children recursively until the given depth.depthdescribes the maximum distance between a given item and its descendant, meaning thatcollapseRecursively(items, 0)collapses only the given items whilecollapseRecursively(items, 2)collapses the given items as well as their children and grandchildren.- Parameters:
items- the items to expand recursivelydepth- the maximum depth of recursion
-
isExpanded
Returns whether a given item is expanded or collapsed.- Parameters:
item- the item to check- Returns:
- true if the item is expanded, false if collapsed
-
getSelectedItems
This method is a shorthand that delegates to the currently set selection model.- Returns:
- set of selected items
- See Also:
-
select
This method is a shorthand that delegates to the currently set selection model.- Parameters:
item- item to select- See Also:
-
deselect
This method is a shorthand that delegates to the currently set selection model.- Parameters:
item- item to deselect- See Also:
-
addSelectionListener
public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.component.ComponentEventListener<SelectionChangedEvent<T, Tree<T>>> listener) Adds a selection listener to the current selection model.NOTE: If selection mode is switched with
setSelectionMode(SelectionMode), then this listener is not triggered anymore when selection changes!- Parameters:
listener- the listener to add- Returns:
- a registration handle to remove the listener
- Throws:
UnsupportedOperationException- if selection has been disabled withGrid.SelectionMode.NONE
-
asMultiSelect
public com.vaadin.flow.data.selection.MultiSelect<com.vaadin.flow.component.grid.Grid<T>,T> asMultiSelect()Use this tree as a multi select in Binder. ThrowsIllegalStateExceptionif the tree is not usingGrid.SelectionMode.MULTI.- Returns:
- the single select wrapper that can be used in binder
-
asSingleSelect
public com.vaadin.flow.data.selection.SingleSelect<com.vaadin.flow.component.grid.Grid<T>,T> asSingleSelect()Use this tree as a single select in Binder. ThrowsIllegalStateExceptionif the tree is not usingGrid.SelectionMode.SINGLE.- Returns:
- the single select wrapper that can be used in binder
-
getSelectionModel
Returns the selection model for this Tree.- Returns:
- the selection model, not
null
-
setHtmlProvider
Sets the item generator that is used to produce the html content shown for each item. By default,String.valueOf(Object)is used.Note: This will override icon, tooltip and value provider settings.
- Parameters:
htmlProvider- the item html provider to use, notnull
-
setItemCaptionProvider
Sets the item caption generator that is used to produce the strings shown as the text for each item. By default,String.valueOf(Object)is used.- Parameters:
valueProvider- the item caption provider to use, notnull
-
setItemIconProvider
public void setItemIconProvider(com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.icon.VaadinIcon> iconProvider) Sets the item icon generator that is used to produce custom icons for items. The generator can returnnullfor items with no icon.- Parameters:
iconProvider- the item icon generator to set, notnull- Throws:
NullPointerException- ifitemIconGeneratorisnull
-
setItemIconSrcProvider
public void setItemIconSrcProvider(com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.server.StreamResource> iconSrcProvider) Sets the item icon src generator that is used to produce custom icons for items. The generator can returnnullfor items with no icon.- Parameters:
iconSrcProvider- the item icon generator to set, notnull- Throws:
NullPointerException- ifitemIconGeneratorisnull
-
setItemTooltipProvider
public void setItemTooltipProvider(com.vaadin.flow.function.ValueProvider<T, String> tooltipProvider) Sets the tooltip generator that is used for generating tooltip descriptions for items.- Parameters:
tooltipProvider- the item description generator to set, ornullto remove a previously set generator
-
getItemCaptionProvider
Gets the item caption provider.- Returns:
- the item caption provider
-
getIconProvider
public com.vaadin.flow.function.ValueProvider<T,com.vaadin.flow.component.icon.VaadinIcon> getIconProvider()Gets the item icon provider.- Returns:
- the item icon provider
-
getIconSrcProvider
public com.vaadin.flow.function.ValueProvider<T,com.vaadin.flow.server.StreamResource> getIconSrcProvider()Gets the item icon provider.- Returns:
- the item icon provider
-
getTooltipProvider
Gets the item description generator.- Returns:
- the item description generator
-
addItemClickListener
public com.vaadin.flow.shared.Registration addItemClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemClickEvent<T>> listener) Adds an item click listener. The listener is called when an item of thisTreeis clicked.- Parameters:
listener- the item click listener, not null- Returns:
- a registration for the listener
-
setSelectionMode
public com.vaadin.flow.component.grid.GridSelectionModel<T> setSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) Sets the tree's selection mode.The built-in selection modes are:
Grid.SelectionMode.SINGLEthe default modelGrid.SelectionMode.MULTIGrid.SelectionMode.NONEpreventing selection
- Parameters:
selectionMode- the selection mode to switch to, notnull- Returns:
- the used selection model
- See Also:
-
getClassName
Gets the CSS class names for this component.- Specified by:
getClassNamein interfacecom.vaadin.flow.component.HasStyle- Returns:
- a space-separated string of class names, or
nullif there are no class names
-
setClassName
Sets the CSS class names of this component. This method overwrites any previous set class names.- Specified by:
setClassNamein interfacecom.vaadin.flow.component.HasStyle- Parameters:
className- a space-separated string of class names to set, ornullto remove all class names
-
removeClassName
Removes a CSS class name from this component.- Specified by:
removeClassNamein interfacecom.vaadin.flow.component.HasStyle- Parameters:
className- the CSS class name to remove, notnull- Returns:
trueif the class name was removed,falseif the class list didn't contain the class name
-
setId
- Overrides:
setIdin classcom.vaadin.flow.component.Component
-
getId
- Overrides:
getIdin classcom.vaadin.flow.component.Component
-
addContextMenu
-
scrollToIndex
Scrolls to a certain item.If the item has an open details row, its size will also be taken into account.
- Parameters:
row- zero based index of the item to scroll to in the current view.- Throws:
IllegalArgumentException- if the provided row is outside the item range
-
scrollToStart
public void scrollToStart()Scrolls to the beginning of the first data row. -
scrollToEnd
public void scrollToEnd()Scrolls to the end of the last data row. -
getTabIndex
public int getTabIndex()- Specified by:
getTabIndexin interfacecom.vaadin.flow.component.Focusable<T>
-
setTabIndex
public void setTabIndex(int tabIndex) - Specified by:
setTabIndexin interfacecom.vaadin.flow.component.Focusable<T>
-
focus
public void focus()- Specified by:
focusin interfacecom.vaadin.flow.component.Focusable<T>
-
setAllRowsVisible
public void setAllRowsVisible(boolean heightByRows) -
setDataProvider
public void setDataProvider(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T, ?> dataProvider) - Specified by:
setDataProviderin interfacecom.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>
-
addThemeVariants
public void addThemeVariants(com.vaadin.flow.component.grid.GridVariant... gridVariants) -
removeThemeVariants
public void removeThemeVariants(com.vaadin.flow.component.grid.GridVariant... gridVariants) -
setThemeName
- Specified by:
setThemeNamein interfacecom.vaadin.flow.component.HasTheme
-
getThemeName
- Specified by:
getThemeNamein interfacecom.vaadin.flow.component.HasTheme
-
getThemeNames
public com.vaadin.flow.dom.ThemeList getThemeNames()- Specified by:
getThemeNamesin interfacecom.vaadin.flow.component.HasTheme
-
setSanitize
public void setSanitize(boolean sanitize) By default html content is sanitized, if you have custom web components to or other offending content that you want to render, set to false.- Parameters:
sanitize- Enable / disable html sanitation.
-
setDropMode
public void setDropMode(com.vaadin.flow.component.grid.dnd.GridDropMode dropMode) Sets the drop mode of this drop target. When set to notnull, tree fires drop events upon data drop over the tree or the tree rows.When using
GridDropMode.ON_TOP, and the tree is either empty or has empty space after the last row, the drop can still happen on the empty space, and theGridDropEvent.getDropTargetItem()will return an empty optional.When using
GridDropMode.BETWEENorGridDropMode.ON_TOP_OR_BETWEEN, and there is at least one row in the tree, any drop after the last row in the tree will get the last row as theGridDropEvent.getDropTargetItem(). If there are no rows in the tree, then it will return an empty optional.If using
GridDropMode.ON_GRID, then the drop will not happen on any row, but instead just "on the tree". The target row will not be present in this case.NOTE: Prefer not using a row specific GridDropMode with a tree that enables sorting. If for example a new row gets added to a specific location on drop event, it might not end up in the location of the drop but rather where the active sorting configuration prefers to place it. This behavior might feel unexpected for the users.
- Parameters:
dropMode- Drop mode that describes the allowed drop locations within the Tree's row. Can benullto disable dropping on the tree.- See Also:
-
getDropMode
public com.vaadin.flow.component.grid.dnd.GridDropMode getDropMode()Gets the drop mode of this drop target.- Returns:
- Drop mode that describes the allowed drop locations within the
Tree's row.
nullif dropping is not enabled.
-
setRowsDraggable
public void setRowsDraggable(boolean rowsDraggable) Sets whether the user can drag the tree rows or not.- Parameters:
rowsDraggable-trueif the rows can be dragged by the user;falseif not
-
isRowsDraggable
public boolean isRowsDraggable()Gets whether rows of the tree can be dragged.- Returns:
trueif the rows are draggable,falseotherwise
-
addDragStartListener
public com.vaadin.flow.shared.Registration addDragStartListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDragStartEvent<T>> listener) Adds a drag start listener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addDropListener
public com.vaadin.flow.shared.Registration addDropListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDropEvent<T>> listener) Adds a drop listener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addDragEndListener
public com.vaadin.flow.shared.Registration addDragEndListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.dnd.GridDragEndEvent<T>> listener) Adds a drag end listener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
getDataCommunicator
public com.vaadin.flow.data.provider.hierarchy.HierarchicalDataCommunicator<T> getDataCommunicator()Returns the data communicator of this Grid.- Returns:
- HierarchicalDataCommunicator
-
setSelectOnlyLeafs
public void setSelectOnlyLeafs(boolean selectOnlyLeafs) When true, only selecting leafs is accepted. Also SelectionChangedEvent is not fired if non-leaf node is clicked.Note: asSingleSelect and asMultiSelect pass thru API's are not affected.
- Parameters:
selectOnlyLeafs- boolean value.
-
scrollToIndex
public void scrollToIndex(int... indexes) Scrolls to a nested item within the tree.The `indexes` parameter can be either a single number or multiple numbers. The tree will first try to scroll to the item at the first index in the root level of the tree. In case the item at the first index is expanded, the tree will then try scroll to the item at the second index within the children of the expanded first item, and so on. Each given index points to a child of the item at the previous index.
- Parameters:
indexes- zero based row indexes to scroll to
-
setPartNameGenerator
public void setPartNameGenerator(com.vaadin.flow.function.SerializableFunction<T, String> partNameGenerator) Sets the function that is used for generating CSS part names for all the cells in the rows in this tree. Returningnullfrom the generator results in no custom part name being set. Multiple part names can be returned from the generator as space-separated.- Parameters:
partNameGenerator- the part name generator to set, notnull- Throws:
NullPointerException- ifpartNameGeneratorisnull
-