Class TreeTable<T>
- Type Parameters:
- T- the (super) type of the items in the grid
- All Implemented Interfaces:
- com.vaadin.flow.component.AttachNotifier,- com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<T>>,- com.vaadin.flow.component.DetachNotifier,- com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<T>>,- com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<T>>,- 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.event.SortEvent.SortNotifier<com.vaadin.flow.component.grid.Grid<T>,,- com.vaadin.flow.component.grid.GridSortOrder<T>> - com.vaadin.flow.data.provider.HasDataGenerators<T>,- com.vaadin.flow.data.provider.HasDataView<T,,- Void, - com.vaadin.flow.component.grid.dataview.GridDataView<T>> - com.vaadin.flow.data.provider.HasLazyDataView<T,,- Void, - com.vaadin.flow.component.grid.dataview.GridLazyDataView<T>> - com.vaadin.flow.data.provider.HasListDataView<T,,- com.vaadin.flow.component.grid.dataview.GridListDataView<T>> - Serializable,- FluentAttachNotifier<VGrid<T>>,- FluentBlurNotifier<com.vaadin.flow.component.grid.Grid<T>,,- VGrid<T>> - FluentComponent<VGrid<T>>,- FluentDetachNotifier<VGrid<T>>,- FluentFocusable<com.vaadin.flow.component.grid.Grid<T>,,- VGrid<T>> - FluentFocusNotifier<com.vaadin.flow.component.grid.Grid<T>,,- VGrid<T>> - FluentHasSize<VGrid<T>>,- FluentHasStyle<VGrid<T>>,- FluentHasTheme<VGrid<T>>
Non-goals: - workaround oddities of Grid itself
 The API is a bit different from TreeGrid, as it is not possible
 to provide the HiearchicalDataProvider. In the same way as with the
 official TreeGrid, you can provide the root items and a method to
 retrieve children for each item using setRootItems(List, SerializableFunction).
 
 Alternatively, you can provide the data in lazy loading mode with HasLazyDataView.setItems(CallbackDataProvider.FetchCallback)
 or HasLazyDataView.setItems(CallbackDataProvider.FetchCallback, CallbackDataProvider.CountCallback).
 With these methods you will also need to define TreeTable.TreeTableModel
 (or at least TreeTable.LeafModel and TreeTable.LevelModel separately) that
 Grid uses to visualise the hierarchy. At least TreeTable.OpenModel should be
 instance specific! The fetch callbacks need to take the current expanded state
 into account and return visible subtrees as defined by the TreeTable.OpenModel.
 
Whether you were using lazy loading or in-memory data set,
 you can override the TreeTable.OpenModel that controls whether
 the node is open or not. TreeGrid calls the setter
 TreeTable.OpenModel.setOpen(Object, boolean) when a node is
 opened/closed, so you can persist that detail to your backend
 if you wish to persist the state for longer than the current session.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classclassstatic interfacestatic interfacestatic classstatic interfacestatic interfaceNested classes/interfaces inherited from class org.vaadin.firitin.components.grid.VGridVGrid.CellFormatter<T>, VGrid.RowStyler<T>, VGrid.VColumn<T>Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Gridcom.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>, com.vaadin.flow.component.grid.Grid.Column<T>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T,U extends com.vaadin.flow.data.provider.ArrayUpdater>, com.vaadin.flow.component.grid.Grid.MultiSortPriority, com.vaadin.flow.component.grid.Grid.NestedNullBehavior, com.vaadin.flow.component.grid.Grid.SelectionMode, com.vaadin.flow.component.grid.Grid.UpdateQueue Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifiercom.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifiercom.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.vaadin.flow.component.grid.Grid.Column<T> addHierarchyColumn(com.vaadin.flow.function.SerializableFunction<T, String> valueProvider) com.vaadin.flow.component.grid.Grid.Column<T> addHierarchyComponentColumn(com.vaadin.flow.function.SerializableFunction<T, com.vaadin.flow.component.Component> valueProvider) voidallowUserToToggleOpenState(boolean allow) com.vaadin.flow.component.grid.dataview.GridLazyDataView<T> Deprecated.com.vaadin.flow.component.grid.dataview.GridDataView<T> Deprecated.com.vaadin.flow.component.grid.dataview.GridDataView<T> Deprecated.com.vaadin.flow.component.grid.dataview.GridListDataView<T> Deprecated.com.vaadin.flow.component.grid.dataview.GridListDataView<T> setItems(Collection<T> items) Deprecated.com.vaadin.flow.component.grid.dataview.GridListDataView<T> Deprecated.voidsetLeafModel(TreeTable.LeafModel<T> leafModel) voidsetLevelModel(TreeTable.LevelModel<T> levelModel) voidsetOpenModel(TreeTable.OpenModel<T> openModel) voidsetRootItems(List<T> rootItems, com.vaadin.flow.function.SerializableFunction<T, List<T>> childrenProvider) Set root items for the tree table.voidSets the tree table model (a combination ofTreeTable.OpenModel,TreeTable.LeafModelandTreeTable.LevelModel.Methods inherited from class org.vaadin.firitin.components.grid.VGridaddColumn, addColumn, getBeanPropertyDefinitions, getBeanPropertyNames, getDefaultColumnFactory, hideProperties, scrollToItem, setColumns, setDataProvider, withCellFormatter, withColumnSelector, withItems, withItems, withProperties, withRowStyler, withSelectionMode, withSelectionModel, withThemeVariantsMethods inherited from class com.vaadin.flow.component.grid.GridaddCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumnRendering, getColumns, getDataCommunicator, getDataProvider, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getEmptyStateComponent, getEmptyStateText, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onAttach, onDataProviderChange, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToStart, select, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumnReorderingAllowed, setDataProvider, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setEmptyStateComponent, setEmptyStateText, setItemDetailsRenderer, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClientMethods inherited from class com.vaadin.flow.component.ComponentaddListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifieraddAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifieraddBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifieraddDetachListenerMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentAttachNotifierwithAttachListenerMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentBlurNotifierwithBlurListenerMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentComponentnavigate, setId, setVisible, withId, withVisibleMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentDetachNotifierwithDetachListenerMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentFocusablewithTabIndexMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentFocusNotifierwithFocusListenerMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasSizeaddResizeListener, withFullHeight, withFullWidth, withHeight, withMaxHeight, withMaxSize, withMaxWidth, withMinHeight, withMinSize, withMinWidth, withSize, withSizeFull, withSizeUndefined, withWidthMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasStylewithAddedClassName, withClassName, withStyleMethods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasThemewithThemeNamesMethods inherited from interface com.vaadin.flow.component.FocusableaddFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifieraddFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElementgetElementMethods inherited from interface com.vaadin.flow.component.HasEnabledisEnabled, setEnabledMethods inherited from interface com.vaadin.flow.data.provider.HasLazyDataViewsetItems, setItemsMethods inherited from interface com.vaadin.flow.component.HasSizegetHeight, 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.HasStyleaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasThemeaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
- 
Constructor Details- 
TreeTablepublic TreeTable()
- 
TreeTable
 
- 
- 
Method Details- 
addHierarchyColumn
- 
addHierarchyComponentColumn
- 
setTreeTableModelSets the tree table model (a combination ofTreeTable.OpenModel,TreeTable.LeafModelandTreeTable.LevelModel. This (or separatelyTreeTable.LeafModelandTreeTable.LevelModel) must be set in case the rows are passed in with the lazy loading mode (using eitherHasLazyDataView.setItems(com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback)orHasLazyDataView.setItems(com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback, com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback)).- Parameters:
- model- the tree table model.
 
- 
setRootItemspublic void setRootItems(List<T> rootItems, com.vaadin.flow.function.SerializableFunction<T, List<T>> childrenProvider) Set root items for the tree table. This is a simpler API for non-lazy loading mode. You only need to provide the root items and a method to retrieve children for each item. TreeTable will then automatically load all children recursively, when needed.When using this method, customizing TreeTable.LeafModelorTreeTable.LevelModelis not needed nor supported. If you want, you can override the default in-memoryTreeTable.OpenModelthat keeps all items closed by default.- Parameters:
- rootItems- root items
- childrenProvider- a function to retrieve children for each item
 
- 
getOpenModel
- 
setOpenModel
- 
getLevelModel
- 
setLevelModel
- 
getLeafModel
- 
setLeafModel
- 
setItems@Deprecated public com.vaadin.flow.component.grid.dataview.GridDataView<T> setItems(com.vaadin.flow.data.provider.DataProvider<T, Void> dataProvider) Deprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
setItems@Deprecated public com.vaadin.flow.component.grid.dataview.GridDataView<T> setItems(com.vaadin.flow.data.provider.InMemoryDataProvider<T> inMemoryDataProvider) Deprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
setItems@Deprecated public com.vaadin.flow.component.grid.dataview.GridLazyDataView<T> setItems(com.vaadin.flow.data.provider.BackEndDataProvider<T, Void> dataProvider) Deprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
setItemsDeprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
setItems@Deprecated public com.vaadin.flow.component.grid.dataview.GridListDataView<T> setItems(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider) Deprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
setItems@Deprecated public com.vaadin.flow.component.grid.dataview.GridListDataView<T> setItems(Collection<T> items) Deprecated.Not supported in TreeTable, use setRootItems or setItems instead
- 
allowUserToToggleOpenStatepublic void allowUserToToggleOpenState(boolean allow) 
 
-