Package io.jmix.ui.component.data
Interface DataGridItems<T>
- Type Parameters:
T
- row item type
- All Superinterfaces:
DataUnit
- All Known Subinterfaces:
DataGridItems.Sortable<T>
,EntityDataGridItems<E>
,TreeDataGridItems<T>
- All Known Implementing Classes:
ContainerDataGridItems
,ContainerTreeDataGridItems
,EmptyDataGridItems
,EmptyTreeDataGridItems
A common interface for providing data for
DataGrid
component.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
An event that is fired when item set is changed.static class
An event that is fired when selected item is changed.static interface
The DataGridItems that supports sorting.static class
An event that is fired when value of item property is changed.Nested classes/interfaces inherited from interface io.jmix.ui.component.data.DataUnit
DataUnit.StateChangeEvent
-
Method Summary
Modifier and TypeMethodDescriptionRegisters a new item set change listener.Registers a new selected item change listener.Registers a new value change listener.boolean
containsItem
(T item) getItemByIndex
(int index) getItems()
getItems
(int startIndex, int numberOfItems) getItemValue
(Object itemId, MetaPropertyPath propertyId) int
indexOfItem
(T item) void
setSelectedItem
(T item) Set current item in the source.int
size()
Methods inherited from interface io.jmix.ui.component.data.DataUnit
addStateChangeListener, getState
-
Method Details
-
getItemId
- Parameters:
item
- the item for obtaining the id- Returns:
- the id on the given item
-
getItem
- Parameters:
itemId
- the item id- Returns:
- the item by the given id
-
getItemValue
- Parameters:
itemId
- the item idpropertyId
- the property id- Returns:
- the item value
-
indexOfItem
- Parameters:
item
- the item for obtaining the index- Returns:
- the index of the given item
-
getItemByIndex
- Parameters:
index
- the item index- Returns:
- the item by the given index
-
getItems
- Returns:
- the stream of all items
-
getItems
- Parameters:
startIndex
- the start indexnumberOfItems
- the number of items- Returns:
- items from the
startIndex
and size not exceeding the specified number
-
containsItem
- Parameters:
item
- an item to check- Returns:
true
if the underlying collection contains an item,false
otherwise
-
size
int size()- Returns:
- size of the underlying collection
-
getSelectedItem
- Returns:
- the current item contained in the source
-
setSelectedItem
Set current item in the source.- Parameters:
item
- the item to set
-
addValueChangeListener
Registers a new value change listener.- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addItemSetChangeListener
Registers a new item set change listener.- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addSelectedItemChangeListener
Subscription addSelectedItemChangeListener(Consumer<DataGridItems.SelectedItemChangeEvent<T>> listener) Registers a new selected item change listener.- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-