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
Modifier and TypeInterfaceDescriptionstatic class
An event that is fired when an item is collapsed.static class
An 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.Wrapper
Nested 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.TextRenderer
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.LookupComponent
LookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T>
-
Field Summary
Fields 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 void
Collapse the given items.void
collapse
(Collection<E> items) Collapse the given items.void
Collapses all items.default void
collapseRecursively
(Collection<E> items, int depth) Collapse the given items and their children recursively until the given depth.void
collapseRecursively
(Stream<E> items, int depth) Collapse the given items and their children recursively until the given depth.default void
Expands the given items.void
expand
(Collection<E> items) Expands the given items.void
Expands all items.default void
expandRecursively
(Collection<E> items, int depth) Expands the given items and their children recursively until the given depth.void
expandRecursively
(Stream<E> items, int depth) Expands the given items and their children recursively until the given depth.Get the currently set hierarchy column.getItems()
int
Returns the hierarchy level of an item.boolean
isExpanded
(E item) Returns whether a given item is expanded or collapsed.static <T> org.springframework.core.ParameterizedTypeReference<TreeDataGrid<T>>
void
setHierarchyColumn
(DataGrid.Column<E> column) Set the column that displays the hierarchy of this DataGrid's data.void
Set the column that displays the hierarchy of this DataGrid's data.void
setItemCollapseAllowedProvider
(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, removeAllActions
Methods 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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods 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, sort
Methods inherited from interface io.jmix.ui.component.HasButtonsPanel
getButtonsPanel, setButtonsPanel
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasPagination
getPagination, setPagination
Methods inherited from interface io.jmix.ui.component.ListComponent
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelected
Methods 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
null
if 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 returntrue
for 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.depth
describes 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.depth
describes 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.depth
describes 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.depth
describes 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:
true
if the item is expanded,false
otherwise
-
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
-