Package io.jmix.groupgridflowui.delegate
Class AbstractGroupGridDelegate<C extends GroupDataGrid<E> & ListDataComponent<E> & EnhancedGroupDataGrid<E> & HasActions,E,ITEMS extends GroupDataGridItems<E>>
java.lang.Object
io.jmix.flowui.component.delegate.AbstractComponentDelegate<C>
io.jmix.groupgridflowui.delegate.AbstractGroupGridDelegate<C,E,ITEMS>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
GroupDataGridDelegate
public abstract class AbstractGroupGridDelegate<C extends GroupDataGrid<E> & ListDataComponent<E> & EnhancedGroupDataGrid<E> & HasActions,E,ITEMS extends GroupDataGridItems<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<AbstractGroupGridDelegate.ColumnSecurityContext<E>>protected booleanprotected AggregatableDelegate<Object>protected FooterRowprotected HeaderRowprotected Map<Grid.Column<E>,AggregationInfo> protected Aggregationsprotected org.springframework.context.ApplicationContextprotected List<Grid.Column<E>>Contains all columns like a Grid and additionally hidden columns by security.protected Consumer<com.vaadin.flow.component.Component>protected ITEMSprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.component.Componentprotected Stringprotected Consumer<SupportsEnterPress.EnterPressEvent<C>>protected Fragmentsprotected Set<com.vaadin.flow.component.ComponentEventListener<ItemDoubleClickEvent<E>>>protected com.vaadin.flow.shared.Registrationprotected MessageToolsprotected MetadataToolsprotected Map<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 com.vaadin.flow.shared.RegistrationFields inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
component -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregationInfo(Grid.Column<E> column, AggregationInfo info) addColumn(DataGridColumn<E> column) addColumn(String key, MetaPropertyPath metaPropertyPath) protected DataGridColumn<E>addColumnInternal(String key, MetaPropertyPath metaPropertyPath) com.vaadin.flow.shared.RegistrationaddItemDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<ItemDoubleClickEvent<E>> listener) com.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.data.selection.SelectionListener<Grid<E>, E> listener) voidprotected Map<Grid.Column<E>,String> protected Map<Grid.Column<E>,Object> protected voidprotected voidprotected voidprotected voidprotected booleancheckAggregation(AggregationInfo aggregationInfo) protected voidprotected <V> Map<Grid.Column<E>,V> convertAggregationKeyMapToColumnMap(Map<AggregationInfo, V> aggregationInfos) protected List<Grid.Column<E>>deleteHiddenColumns(List<Grid.Column<E>> allColumns) voidvoidprotected voidvoidprotected voidfillAggregationRow(Map<Grid.Column<E>, String> values) protected voidfillFooterRow(Map<Grid.Column<E>, String> values) protected voidfillHeaderRow(Map<Grid.Column<E>, String> values) protected Actionprotected voidfireItemDoubleClick(ItemDoubleClickEvent<E> itemDoubleClickEvent) protected AggregatableDelegate<Object>getAggregationInfo(Grid.Column<E> column) protected List<AggregationInfo>getColumnByKey(String key) getColumnByMetaPropertyPath(MetaPropertyPath propertyPath) getColumnMetaPropertyPath(Grid.Column<E> column) List<Grid.Column<E>>BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,String, Grid.Column<E>> com.vaadin.flow.component.ComponentgetItems()protected GridSelectionModel<E>protected com.vaadin.flow.function.ValueProvider<E,?> getValueProvider(MetaPropertyPath metaPropertyPath) protected voidhandleDoubleClickAction(E item) protected voidprotected voidinitColumn(Grid.Column<E> column, MetaPropertyPath metaPropertyPath) protected voidprotected voidbooleanbooleanisDataGridOwner(Grid.Column<E> column) booleanbooleanprotected booleanitemIsBeingEdited(E item) protected voidprotected voidprotected voidnotifyDataProviderSelectionChanged(com.vaadin.flow.data.selection.SelectionEvent<Grid<E>, E> ignore) protected voidonColumnReorderChange(ColumnReorderEvent<E> event) protected voidonGridEditorClose(EditorCloseEvent<E> eEditorCloseEvent) protected voidonItemDoubleClick(ItemDoubleClickEvent<E> itemDoubleClickEvent) protected voidonSelectionChange(com.vaadin.flow.data.selection.SelectionEvent<Grid<E>, E> event) voidonSelectionModelChange(com.vaadin.flow.data.selection.SelectionModel<Grid<E>, E> selectionModel) protected voidonSort(com.vaadin.flow.data.event.SortEvent<Grid<E>, GridSortOrder<E>> event) protected voidrefreshSelection(Collection<E> items) Refreshes current selection using provided items.voidremoveAggregationInfo(Grid.Column<E> column) voidremoveColumn(Grid.Column<E> column) protected List<Grid.Column<E>>restoreColumnsOrder(List<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<AbstractGroupGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler) voidsetAggregatable(boolean aggregatable) voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetColumnPosition(Grid.Column<E> column, int index) voidsetEmptyStateComponent(com.vaadin.flow.component.Component emptyStateComponent) voidsetEmptyStateComponentDelegate(Consumer<com.vaadin.flow.component.Component> emptyStateComponentDelegate) voidsetEmptyStateText(String emptyStateText) voidsetEmptyStateTextDelegate(Consumer<String> emptyStateTextDelegate) voidvoidvoidsetMultiSelect(boolean multiSelect) protected voidprotected voidprotected voidunbind()protected voidprotected voidMethods inherited from class io.jmix.flowui.component.delegate.AbstractComponentDelegate
getComponent
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
fragments
-
metadataTools
-
messageTools
-
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
protected Set<com.vaadin.flow.component.ComponentEventListener<ItemDoubleClickEvent<E>>> itemDoubleClickListeners -
enterPressHandler
protected Consumer<SupportsEnterPress.EnterPressEvent<C extends GroupDataGrid<E> & ListDataComponent<E> & EnhancedGroupDataGrid<E> & HasActions>> enterPressHandler -
afterColumnSecurityApplyHandler
protected Consumer<AbstractGroupGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler -
emptyStateTextInternal
-
emptyStateComponentInternal
protected com.vaadin.flow.component.Component emptyStateComponentInternal -
componentEmptyStateTextDelegate
-
componentEmptyStateComponentDelegate
-
emptyStateByPermissionRegistration
protected com.vaadin.flow.shared.Registration emptyStateByPermissionRegistration -
aggregatable
protected boolean aggregatable -
aggregationPosition
-
aggregationMap
-
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
-
AbstractGroupGridDelegate
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
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() -
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<ItemDoubleClickEvent<E>> listener) -
setEnterPressHandler
-
isAggregatable
public boolean isAggregatable() -
setAggregatable
public void setAggregatable(boolean aggregatable) -
getAggregationPosition
-
setAggregationPosition
-
addAggregationInfo
-
removeAggregationInfo
-
getAggregationInfo
-
getAggregationResults
-
aggregate
-
aggregateValues
-
convertAggregationKeyMapToColumnMap
protected <V> Map<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()Grid.Column<E>> -
getColumnMetaPropertyPath
-
getColumnByMetaPropertyPath
- Parameters:
propertyPath-MetaPropertyPaththat refers to the column- Returns:
DataGridColumnthat is bound to the passedpropertyPath
-
addColumn
-
addColumn
-
setupEmptyDataProvider
protected void setupEmptyDataProvider() -
addColumnInternal
-
getValueProvider
protected com.vaadin.flow.function.ValueProvider<E,?> getValueProvider(MetaPropertyPath metaPropertyPath) -
initColumn
-
onSelectionChange
-
onSelectionModelChange
-
attachSelectionListener
protected void attachSelectionListener() -
detachSelectionListener
protected void detachSelectionListener() -
getSelectionModel
-
onColumnReorderChange
-
restoreColumnsOrder
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
-
getEmptyStateText
-
setEmptyStateText
-
getEmptyStateComponent
public com.vaadin.flow.component.Component getEmptyStateComponent() -
setEmptyStateComponent
public void setEmptyStateComponent(com.vaadin.flow.component.Component emptyStateComponent) -
setEmptyStateTextDelegate
-
setEmptyStateComponentDelegate
public void setEmptyStateComponentDelegate(Consumer<com.vaadin.flow.component.Component> emptyStateComponentDelegate) -
updateEmptyState
protected void updateEmptyState() -
setupEmptyStateByPermissionComponent
protected void setupEmptyStateByPermissionComponent() -
initEmptyStateByPermissionsComponent
protected void initEmptyStateByPermissionsComponent() -
getColumns
-
getColumnByKey
-
removeColumn
-
isDataGridOwner
-
setColumnPosition
-
getAggregatableDelegate
-
getAfterColumnSecurityApplyHandler
@Nullable public Consumer<AbstractGroupGridDelegate.ColumnSecurityContext<E>> getAfterColumnSecurityApplyHandler() -
setAfterColumnSecurityApplyHandler
public void setAfterColumnSecurityApplyHandler(@Nullable Consumer<AbstractGroupGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler) -
createEditor
-
onItemDoubleClick
-
fireItemDoubleClick
-
handleEnterPress
protected void handleEnterPress() -
handleDoubleClickAction
-
findEnterAction
-
onGridEditorClose
-