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
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • metadataTools

      protected MetadataTools metadataTools
    • messageTools

      protected MessageTools messageTools
    • uiComponents

      protected UiComponents uiComponents
    • accessManager

      protected AccessManager accessManager
    • aggregations

      protected Aggregations aggregations
    • aggregatableDelegate

      protected AggregatableDelegate<Object> aggregatableDelegate
    • dataGridItems

      protected ITEMS extends DataGridItems<E> 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

      protected Set<com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>,E>> selectionListeners
    • itemDoubleClickListeners

      protected Set<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemDoubleClickEvent<E>>> itemDoubleClickListeners
    • enterPressHandler

      protected Consumer<SupportsEnterPress.EnterPressEvent<C extends com.vaadin.flow.component.grid.Grid<E> & ListDataComponent<E> & EnhancedDataGrid<E> & HasActions>> enterPressHandler
    • afterColumnSecurityApplyHandler

      protected Consumer<AbstractGridDelegate.ColumnSecurityContext<E>> afterColumnSecurityApplyHandler
    • aggregatable

      protected boolean aggregatable
    • aggregationPosition

      protected EnhancedDataGrid.AggregationPosition aggregationPosition
    • aggregationMap

      protected Map<com.vaadin.flow.component.grid.Grid.Column<E>,AggregationInfo> aggregationMap
    • aggregationHeader

      protected com.vaadin.flow.component.grid.HeaderRow aggregationHeader
    • aggregationFooter

      protected com.vaadin.flow.component.grid.FooterRow aggregationFooter
    • propertyColumns

      protected Map<com.vaadin.flow.component.grid.Grid.Column<E>,MetaPropertyPath> propertyColumns
      Columns that are bounded with data container (loaded from descriptor or added using addColumn(String, MetaPropertyPath)).
    • columns

      protected List<com.vaadin.flow.component.grid.Grid.Column<E>> 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

      public AbstractGridDelegate(C component)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent()
    • getItems

      @Nullable public ITEMS getItems()
    • setItems

      public void setItems(@Nullable ITEMS dataGridItems)
    • bind

      protected void bind(DataGridItems<E> dataGridItems)
    • unbind

      protected void unbind()
    • itemsItemSetChanged

      protected void itemsItemSetChanged(DataGridItems.ItemSetChangeEvent<E> event)
    • closeEditorIfOpened

      protected void closeEditorIfOpened()
    • refreshSelection

      protected void refreshSelection(Collection<E> items)
      Refreshes current selection using provided items.
    • itemsValueChanged

      protected void itemsValueChanged(DataGridItems.ValueChangeEvent<E> event)
    • itemIsBeingEdited

      protected boolean itemIsBeingEdited(E item)
    • getSingleSelectedItem

      @Nullable public E getSingleSelectedItem()
    • getSelectedItems

      public Set<E> getSelectedItems()
    • select

      public void select(E item)
    • select

      public void select(Collection<E> items)
    • deselect

      public void deselect(E item)
    • deselectAll

      public void deselectAll()
    • isMultiSelect

      public boolean isMultiSelect()
    • enableMultiSelect

      public void enableMultiSelect()
    • setMultiSelect

      public void setMultiSelect(boolean multiSelect)
    • addSelectionListener

      public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>,E> listener)
    • addItemDoubleClickListener

      public com.vaadin.flow.shared.Registration addItemDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.grid.ItemDoubleClickEvent<E>> listener)
    • setEnterPressHandler

      public void setEnterPressHandler(@Nullable Consumer<SupportsEnterPress.EnterPressEvent<C>> handler)
    • isAggregatable

      public boolean isAggregatable()
    • setAggregatable

      public void setAggregatable(boolean aggregatable)
    • getAggregationPosition

      public EnhancedDataGrid.AggregationPosition getAggregationPosition()
    • setAggregationPosition

      public void setAggregationPosition(EnhancedDataGrid.AggregationPosition position)
    • addAggregationInfo

      public void addAggregationInfo(com.vaadin.flow.component.grid.Grid.Column<E> column, AggregationInfo info)
    • removeAggregationInfo

      public void removeAggregationInfo(com.vaadin.flow.component.grid.Grid.Column<E> column)
    • getAggregationResults

      public Map<com.vaadin.flow.component.grid.Grid.Column<E>,Object> getAggregationResults()
    • aggregate

      protected Map<com.vaadin.flow.component.grid.Grid.Column<E>,String> aggregate()
    • aggregateValues

      protected Map<com.vaadin.flow.component.grid.Grid.Column<E>,Object> aggregateValues()
    • convertAggregationKeyMapToColumnMap

      protected <V> Map<com.vaadin.flow.component.grid.Grid.Column<E>,V> convertAggregationKeyMapToColumnMap(Map<AggregationInfo,V> aggregationInfos)
    • getAggregationInfos

      protected List<AggregationInfo> getAggregationInfos()
    • checkAggregation

      protected boolean checkAggregation(AggregationInfo aggregationInfo)
    • fillAggregationRow

      protected void fillAggregationRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>,String> values)
    • fillHeaderRow

      protected void fillHeaderRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>,String> values)
    • fillFooterRow

      protected void fillFooterRow(Map<com.vaadin.flow.component.grid.Grid.Column<E>,String> values)
    • updateAggregationRow

      protected void updateAggregationRow()
    • getDefaultColumnFactory

      public BiFunction<com.vaadin.flow.data.renderer.Renderer<E>,String,com.vaadin.flow.component.grid.Grid.Column<E>> getDefaultColumnFactory()
    • getColumnMetaPropertyPath

      @Nullable public MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<E> column)
    • addColumn

      public DataGridColumn<E> addColumn(String key, MetaPropertyPath metaPropertyPath)
    • addColumn

      public DataGridColumn<E> addColumn(com.vaadin.flow.component.grid.Grid.Column<E> column)
    • 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

      protected void onSelectionChange(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>,E> event)
    • onSelectionModelChange

      public void onSelectionModelChange(com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<E>,E> selectionModel)
    • attachSelectionListener

      protected void attachSelectionListener()
    • detachSelectionListener

      protected void detachSelectionListener()
    • getSelectionModel

      protected com.vaadin.flow.component.grid.GridSelectionModel<E> getSelectionModel()
    • onColumnReorderChange

      protected void onColumnReorderChange(com.vaadin.flow.component.grid.ColumnReorderEvent<E> event)
    • 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

      protected List<com.vaadin.flow.component.grid.Grid.Column<E>> deleteHiddenColumns(List<com.vaadin.flow.component.grid.Grid.Column<E>> allColumns)
    • onSort

      protected void onSort(com.vaadin.flow.data.event.SortEvent<com.vaadin.flow.component.grid.Grid<E>,com.vaadin.flow.component.grid.GridSortOrder<E>> event)
    • notifyDataProviderSelectionChanged

      protected void notifyDataProviderSelectionChanged(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<E>,E> ignore)
    • applySecurityToPropertyColumns

      protected void applySecurityToPropertyColumns()
    • isPropertyEnabledBySecurity

      public boolean isPropertyEnabledBySecurity(MetaPropertyPath mpp)
    • getColumns

      public List<com.vaadin.flow.component.grid.Grid.Column<E>> getColumns()
    • getColumnByKey

      @Nullable public DataGridColumn<E> getColumnByKey(String key)
    • removeColumn

      public void removeColumn(com.vaadin.flow.component.grid.Grid.Column<E> column)
    • isDataGridOwner

      public boolean isDataGridOwner(com.vaadin.flow.component.grid.Grid.Column<E> column)
    • setColumnPosition

      public void setColumnPosition(com.vaadin.flow.component.grid.Grid.Column<E> column, int index)
    • getAggregatableDelegate

      protected AggregatableDelegate<Object> 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

      protected void handleDoubleClickAction(@Nullable E item)
    • findEnterAction

      @Nullable protected Action findEnterAction()