Class GroupDataGridAdapter<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<T>
io.jmix.flowui.kit.component.grid.JmixGrid<E>
io.jmix.flowui.component.grid.DataGrid<E>
io.jmix.flowui.component.groupgrid.adapter.AbstractGroupDataGridAdapter<E>
io.jmix.groupgridflowui.component.adapter.GroupDataGridAdapter<E>
- Type Parameters:
E- entity type
- 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>> EnhancedDataGrid<E>,GroupListDataComponent<E>,ListDataComponent<E>,LookupComponent<E>,LookupComponent.MultiSelectLookupComponent<E>,SupportsEnterPress<DataGrid<E>>,HasActions,HasSubParts,SelectionChangeNotifier<com.vaadin.flow.component.grid.Grid<E>,,E> Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
Adapter for
GroupDataGrid component. The adapter has highly limited functionality.
Most methods are not overridden and changes will not be applied to the adaptee.
This class mostly adapts GroupDataGrid to be used in Excel exporting and in JmixGridColumnVisibility.
- 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.SpringData, 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 io.jmix.flowui.component.grid.EnhancedDataGrid
EnhancedDataGrid.AggregationPositionNested 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.groupgrid.GroupListDataComponent
GroupListDataComponent.CollapseEvent<E>, GroupListDataComponent.ExpandEvent<E>Nested classes/interfaces inherited from interface io.jmix.flowui.component.LookupComponent
LookupComponent.MultiSelectLookupComponent<T>Nested classes/interfaces inherited from interface io.jmix.flowui.component.SupportsEnterPress
SupportsEnterPress.EnterPressEvent<C extends com.vaadin.flow.component.Component> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFields inherited from class io.jmix.flowui.component.groupgrid.adapter.AbstractGroupDataGridAdapter
groupDataGridFields inherited from class io.jmix.flowui.component.grid.DataGrid
applicationContext, contextMenu, editorCreated, gridDelegateFields inherited from class io.jmix.flowui.kit.component.grid.JmixGrid
actionsSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddColumnInternal(Grid.Column<E> column) com.vaadin.flow.component.grid.HeaderRowprotected DataGridColumnAdapter<E>createColumnAdapter(DataGridColumn<E> column) protected DataGridColumnAdapter<E>createColumnAdapter(DataGridColumn<E> column, com.vaadin.flow.data.renderer.Renderer<E> renderer, String columnId) protected AggregationInfovoidDeselects the row corresponding to the given item in this component.voidDeselects all selected rows.protected voidvoidEnables multi-selection functionality for the component.protected voidGets an unmodifiable list of all currently addedGrid.Columns.getColumnByMetaPropertyPath(MetaPropertyPath metaPropertyPath) 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.com.vaadin.flow.data.provider.DataCommunicator<E>com.vaadin.flow.data.provider.DataProvider<E,?> protected BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,String, AbstractGroupDataGridColumnAdapter<E>> com.vaadin.flow.component.grid.HeaderRowList<com.vaadin.flow.component.grid.FooterRow>Collection<com.vaadin.flow.component.grid.Grid.Column<E>>List<com.vaadin.flow.component.grid.HeaderRow>getId()protected GroupDataGridItems<E>Returns a set of items corresponding to the selected rows of this component.Returns an item corresponding to the selected row of this component.Optional<com.vaadin.flow.component.UI>getUI()protected GroupDataGrid<E>protected voidbooleanbooleanisGroupColumn(com.vaadin.flow.component.grid.Grid.Column<E> column) Checks whether the given column is an implementation ofGroupColumn.booleanbooleancom.vaadin.flow.component.grid.FooterRowvoidvoidvoidSelects a row of this component for a given item.voidsetDataProvider(com.vaadin.flow.data.provider.DataProvider<E, ?> dataProvider) com.vaadin.flow.component.grid.dataview.GridDataView<E>voidsetMultiSelect(boolean multiSelect) Sets whether the component allows multi-selection or not.voidsetVisible(boolean visible) toNativeColumns(Collection<Grid.Column<E>> groupColumns) Methods inherited from class io.jmix.flowui.component.groupgrid.adapter.AbstractGroupDataGridAdapter
addCollapseListener, addExpandListener, collapse, collapseAll, collapseByPath, expand, expandAll, expandByPath, getChildren, getDefaultColumnFactory, getItems, getRootGroups, groupByKeys, groupByKeysList, hasChildren, hasGroups, isExpanded, ungroup, ungroupByKeys, ungroupByKeysListMethods inherited from class io.jmix.flowui.component.grid.DataGrid
addAggregation, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addComponentColumn, addContextMenu, addItemDoubleClickListener, addSelectionListener, afterPropertiesSet, createActionsSupport, createDelegate, createEditor, getAggregationPosition, getAggregationResults, getColumnByKey, getContextMenu, getEditor, getEmptyStateComponent, getEmptyStateText, getSubPart, isAggregatable, isEditorCreated, onAfterApplyColumnSecurity, onDataProviderChange, removeColumn, select, setAggregatable, setAggregationPosition, setApplicationContext, setColumnPosition, setEmptyStateComponent, setEmptyStateText, setEnterPressHandler, setSelectionModeMethods inherited from class io.jmix.flowui.kit.component.grid.JmixGrid
addAction, addAction, getAction, getActions, getActionsSupport, removeAction, setClassNameGeneratorMethods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createSortingComparator, getAriaLabel, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByInternalId, getColumnLayers, getColumnRendering, getDragFilter, getDropFilter, getDropMode, getGenericDataView, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getTooltipPosition, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onAttach, onDetach, onEnabledStateChanged, prependHeaderRow, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToItem, scrollToStart, setAllRowsVisible, setAriaLabel, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumnReorderingAllowed, setColumns, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setItemDetailsRenderer, setItems, setItems, setItems, setItemSelectableProvider, setItemsPageable, setItemsPageable, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setTooltipPosition, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClientMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, hasListener, isTemplateMapped, scrollIntoView, scrollIntoView, set, setElement, setIdMethods 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 io.jmix.flowui.component.grid.EnhancedDataGrid
addAggregation, addColumn, addColumn, getAggregationPosition, getAggregationResults, getContextMenu, isAggregatable, isEditorCreated, setAggregatable, setAggregationPositionMethods 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.HasLazyDataView
setItems, setItemsMethods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, 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, setThemeNameMethods inherited from interface io.jmix.flowui.component.ListDataComponent
select
-
Field Details
-
selectionEnabled
protected boolean selectionEnabled -
groupingColumns
-
-
Constructor Details
-
GroupDataGridAdapter
-
-
Method Details
-
initComponent
protected void initComponent()- Overrides:
initComponentin classDataGrid<E>
-
getAdaptee
- Overrides:
getAdapteein classAbstractGroupDataGridAdapter<E>- Returns:
- the underlying
GroupListDataComponentinstance that is adapted
-
getGroupingColumns
- Specified by:
getGroupingColumnsin classAbstractGroupDataGridAdapter<E>- Returns:
- the collection of columns that are used for grouping data in the grid
-
isGroupColumn
Description copied from class:AbstractGroupDataGridAdapterChecks whether the given column is an implementation ofGroupColumn.- Specified by:
isGroupColumnin classAbstractGroupDataGridAdapter<E>- Parameters:
column- the column to check- Returns:
trueif the column is a group column
-
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>- Overrides:
getSingleSelectedItemin classDataGrid<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 classDataGrid<E>- Returns:
- a set of item instances corresponding to the selected rows of
this component, never
null
-
getColumnMetaPropertyPath
@Nullable public MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) - Specified by:
getColumnMetaPropertyPathin interfaceEnhancedDataGrid<E>- Overrides:
getColumnMetaPropertyPathin classDataGrid<E>
-
getColumnByMetaPropertyPath
- Specified by:
getColumnByMetaPropertyPathin interfaceEnhancedDataGrid<E>- Overrides:
getColumnByMetaPropertyPathin classDataGrid<E>- Parameters:
metaPropertyPath-MetaPropertyPaththat refers to the column- Returns:
DataGridColumnthat is bound to the passedmetaPropertyPath
-
getColumns
Description copied from class:DataGridNote: 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 classDataGrid<E>- Returns:
- an unmodifiable list of
Grid.Columns that are not hidden by security
-
getAllColumns
Description copied from class:DataGridGets an unmodifiable list of all currently addedGrid.Columns.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.- Overrides:
getAllColumnsin classDataGrid<E>- Returns:
- a copy of all currently added
Grid.Columns including hidden by security
-
setItems
-
select
Description copied from interface:ListDataComponentSelects a row of this component for a given item. -
deselect
Description copied from interface:ListDataComponentDeselects the row corresponding to the given item in this component. -
deselectAll
public void deselectAll()Description copied from interface:ListDataComponentDeselects all selected rows.- Specified by:
deselectAllin interfaceListDataComponent<E>- Overrides:
deselectAllin classDataGrid<E>
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelectin interfaceListDataComponent<E>- Overrides:
isMultiSelectin classDataGrid<E>- Returns:
trueif multiple selection mode is enabled
-
enableMultiSelect
public void enableMultiSelect()Description copied from interface:LookupComponent.MultiSelectLookupComponentEnables multi-selection functionality for the component.This method sets the component to allow the selection of multiple items simultaneously by internally invoking
setMultiSelect(true).- Specified by:
enableMultiSelectin interfaceLookupComponent.MultiSelectLookupComponent<E>- Overrides:
enableMultiSelectin classDataGrid<E>
-
setMultiSelect
public void setMultiSelect(boolean multiSelect) Description copied from interface:LookupComponent.MultiSelectLookupComponentSets whether the component allows multi-selection or not.- Specified by:
setMultiSelectin interfaceLookupComponent.MultiSelectLookupComponent<E>- Overrides:
setMultiSelectin classDataGrid<E>- Parameters:
multiSelect- iftrue, multi-selection is enabled; otherwise, multi-selection is disabled
-
getDefaultHeaderRow
public com.vaadin.flow.component.grid.HeaderRow getDefaultHeaderRow()- Overrides:
getDefaultHeaderRowin classJmixGrid<E>- Returns:
- a default header row
-
appendHeaderRow
public com.vaadin.flow.component.grid.HeaderRow appendHeaderRow()- Overrides:
appendHeaderRowin classcom.vaadin.flow.component.grid.Grid<E>
-
getHeaderRows
- Overrides:
getHeaderRowsin classcom.vaadin.flow.component.grid.Grid<E>
-
setDataProvider
- Overrides:
setDataProviderin classcom.vaadin.flow.component.grid.Grid<E>
-
getDataProvider
- Overrides:
getDataProviderin classcom.vaadin.flow.component.grid.Grid<E>
-
getDataCommunicator
- Overrides:
getDataCommunicatorin classcom.vaadin.flow.component.grid.Grid<E>
-
recalculateColumnWidths
public void recalculateColumnWidths()- Overrides:
recalculateColumnWidthsin classcom.vaadin.flow.component.grid.Grid<E>
-
getDefaultColumnFactoryInternal
protected BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,String, getDefaultColumnFactoryInternal()AbstractGroupDataGridColumnAdapter<E>> - Specified by:
getDefaultColumnFactoryInternalin classAbstractGroupDataGridAdapter<E>
-
getUI
- Overrides:
getUIin classcom.vaadin.flow.component.Component
-
getId
- Overrides:
getIdin classcom.vaadin.flow.component.Component
-
isAttached
public boolean isAttached()- Overrides:
isAttachedin classcom.vaadin.flow.component.Component
-
setVisible
public void setVisible(boolean visible) - Overrides:
setVisiblein classcom.vaadin.flow.component.Component
-
isVisible
public boolean isVisible()- Overrides:
isVisiblein classcom.vaadin.flow.component.Component
-
removeFromParent
public void removeFromParent()- Overrides:
removeFromParentin classcom.vaadin.flow.component.Component
-
groupDataGrid
-
toNativeColumns
protected List<com.vaadin.flow.component.grid.Grid.Column<E>> toNativeColumns(Collection<Grid.Column<E>> groupColumns) -
createColumnAdapter
-
createColumnAdapter
protected DataGridColumnAdapter<E> createColumnAdapter(DataGridColumn<E> column, com.vaadin.flow.data.renderer.Renderer<E> renderer, String columnId) -
addColumnInternal
-
createStubAggregationInfo
-
enableSelection
protected void enableSelection() -
disableSelection
protected void disableSelection() -
toNativeAggregationPosition
public EnhancedDataGrid.AggregationPosition toNativeAggregationPosition(EnhancedGroupDataGrid.AggregationPosition position) -
getItemsInternal
- Specified by:
getItemsInternalin classAbstractGroupDataGridAdapter<E>
-