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 org.springframework.context.ApplicationContext
Contains all columns like a Grid and additionally hidden columns by security.protected ITEMS
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 TypeMethodDescriptioncom.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.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 void
deleteHiddenColumns
(List<com.vaadin.flow.component.grid.Grid.Column<E>> allColumns) void
void
protected void
void
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) Deprecated.protected void
initColumn
(com.vaadin.flow.component.grid.Grid.Column<E> column, MetaPropertyPath metaPropertyPath) protected void
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
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) 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
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setColumnPosition
(com.vaadin.flow.component.grid.Grid.Column<E> column, int index) void
void
setMultiSelect
(boolean multiSelect) protected void
protected void
unbind()
Methods inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
getComponent
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
metadataTools
-
messageTools
-
uiComponents
-
accessManager
-
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
-
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() -
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
-
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
-
getVisibleColumns
Deprecated.useGrid.getColumns()
and filter by visibility- Returns:
- a copy of columns that are visible and not hidden by security
-
getColumnByKey
-
removeColumn
-
isDataGridOwner
-
setColumnPosition
-
getAfterColumnSecurityApplyHandler
@Nullable public Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> getAfterColumnSecurityApplyHandler() -
setAfterColumnSecurityApplyHandler
public void setAfterColumnSecurityApplyHandler(@Nullable Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler)
-
Grid.getColumns()
and filter by visibility