Class AbstractGridDelegate<C extends com.vaadin.flow.component.grid.Grid<E> & ListDataComponent<E> & EnhancedDataGrid<E> & HasActions,E,ITEMS extends DataGridItems<E>>
java.lang.Object
io.jmix.flowui.component.delegate.AbstractComponentDelegate<C>
io.jmix.flowui.component.delegate.AbstractGridDelegate<C,E,ITEMS>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
GridDelegate,TreeGridDelegate
public abstract class AbstractGridDelegate<C extends com.vaadin.flow.component.grid.Grid<E> & ListDataComponent<E> & EnhancedDataGrid<E> & HasActions,E,ITEMS extends DataGridItems<E>>
extends AbstractComponentDelegate<C>
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected Consumer<AbstractGridDelegate.ColumnSecurityContext<E>>protected booleanprotected AggregatableDelegate<Object>protected com.vaadin.flow.component.grid.FooterRowprotected com.vaadin.flow.component.grid.HeaderRowprotected Map<com.vaadin.flow.component.grid.Grid.Column<E>,AggregationInfo> protected EnhancedDataGrid.AggregationPositionprotected Aggregationsprotected org.springframework.context.ApplicationContextContains all columns like a Grid and additionally hidden columns by security.protected ITEMSprotected com.vaadin.flow.shared.Registrationprotected MessageToolsprotected MetadataToolsprotected Map<com.vaadin.flow.component.grid.Grid.Column<E>,MetaPropertyPath> Columns that are bounded with data container (loaded from descriptor or added usingaddColumn(String, MetaPropertyPath)).protected com.vaadin.flow.shared.Registrationprotected Set<com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>,E>> protected UiComponentsprotected com.vaadin.flow.shared.RegistrationFields inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
component -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregationInfo(com.vaadin.flow.component.grid.Grid.Column<E> column, AggregationInfo info) com.vaadin.flow.component.grid.Grid.Column<E>com.vaadin.flow.component.grid.Grid.Column<E>addColumn(String key, MetaPropertyPath metaPropertyPath) protected com.vaadin.flow.component.grid.Grid.Column<E>addColumnInternal(String key, MetaPropertyPath metaPropertyPath) com.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) voidprotected voidprotected voidprotected voidprotected voidbind(DataGridItems<E> dataGridItems) protected booleancheckAggregation(AggregationInfo aggregationInfo) protected voidconvertAggregationKeyMapToColumnMap(Map<AggregationInfo, V> aggregationInfos) deleteHiddenColumns(List<com.vaadin.flow.component.grid.Grid.Column<E>> allColumns) voidvoidprotected voidvoidprotected voidfillAggregationRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected voidfillFooterRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected voidfillHeaderRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected AggregatableDelegate<Object>protected List<AggregationInfo>com.vaadin.flow.component.grid.Grid.Column<E>getColumnByKey(String key) getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) getItems()protected com.vaadin.flow.component.grid.GridSelectionModel<E>protected com.vaadin.flow.function.ValueProvider<E,?> getValueProvider(MetaPropertyPath metaPropertyPath) protected voidinitColumn(com.vaadin.flow.component.grid.Grid.Column<E> column, MetaPropertyPath metaPropertyPath) protected voidbooleanbooleanisDataGridOwner(com.vaadin.flow.component.grid.Grid.Column<E> column) booleanbooleanprotected booleanitemIsBeingEdited(E item) protected voidprotected voidprotected voidnotifyDataProviderSelectionChanged(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>, E> ignore) protected voidonColumnReorderChange(com.vaadin.flow.component.grid.ColumnReorderEvent<E> event) protected voidonSelectionChange(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>, E> event) voidonSelectionModelChange(com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<E>, E> selectionModel) protected voidonSort(com.vaadin.flow.data.event.SortEvent<com.vaadin.flow.component.grid.Grid<E>, com.vaadin.flow.component.grid.GridSortOrder<E>> event) voidremoveAggregationInfo(com.vaadin.flow.component.grid.Grid.Column<E> column) voidremoveColumn(com.vaadin.flow.component.grid.Grid.Column<E> column) restoreColumnsOrder(List<com.vaadin.flow.component.grid.Grid.Column<E>> visibleColumns) Inserts columns hidden by security permissions into a list of visible columns in their original positions.voidvoidselect(Collection<E> items) voidsetAfterColumnSecurityApplyHandler(Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler) voidsetAggregatable(boolean aggregatable) voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetColumnPosition(com.vaadin.flow.component.grid.Grid.Column<E> column, int index) voidvoidsetMultiSelect(boolean multiSelect) protected voidprotected voidunbind()protected voidMethods inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
getComponent
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
metadataTools
-
messageTools
-
uiComponents
-
accessManager
-
aggregations
-
aggregatableDelegate
-
dataGridItems
-
selectionListenerRegistration
protected com.vaadin.flow.shared.Registration selectionListenerRegistration -
itemSetChangeRegistration
protected com.vaadin.flow.shared.Registration itemSetChangeRegistration -
valueChangeRegistration
protected com.vaadin.flow.shared.Registration valueChangeRegistration -
selectionListeners
-
afterColumnSecurityApplyHandler
-
aggregatable
protected boolean aggregatable -
aggregationPosition
-
aggregationMap
-
aggregationHeader
protected com.vaadin.flow.component.grid.HeaderRow aggregationHeader -
propertyColumns
Columns that are bounded with data container (loaded from descriptor or added usingaddColumn(String, MetaPropertyPath)). -
columns
Contains all columns like a Grid and additionally hidden columns by security. The order of columns corresponds to the client side column order.
-
-
Constructor Details
-
AbstractGridDelegate
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent() -
getItems
-
setItems
-
bind
-
unbind
protected void unbind() -
itemsItemSetChanged
-
closeEditorIfOpened
protected void closeEditorIfOpened() -
itemsValueChanged
-
itemIsBeingEdited
-
getSingleSelectedItem
-
getSelectedItems
-
select
-
select
-
deselect
-
deselectAll
public void deselectAll() -
isMultiSelect
public boolean isMultiSelect() -
enableMultiSelect
public void enableMultiSelect() -
setMultiSelect
public void setMultiSelect(boolean multiSelect) -
addSelectionListener
-
isAggregatable
public boolean isAggregatable() -
setAggregatable
public void setAggregatable(boolean aggregatable) -
getAggregationPosition
-
setAggregationPosition
-
addAggregationInfo
public void addAggregationInfo(com.vaadin.flow.component.grid.Grid.Column<E> column, AggregationInfo info) -
removeAggregationInfo
-
getAggregationResults
-
aggregate
-
aggregateValues
-
convertAggregationKeyMapToColumnMap
protected <V> Map<com.vaadin.flow.component.grid.Grid.Column<E>,V> convertAggregationKeyMapToColumnMap(Map<AggregationInfo, V> aggregationInfos) -
getAggregationInfos
-
checkAggregation
-
fillAggregationRow
-
fillHeaderRow
-
updateAggregationRow
protected void updateAggregationRow() -
getColumnMetaPropertyPath
@Nullable public MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) -
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(String key, MetaPropertyPath metaPropertyPath) -
addColumn
-
setupEmptyDataProvider
protected void setupEmptyDataProvider() -
addColumnInternal
protected com.vaadin.flow.component.grid.Grid.Column<E> addColumnInternal(String key, MetaPropertyPath metaPropertyPath) -
getValueProvider
protected com.vaadin.flow.function.ValueProvider<E,?> getValueProvider(MetaPropertyPath metaPropertyPath) -
initColumn
protected void initColumn(com.vaadin.flow.component.grid.Grid.Column<E> column, MetaPropertyPath metaPropertyPath) -
onSelectionChange
-
onSelectionModelChange
-
attachSelectionListener
protected void attachSelectionListener() -
detachSelectionListener
protected void detachSelectionListener() -
getSelectionModel
-
onColumnReorderChange
-
restoreColumnsOrder
protected List<com.vaadin.flow.component.grid.Grid.Column<E>> restoreColumnsOrder(List<com.vaadin.flow.component.grid.Grid.Column<E>> visibleColumns) Inserts columns hidden by security permissions into a list of visible columns in their original positions.- Parameters:
visibleColumns- the list of DataGrid columns, not hidden by security permissions- Returns:
- a list of all columns in DataGrid
-
deleteHiddenColumns
-
onSort
-
notifyDataProviderSelectionChanged
-
applySecurityToPropertyColumns
protected void applySecurityToPropertyColumns() -
isPropertyEnabledBySecurity
-
getColumns
-
getColumnByKey
-
removeColumn
-
isDataGridOwner
-
setColumnPosition
-
getAggregatableDelegate
-
getAfterColumnSecurityApplyHandler
@Nullable public Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> getAfterColumnSecurityApplyHandler() -
setAfterColumnSecurityApplyHandler
public void setAfterColumnSecurityApplyHandler(@Nullable Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler)
-