Interface TreeDataGrid<E>
- Type Parameters:
E- row item type
- All Superinterfaces:
ActionsHolder,Component,Component.BelongToFrame,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,DataGrid<E>,HasButtonsPanel,HasContextHelp,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasMinSize,HasPagination,HasSubParts,ListComponent<E>,LookupComponent<E>
- All Known Implementing Classes:
TreeDataGridImpl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn event that is fired when an item is collapsed.static classAn event that is fired when an item is expanded.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.DataGrid
DataGrid.AbstractDataGridEditorEvent<E>, DataGrid.AbstractDataGridEvent, DataGrid.AggregationPosition, DataGrid.ButtonRenderer<T>, DataGrid.CheckBoxRenderer, DataGrid.ClickableTextRenderer<T>, DataGrid.Column<E>, DataGrid.ColumnCollapsingChangeEvent, DataGrid.ColumnGeneratorEvent<E>, DataGrid.ColumnReorderEvent, DataGrid.ColumnResizeEvent, DataGrid.ColumnResizeMode, DataGrid.ComponentRenderer, DataGrid.ContextClickEvent, DataGrid.DataGridClickEvent, DataGrid.DataGridStaticCellType, DataGrid.DateRenderer, DataGrid.EditorCloseEvent<E>, DataGrid.EditorFieldGenerationContext<T>, DataGrid.EditorOpenEvent<E>, DataGrid.EditorPostCommitEvent<E>, DataGrid.EditorPreCommitEvent<E>, DataGrid.EmptyStateClickEvent<E>, DataGrid.FooterCell, DataGrid.FooterRow, DataGrid.HasDateTimeFormatter, DataGrid.HasFormatString, DataGrid.HasLocale, DataGrid.HasNullRepresentation, DataGrid.HasRendererClickListener<T>, DataGrid.HeaderCell, DataGrid.HeaderRow, DataGrid.HtmlRenderer, DataGrid.IconRenderer<T>, DataGrid.ImageRenderer<T>, DataGrid.ItemClickEvent<E>, DataGrid.LocalDateRenderer, DataGrid.LocalDateTimeRenderer, DataGrid.NumberRenderer, DataGrid.ProgressBarRenderer, DataGrid.Renderer, DataGrid.RendererClickEvent<T>, DataGrid.ScrollDestination, DataGrid.SelectionEvent<E>, DataGrid.SelectionMode, DataGrid.SortDirection, DataGrid.SortEvent, DataGrid.SortOrder, DataGrid.StaticCell, DataGrid.StaticRow<T extends DataGrid.StaticCell>, DataGrid.TextRendererNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.LookupComponent
LookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T> -
Field Summary
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionaddCollapseListener(Consumer<TreeDataGrid.CollapseEvent<E>> listener) Registers a new collapse listener.addExpandListener(Consumer<TreeDataGrid.ExpandEvent<E>> listener) Registers a new expand listener.default voidCollapse the given items.voidcollapse(Collection<E> items) Collapse the given items.voidCollapses all items.default voidcollapseRecursively(Collection<E> items, int depth) Collapse the given items and their children recursively until the given depth.voidcollapseRecursively(Stream<E> items, int depth) Collapse the given items and their children recursively until the given depth.default voidExpands the given items.voidexpand(Collection<E> items) Expands the given items.voidExpands all items.default voidexpandRecursively(Collection<E> items, int depth) Expands the given items and their children recursively until the given depth.voidexpandRecursively(Stream<E> items, int depth) Expands the given items and their children recursively until the given depth.Get the currently set hierarchy column.getItems()intReturns the hierarchy level of an item.booleanisExpanded(E item) Returns whether a given item is expanded or collapsed.static <T> org.springframework.core.ParameterizedTypeReference<TreeDataGrid<T>>voidsetHierarchyColumn(DataGrid.Column<E> column) Set the column that displays the hierarchy of this DataGrid's data.voidSet the column that displays the hierarchy of this DataGrid's data.voidsetItemCollapseAllowedProvider(Predicate<E> provider) Sets the item collapse allowed provider for this TreeDataGrid.Methods inherited from interface io.jmix.ui.component.ActionsHolder
addAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActionsMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.DataGrid
addColumn, addColumn, addColumn, addColumn, addColumnCollapsingChangeListener, addColumnReorderListener, addColumnResizeListener, addContextClickListener, addEditorCloseListener, addEditorOpenListener, addEditorPostCommitListener, addEditorPreCommitListener, addFooterRowAt, addGeneratedColumn, addGeneratedColumn, addHeaderRowAt, addItemClickListener, addRowStyleProvider, addSelectionListener, addSortListener, appendFooterRow, appendHeaderRow, closeEditor, deselect, deselectAll, edit, getAggregationPosition, getAggregationResults, getBodyRowHeight, getColumn, getColumnGenerator, getColumnNN, getColumnResizeMode, getColumns, getDefaultHeaderRow, getDetailsGenerator, getEditedItem, getEditorCancelCaption, getEditorSaveCaption, getEmptyStateLinkClickHandler, getEmptyStateLinkMessage, getEmptyStateMessage, getEnterPressAction, getFooterRow, getFooterRowCount, getFooterRowHeight, getFrozenColumnCount, getHeaderRow, getHeaderRowCount, getHeaderRowHeight, getItemClickAction, getMinHeight, getMinHeightSizeUnit, getMinWidth, getMinWidthSizeUnit, getRowDescriptionProvider, getSelectionMode, getSortOrder, getSubPart, getVisibleColumns, isAggregatable, isColumnReorderingAllowed, isColumnsCollapsingAllowed, isContextMenuEnabled, isDetailsVisible, isEditorActive, isEditorBuffered, isEditorCrossFieldValidate, isEditorEnabled, isFooterVisible, isHeaderVisible, isSortable, isTextSelectionEnabled, prependFooterRow, prependHeaderRow, removeColumn, removeColumn, removeFooterRow, removeFooterRow, removeHeaderRow, removeHeaderRow, removeRowStyleProvider, repaint, scrollTo, scrollTo, scrollToEnd, scrollToStart, selectAll, setAggregatable, setAggregationPosition, setBodyRowHeight, setColumnReorderingAllowed, setColumnResizeMode, setColumnsCollapsingAllowed, setContextMenuEnabled, setDefaultHeaderRow, setDetailsGenerator, setDetailsVisible, setEditorBuffered, setEditorCancelCaption, setEditorCrossFieldValidate, setEditorEnabled, setEditorSaveCaption, setEmptyStateLinkClickHandler, setEmptyStateLinkMessage, setEmptyStateMessage, setEnterPressAction, setFooterRowHeight, setFooterVisible, setFrozenColumnCount, setHeaderRowHeight, setHeaderVisible, setItemClickAction, setItems, setMinHeight, setMinWidth, setRowDescriptionProvider, setRowDescriptionProvider, setSelectionMode, setSortable, setTextSelectionEnabled, sortMethods inherited from interface io.jmix.ui.component.HasButtonsPanel
getButtonsPanel, setButtonsPanelMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasPagination
getPagination, setPaginationMethods inherited from interface io.jmix.ui.component.ListComponent
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelectedMethods inherited from interface io.jmix.ui.component.LookupComponent
getLookupSelectedItems, setLookupSelectHandler
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
of
static <T> org.springframework.core.ParameterizedTypeReference<TreeDataGrid<T>> of(Class<T> itemClass) -
getLevel
Returns the hierarchy level of an item.- Parameters:
item- the item to get level- Returns:
- the level of the given item
-
getItems
-
getHierarchyColumn
Get the currently set hierarchy column. The hierarchy column is a column that displays the hierarchy of this DataGrid's data.- Returns:
- the currently set hierarchy column, or
nullif no column has been explicitly set
-
setHierarchyColumn
Set the column that displays the hierarchy of this DataGrid's data. By default the hierarchy will be displayed in the first column.Setting a hierarchy column by calling this method also sets the column to be visible and not hidable.
Note: Changing the Renderer of the hierarchy column is not supported.
- Parameters:
id- the column id to use for displaying hierarchy
-
setHierarchyColumn
Set the column that displays the hierarchy of this DataGrid's data. By default the hierarchy will be displayed in the first column.Setting a hierarchy column by calling this method also sets the column to be visible and not hidable.
Note: Changing the Renderer of the hierarchy column is not supported.
- Parameters:
column- the column to use for displaying hierarchy
-
getItemCollapseAllowedProvider
- Returns:
- the item collapse allowed provider
-
setItemCollapseAllowedProvider
Sets the item collapse allowed provider for this TreeDataGrid. The provider should returntruefor any item that the user can collapse.Note: This callback will be accessed often when sending data to the client. The callback should not do any costly operations.
- Parameters:
provider- the item collapse allowed provider, notnull
-
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- See Also:
-
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- See Also:
-
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.This method will not fire events for expanded nodes.
- Parameters:
items- the items to expand recursivelydepth- the maximum depth of recursion- See Also:
-
expandAll
void expandAll()Expands all items.This method will not fire events for expanded nodes.
-
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.This method will not fire events for expanded nodes.
- Parameters:
items- the items to expand recursivelydepth- the maximum depth of recursion- See Also:
-
collapse
Collapse the given items.For items that are already collapsed, does nothing.
- Parameters:
items- the items to collapse- See Also:
-
collapse
Collapse the given items.For items that are already collapsed, does nothing.
- Parameters:
items- the items to collapse- See Also:
-
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.This method will not fire events for collapsed nodes.
- Parameters:
items- the items to collapse recursivelydepth- the maximum depth of recursion- See Also:
-
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.This method will not fire events for collapsed nodes.
- Parameters:
items- the items to collapse recursivelydepth- the maximum depth of recursion- See Also:
-
collapseAll
void collapseAll()Collapses all items.This method will not fire events for expanded nodes.
-
isExpanded
Returns whether a given item is expanded or collapsed.- Parameters:
item- the item to check- Returns:
trueif the item is expanded,falseotherwise
-
addExpandListener
Registers a new expand listener.- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addCollapseListener
Registers a new collapse listener.- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-