Package io.jmix.flowui.component.grid
Class TreeDataGrid<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<T>
com.vaadin.flow.component.treegrid.TreeGrid<T>
io.jmix.flowui.kit.component.grid.JmixTreeGrid<E>
io.jmix.flowui.component.grid.TreeDataGrid<E>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<E>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<E>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<E>>,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<E>,,com.vaadin.flow.component.grid.GridSortOrder<E>> com.vaadin.flow.data.provider.HasDataGenerators<E>,com.vaadin.flow.data.provider.HasDataView<E,,Void, com.vaadin.flow.component.grid.dataview.GridDataView<E>> com.vaadin.flow.data.provider.HasLazyDataView<E,,Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<E>> com.vaadin.flow.data.provider.HasListDataView<E,,com.vaadin.flow.component.grid.dataview.GridListDataView<E>> com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<E>,EnhancedDataGrid<E>,EnhancedTreeDataGrid<E>,ListDataComponent<E>,LookupComponent<E>,LookupComponent.MultiSelectLookupComponent<E>,HasActions,SelectionChangeNotifier<com.vaadin.flow.component.grid.Grid<E>,,E> Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class TreeDataGrid<E>
extends JmixTreeGrid<E>
implements ListDataComponent<E>, LookupComponent.MultiSelectLookupComponent<E>, EnhancedTreeDataGrid<E>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T extends Object>, com.vaadin.flow.component.grid.Grid.Column<T extends Object>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T extends Object,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.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>Nested classes/interfaces inherited from interface io.jmix.flowui.component.LookupComponent
LookupComponent.MultiSelectLookupComponent<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected booleanprotected TreeGridDelegate<E,TreeDataGridItems<E>> Fields inherited from class io.jmix.flowui.kit.component.grid.JmixTreeGrid
actionsSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.grid.Grid.Column<E>com.vaadin.flow.component.grid.Grid.Column<E>com.vaadin.flow.component.grid.Grid.Column<E>com.vaadin.flow.component.grid.Grid.Column<E>addColumn(MetaPropertyPath metaPropertyPath) Adds column by the meta property path.com.vaadin.flow.component.grid.Grid.Column<E>addColumn(String key, MetaPropertyPath metaPropertyPath) Adds column by the meta property path and specified key.com.vaadin.flow.component.grid.Grid.Column<E>addHierarchyColumn(MetaPropertyPath metaPropertyPath) Adds hierarchy column by the meta property path.com.vaadin.flow.component.grid.Grid.Column<E>addHierarchyColumn(String key, MetaPropertyPath metaPropertyPath) Adds hierarchy column by the meta property path and specified key.com.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) voidprotected GridActionsSupport<JmixTreeGrid<E>,E> protected TreeGridDelegate<E,TreeDataGridItems<E>> protected DataGridEditor<E>voidvoidDeselects all selected rows.voidGets an unmodifiable list of all currently addedGrid.Columns including hidden by security.com.vaadin.flow.component.grid.Grid.Column<E>getColumnByKey(String columnKey) getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) Note: If column reordering is enabled withGrid.setColumnReorderingAllowed(boolean)and the user has reordered the columns, the order of the list returned by this method might be incorrect.getItems()Returns a set of items corresponding to the selected rows of this component.Returns an item corresponding to the selected row of this component.protected voidbooleanbooleanprotected voidprotected voidvoidremoveColumn(com.vaadin.flow.component.grid.Grid.Column<E> column) voidSelects a row of this component for a given item.voidselect(Collection<E> items) Selects the rows of this component for a given collection of items.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetColumnPosition(com.vaadin.flow.component.grid.Grid.Column<E> column, int index) Moves column to a provided position in theDataGrid.voidsetDataProvider(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<E, ?> dataProvider) voidsetMultiSelect(boolean multiSelect) com.vaadin.flow.component.grid.GridSelectionModel<E>setSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) Methods inherited from class io.jmix.flowui.kit.component.grid.JmixTreeGrid
addAction, addAction, getAction, getActions, getActionsSupport, removeActionMethods inherited from class com.vaadin.flow.component.treegrid.TreeGrid
addCollapseListener, addComponentHierarchyColumn, addExpandListener, addHierarchyColumn, collapse, collapse, collapse, collapseRecursively, collapseRecursively, createDefaultArrayUpdater, expand, expand, expand, expandRecursively, expandRecursively, getDataCommunicator, getDataProvider, getGenericDataView, getItemsWithChildrenRecursively, getLazyDataView, getListDataView, isExpanded, scrollToIndex, setColumns, setDataProvider, setHierarchyColumn, setHierarchyColumn, setItems, setItems, setItems, setItems, setItems, setUniqueKeyDataGeneratorMethods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createSortingComparator, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnLayers, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getFooterRows, getHeaderRows, getNestedNullBehavior, getPageSize, getPropertySet, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isHeightByRows, isMultiSort, isRowsDraggable, isVerticalScrollingEnabled, onAttach, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeColumnByKey, removeColumnLayer, removeColumns, removeThemeVariants, scrollToEnd, scrollToStart, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnReorderingAllowed, setColumns, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setHeightByRows, setItemDetailsRenderer, setItems, setItems, setItems, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setRowsDraggable, setSelectionDragDetails, setSelectionModel, setSortableColumns, setUniqueKeyProperty, setUniqueKeyProvider, setVerticalScrollingEnabled, sort, updateSelectionModeOnClientMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, 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.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface io.jmix.flowui.kit.component.HasActions
removeAction, removeAllActionsMethods 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.data.provider.HasLazyDataView
setItemsMethods 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, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
gridDelegate
-
editorCreated
protected boolean editorCreated
-
-
Constructor Details
-
TreeDataGrid
public TreeDataGrid()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
protected void initComponent() -
createDelegate
-
setDataProvider
public void setDataProvider(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<E, ?> dataProvider) -
getSingleSelectedItem
Description copied from interface:ListDataComponentReturns an item corresponding to the selected row of this component. If nothing is selected, the method returnsnull. If multiple selection mode is enabled, returns the first selected instance.- Specified by:
getSingleSelectedItemin interfaceListDataComponent<E>- Returns:
- an item corresponding to the selected row of this component
-
getSelectedItems
Description copied from interface:ListDataComponentReturns a set of items corresponding to the selected rows of this component. If nothing is selected, the method returns aCollections.emptySet().- Specified by:
getSelectedItemsin interfaceListDataComponent<E>- Specified by:
getSelectedItemsin interfaceLookupComponent<E>- Overrides:
getSelectedItemsin classcom.vaadin.flow.component.grid.Grid<E>- Returns:
- a set of item instances corresponding to the selected rows of
this component, never
null
-
select
Description copied from interface:ListDataComponentSelects a row of this component for a given item.- Specified by:
selectin interfaceListDataComponent<E>- Overrides:
selectin classcom.vaadin.flow.component.grid.Grid<E>- Parameters:
item- item instance to select the row
-
select
Description copied from interface:ListDataComponentSelects the rows of this component for a given collection of items.- Specified by:
selectin interfaceListDataComponent<E>- Parameters:
items- collection of items to select rows
-
deselect
- Specified by:
deselectin interfaceListDataComponent<E>- Overrides:
deselectin classcom.vaadin.flow.component.grid.Grid<E>
-
deselectAll
public void deselectAll()Description copied from interface:ListDataComponentDeselects all selected rows.- Specified by:
deselectAllin interfaceListDataComponent<E>- Overrides:
deselectAllin classcom.vaadin.flow.component.grid.Grid<E>
-
getItems
- Specified by:
getItemsin interfaceListDataComponent<E>- Returns:
- a data unit that holds component items
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelectin interfaceListDataComponent<E>- Returns:
trueif multiple selection mode is enabled
-
addSelectionListener
public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) - Specified by:
addSelectionListenerin interfaceSelectionChangeNotifier<com.vaadin.flow.component.grid.Grid<E>,E> - Overrides:
addSelectionListenerin classcom.vaadin.flow.component.grid.Grid<E>
-
enableMultiSelect
public void enableMultiSelect()- Specified by:
enableMultiSelectin interfaceLookupComponent.MultiSelectLookupComponent<E>
-
setMultiSelect
public void setMultiSelect(boolean multiSelect) - Specified by:
setMultiSelectin interfaceLookupComponent.MultiSelectLookupComponent<E>
-
setSelectionMode
public com.vaadin.flow.component.grid.GridSelectionModel<E> setSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) - Overrides:
setSelectionModein classcom.vaadin.flow.component.grid.Grid<E>
-
getColumnMetaPropertyPath
@Nullable public MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) - Specified by:
getColumnMetaPropertyPathin interfaceEnhancedDataGrid<E>
-
addColumn
Adds column by the meta property path.- Specified by:
addColumnin interfaceEnhancedDataGrid<E>- Parameters:
metaPropertyPath- meta property path to add column- Returns:
- added column
-
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(String key, MetaPropertyPath metaPropertyPath) Adds column by the meta property path and specified key. The key is used to identify the column, seegetColumnByKey(String).- Specified by:
addColumnin interfaceEnhancedDataGrid<E>- Parameters:
key- column keymetaPropertyPath- meta property path to add column- Returns:
- added column
-
addHierarchyColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addHierarchyColumn(MetaPropertyPath metaPropertyPath) Description copied from interface:EnhancedTreeDataGridAdds hierarchy column by the meta property path. seegetColumnByKey(String).- Specified by:
addHierarchyColumnin interfaceEnhancedTreeDataGrid<E>- Parameters:
metaPropertyPath- meta property path to add column- Returns:
- added column
-
addHierarchyColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addHierarchyColumn(String key, MetaPropertyPath metaPropertyPath) Description copied from interface:EnhancedTreeDataGridAdds hierarchy column by the meta property path and specified key. The key is used to identify the column, seegetColumnByKey(String).- Specified by:
addHierarchyColumnin interfaceEnhancedTreeDataGrid<E>- Parameters:
key- column keymetaPropertyPath- meta property path to add column- Returns:
- added column
-
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(com.vaadin.flow.function.ValueProvider<E, ?> valueProvider) - Overrides:
addColumnin classcom.vaadin.flow.component.grid.Grid<E>
-
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(com.vaadin.flow.data.renderer.Renderer<E> renderer) - Overrides:
addColumnin classcom.vaadin.flow.component.grid.Grid<E>
-
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(com.vaadin.flow.data.renderer.Renderer<E> renderer, String... sortingProperties) - Overrides:
addColumnin classcom.vaadin.flow.component.grid.Grid<E>
-
getColumnByKey
- Overrides:
getColumnByKeyin classcom.vaadin.flow.component.grid.Grid<E>
-
removeColumn
- Overrides:
removeColumnin classcom.vaadin.flow.component.grid.Grid<E>
-
getVisibleColumns
- Specified by:
getVisibleColumnsin interfaceEnhancedDataGrid<E>- Returns:
- a copy of columns that are visible and not hidden by security
-
getColumns
Note: If column reordering is enabled withGrid.setColumnReorderingAllowed(boolean)and the user has reordered the columns, the order of the list returned by this method might be incorrect.- Overrides:
getColumnsin classcom.vaadin.flow.component.grid.Grid<E>- Returns:
- an unmodifiable list of
Grid.Columns that are not hidden by security
-
getAllColumns
Gets an unmodifiable list of all currently addedGrid.Columns including hidden by security.If column reordering is enabled with
Grid.setColumnReorderingAllowed(boolean)and the user has reordered the columns, the order of the returned list will be correct.- Returns:
- a copy of all currently added
Grid.Columns including hidden by security
-
setColumnPosition
Moves column to a provided position in theDataGrid.- Parameters:
column- column to moveindex- new index of column ingetAllColumns()list
-
isEditorCreated
public boolean isEditorCreated()- Specified by:
isEditorCreatedin interfaceEnhancedDataGrid<E>
-
onDataProviderChange
protected void onDataProviderChange()- Overrides:
onDataProviderChangein classcom.vaadin.flow.component.grid.Grid<E>
-
getEditor
- Overrides:
getEditorin classcom.vaadin.flow.component.grid.Grid<E>
-
createEditor
- Overrides:
createEditorin classcom.vaadin.flow.component.grid.Grid<E>
-
createActionsSupport
- Overrides:
createActionsSupportin classJmixTreeGrid<E>
-
onAfterApplyColumnSecurity
-