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
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected Consumer<AbstractGridDelegate.ColumnSecurityContext<E>>
protected boolean
protected AggregatableDelegate<Object>
protected com.vaadin.flow.component.grid.FooterRow
protected com.vaadin.flow.component.grid.HeaderRow
protected Map<com.vaadin.flow.component.grid.Grid.Column<E>,
AggregationInfo> protected EnhancedDataGrid.AggregationPosition
protected Aggregations
protected org.springframework.context.ApplicationContext
Contains all columns like a Grid and additionally hidden columns by security.protected ITEMS
protected Consumer<SupportsEnterPress.EnterPressEvent<C>>
protected Set<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemDoubleClickEvent<E>>>
protected com.vaadin.flow.shared.Registration
protected MessageTools
protected MetadataTools
protected 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.Registration
protected Set<com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>,
E>> protected UiComponents
protected com.vaadin.flow.shared.Registration
Fields inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
component
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAggregationInfo
(com.vaadin.flow.component.grid.Grid.Column<E> column, AggregationInfo info) addColumn
(String key, MetaPropertyPath metaPropertyPath) protected com.vaadin.flow.component.grid.Grid.Column<E>
addColumnInternal
(String key, MetaPropertyPath metaPropertyPath) com.vaadin.flow.shared.Registration
addItemDoubleClickListener
(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemDoubleClickEvent<E>> listener) com.vaadin.flow.shared.Registration
addSelectionListener
(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) void
protected void
protected void
protected void
protected void
bind
(DataGridItems<E> dataGridItems) protected boolean
checkAggregation
(AggregationInfo aggregationInfo) protected void
convertAggregationKeyMapToColumnMap
(Map<AggregationInfo, V> aggregationInfos) deleteHiddenColumns
(List<com.vaadin.flow.component.grid.Grid.Column<E>> allColumns) void
void
protected void
void
protected void
fillAggregationRow
(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected void
fillFooterRow
(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected void
fillHeaderRow
(Map<com.vaadin.flow.component.grid.Grid.Column<E>, String> values) protected Action
protected void
fireItemDoubleClick
(com.vaadin.flow.component.grid.ItemDoubleClickEvent<E> itemDoubleClickEvent) protected AggregatableDelegate<Object>
protected List<AggregationInfo>
getColumnByKey
(String key) getColumnMetaPropertyPath
(com.vaadin.flow.component.grid.Grid.Column<E> column) BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,
String, com.vaadin.flow.component.grid.Grid.Column<E>> getItems()
protected com.vaadin.flow.component.grid.GridSelectionModel<E>
protected com.vaadin.flow.function.ValueProvider<E,
?> getValueProvider
(MetaPropertyPath metaPropertyPath) protected void
handleDoubleClickAction
(E item) protected void
protected void
initColumn
(com.vaadin.flow.component.grid.Grid.Column<E> column, MetaPropertyPath metaPropertyPath) protected void
boolean
boolean
isDataGridOwner
(com.vaadin.flow.component.grid.Grid.Column<E> column) boolean
boolean
protected boolean
itemIsBeingEdited
(E item) protected void
protected void
protected void
notifyDataProviderSelectionChanged
(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>, E> ignore) protected void
onColumnReorderChange
(com.vaadin.flow.component.grid.ColumnReorderEvent<E> event) protected void
onItemDoubleClick
(com.vaadin.flow.component.grid.ItemDoubleClickEvent<E> itemDoubleClickEvent) protected void
onSelectionChange
(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>, E> event) void
onSelectionModelChange
(com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<E>, E> selectionModel) protected void
onSort
(com.vaadin.flow.data.event.SortEvent<com.vaadin.flow.component.grid.Grid<E>, com.vaadin.flow.component.grid.GridSortOrder<E>> event) protected void
refreshSelection
(Collection<E> items) Refreshes current selection using provided items.void
removeAggregationInfo
(com.vaadin.flow.component.grid.Grid.Column<E> column) void
removeColumn
(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.void
void
select
(Collection<E> items) void
setAfterColumnSecurityApplyHandler
(Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler) void
setAggregatable
(boolean aggregatable) void
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setColumnPosition
(com.vaadin.flow.component.grid.Grid.Column<E> column, int index) void
void
void
setMultiSelect
(boolean multiSelect) protected void
protected void
unbind()
protected void
Methods 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
-
itemDoubleClickListeners
-
enterPressHandler
protected Consumer<SupportsEnterPress.EnterPressEvent<C extends com.vaadin.flow.component.grid.Grid<E> & ListDataComponent<E> & EnhancedDataGrid<E> & HasActions>> enterPressHandler -
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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in 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() -
refreshSelection
Refreshes current selection using provided items. -
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
-
addItemDoubleClickListener
public com.vaadin.flow.shared.Registration addItemDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemDoubleClickEvent<E>> listener) -
setEnterPressHandler
-
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() -
getDefaultColumnFactory
public BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,String, getDefaultColumnFactory()com.vaadin.flow.component.grid.Grid.Column<E>> -
getColumnMetaPropertyPath
@Nullable public MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column) -
addColumn
-
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) -
onItemDoubleClick
protected void onItemDoubleClick(com.vaadin.flow.component.grid.ItemDoubleClickEvent<E> itemDoubleClickEvent) -
fireItemDoubleClick
protected void fireItemDoubleClick(com.vaadin.flow.component.grid.ItemDoubleClickEvent<E> itemDoubleClickEvent) -
handleEnterPress
protected void handleEnterPress() -
handleDoubleClickAction
-
findEnterAction
-