Package io.jmix.flowui.component.grid
Class DataGrid<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<T>
io.jmix.flowui.kit.component.grid.JmixGrid<E>
io.jmix.flowui.component.grid.DataGrid<E>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<E>>
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<E>>
,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<E>>
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.component.HasTheme
,com.vaadin.flow.data.event.SortEvent.SortNotifier<com.vaadin.flow.component.grid.Grid<E>,
,com.vaadin.flow.component.grid.GridSortOrder<E>> com.vaadin.flow.data.provider.HasDataGenerators<E>
,com.vaadin.flow.data.provider.HasDataView<E,
,Void, com.vaadin.flow.component.grid.dataview.GridDataView<E>> com.vaadin.flow.data.provider.HasLazyDataView<E,
,Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<E>> com.vaadin.flow.data.provider.HasListDataView<E,
,com.vaadin.flow.component.grid.dataview.GridListDataView<E>> EnhancedDataGrid<E>
,ListDataComponent<E>
,LookupComponent<E>
,LookupComponent.MultiSelectLookupComponent<E>
,HasActions
,SelectionChangeNotifier<com.vaadin.flow.component.grid.Grid<E>,
,E> Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
public class DataGrid<E>
extends JmixGrid<E>
implements ListDataComponent<E>, LookupComponent.MultiSelectLookupComponent<E>, EnhancedDataGrid<E>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T extends Object>, com.vaadin.flow.component.grid.Grid.Column<T extends Object>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T extends Object,
U extends com.vaadin.flow.data.provider.ArrayUpdater>, com.vaadin.flow.component.grid.Grid.NestedNullBehavior, com.vaadin.flow.component.grid.Grid.SelectionMode, com.vaadin.flow.component.grid.Grid.UpdateQueue Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
Nested classes/interfaces inherited from interface io.jmix.flowui.component.LookupComponent
LookupComponent.MultiSelectLookupComponent<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected GridDelegate<E>
Fields inherited from class io.jmix.flowui.kit.component.grid.JmixGrid
actionsSupport
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.grid.Grid.Column<E>
addColumn
(MetaPropertyPath metaPropertyPath) Adds column by the meta property path.com.vaadin.flow.component.grid.Grid.Column<E>
addColumn
(String key, MetaPropertyPath metaPropertyPath) Adds column by the meta property path and specified key.com.vaadin.flow.shared.Registration
addSelectionListener
(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) void
protected GridActionsSupport<JmixGrid<E>,
E> protected GridDelegate<E>
void
void
Deselects all selected rows.void
getItems()
Returns a set of items corresponding to the selected rows of this component.Returns an item corresponding to the selected row of this component.protected void
boolean
void
Selects a row of this component for a given item.void
select
(Collection<E> items) Selects the rows of this component for a given collection of items.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) com.vaadin.flow.component.grid.dataview.GridDataView<E>
com.vaadin.flow.component.grid.GridSelectionModel<E>
setSelectionMode
(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) Methods inherited from class io.jmix.flowui.kit.component.grid.JmixGrid
addAction, addAction, getAction, getActions, getActionsSupport, removeAction
Methods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumns, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPropertySet, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isHeightByRows, isMultiSort, isRowsDraggable, isVerticalScrollingEnabled, onAttach, onDataProviderChange, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToStart, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnReorderingAllowed, setColumns, setDataProvider, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setHeightByRows, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setMultiSort, setNestedNullBehavior, setPageSize, setRowsDraggable, setSelectionDragDetails, setSelectionModel, setSortableColumns, setUniqueKeyProperty, setUniqueKeyProvider, setVerticalScrollingEnabled, sort, updateSelectionModeOnClient
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
Methods inherited from interface io.jmix.flowui.kit.component.HasActions
removeAction, removeAllActions
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
gridDelegate
-
-
Constructor Details
-
DataGrid
public DataGrid()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
protected void initComponent() -
createDelegate
-
setItems
-
getSingleSelectedItem
Description copied from interface:ListDataComponent
Returns an item corresponding to the selected row of this component. If nothing is selected, the method returnsnull
. If multiple selection mode is enabled, returns the first selected instance.- Specified by:
getSingleSelectedItem
in interfaceListDataComponent<E>
- Returns:
- an item corresponding to the selected row of this component
-
getSelectedItems
Description copied from interface:ListDataComponent
Returns a set of items corresponding to the selected rows of this component. If nothing is selected, the method returns aCollections.emptySet()
.- Specified by:
getSelectedItems
in interfaceListDataComponent<E>
- Specified by:
getSelectedItems
in interfaceLookupComponent<E>
- Overrides:
getSelectedItems
in classcom.vaadin.flow.component.grid.Grid<E>
- Returns:
- a set of item instances corresponding to the selected rows of
this component, never
null
-
select
Description copied from interface:ListDataComponent
Selects a row of this component for a given item.- Specified by:
select
in interfaceListDataComponent<E>
- Overrides:
select
in classcom.vaadin.flow.component.grid.Grid<E>
- Parameters:
item
- item instance to select the row
-
select
Description copied from interface:ListDataComponent
Selects the rows of this component for a given collection of items.- Specified by:
select
in interfaceListDataComponent<E>
- Parameters:
items
- collection of items to select rows
-
deselect
- Specified by:
deselect
in interfaceListDataComponent<E>
- Overrides:
deselect
in classcom.vaadin.flow.component.grid.Grid<E>
-
deselectAll
public void deselectAll()Description copied from interface:ListDataComponent
Deselects all selected rows.- Specified by:
deselectAll
in interfaceListDataComponent<E>
- Overrides:
deselectAll
in classcom.vaadin.flow.component.grid.Grid<E>
-
getItems
- Specified by:
getItems
in interfaceListDataComponent<E>
- Returns:
- a data unit that holds component items
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelect
in interfaceListDataComponent<E>
- Returns:
true
if multiple selection mode is enabled
-
addSelectionListener
public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<E>, E> listener) - Specified by:
addSelectionListener
in interfaceSelectionChangeNotifier<com.vaadin.flow.component.grid.Grid<E>,
E> - Overrides:
addSelectionListener
in classcom.vaadin.flow.component.grid.Grid<E>
-
enableMultiSelect
public void enableMultiSelect()- Specified by:
enableMultiSelect
in interfaceLookupComponent.MultiSelectLookupComponent<E>
-
setSelectionMode
public com.vaadin.flow.component.grid.GridSelectionModel<E> setSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode) - Overrides:
setSelectionMode
in classcom.vaadin.flow.component.grid.Grid<E>
-
addColumn
Adds column by the meta property path.- Specified by:
addColumn
in interfaceEnhancedDataGrid<E>
- Parameters:
metaPropertyPath
- meta property path to add column- Returns:
- added column
-
addColumn
public com.vaadin.flow.component.grid.Grid.Column<E> addColumn(String key, MetaPropertyPath metaPropertyPath) Adds column by the meta property path and specified key. The key is used to identify the column, seeGrid.getColumnByKey(String)
.- Specified by:
addColumn
in interfaceEnhancedDataGrid<E>
- Parameters:
key
- column keymetaPropertyPath
- meta property path to add column- Returns:
- added column
-
createActionsSupport
- Overrides:
createActionsSupport
in classJmixGrid<E>
-