Package io.jmix.ui.component.data.table
Class ContainerTableItems<E>
java.lang.Object
io.jmix.ui.component.data.table.ContainerTableItems<E>
- All Implemented Interfaces:
DataUnit
,ContainerDataUnit<E>
,EntityDataUnit
,EntityTableItems<E>
,TableItems<E>
,TableItems.Ordered<E>
,TableItems.Sortable<E>
- Direct Known Subclasses:
ContainerGroupTableItems
,ContainerTreeTableItems
public class ContainerTableItems<E>
extends Object
implements EntityTableItems<E>, TableItems.Sortable<E>, ContainerDataUnit<E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.data.DataUnit
DataUnit.StateChangeEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.data.TableItems
TableItems.ItemSetChangeEvent<T>, TableItems.Ordered<T>, TableItems.SelectedItemChangeEvent<T>, TableItems.Sortable<T>, TableItems.ValueChangeEvent<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected AggregatableDelegate
protected CollectionContainer<E>
protected EventHub
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRegisters a new item set change listener.Registers a new selected item change listener.Registers a new state change listener.addValueChangeListener
(Consumer<TableItems.ValueChangeEvent<E>> listener) Registers a new value change listener.protected void
protected void
protected void
boolean
containsId
(Object itemId) protected Sort
createSort
(Object[] propertyId, boolean[] ascending) void
Collection<?>
getItems()
getItemValue
(Object itemId, MetaPropertyPath propertyId) getState()
Class<?>
boolean
Tests if the Item corresponding to the given Item ID is the first item.boolean
Tests if the item corresponding to the given item ID is the last item.nextItemId
(Object itemId) Gets the ID of the item following the Item that corresponds toitemId
.prevItemId
(Object itemId) Gets the ID of the item preceding the item that corresponds toitemId
.void
Resets sort order.void
setSelectedItem
(E item) Set current item in the source.int
size()
void
Sorts data.boolean
supportsProperty
(Object propertyId) void
void
updateItem
(E item) Update an item in the collection if it is already there.
-
Field Details
-
container
-
aggregatableDelegate
-
suppressSorting
protected boolean suppressSorting -
events
-
-
Constructor Details
-
ContainerTableItems
-
-
Method Details
-
getContainer
- Specified by:
getContainer
in interfaceContainerDataUnit<E>
-
containerItemChanged
-
containerCollectionChanged
-
containerItemPropertyChanged
-
getItemIds
- Specified by:
getItemIds
in interfaceTableItems<E>
-
getItems
- Specified by:
getItems
in interfaceTableItems<E>
- Returns:
- unmodifiable collection of items
-
getItem
- Specified by:
getItem
in interfaceTableItems<E>
-
getItemNN
- Specified by:
getItemNN
in interfaceTableItems<E>
-
updateItem
Description copied from interface:TableItems
Update an item in the collection if it is already there.- Specified by:
updateItem
in interfaceTableItems<E>
- Parameters:
item
- the item to update
-
getItemValue
- Specified by:
getItemValue
in interfaceTableItems<E>
-
size
public int size()- Specified by:
size
in interfaceTableItems<E>
-
containsId
- Specified by:
containsId
in interfaceTableItems<E>
-
getState
-
getType
- Specified by:
getType
in interfaceTableItems<E>
-
supportsProperty
- Specified by:
supportsProperty
in interfaceTableItems<E>
-
getSelectedItem
- Specified by:
getSelectedItem
in interfaceEntityTableItems<E>
- Returns:
- the current item contained in the source
-
setSelectedItem
Description copied from interface:EntityTableItems
Set current item in the source.- Specified by:
setSelectedItem
in interfaceEntityTableItems<E>
- Parameters:
item
- the item to set
-
addStateChangeListener
Description copied from interface:DataUnit
Registers a new state change listener.- Specified by:
addStateChangeListener
in interfaceDataUnit
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addValueChangeListener
Description copied from interface:TableItems
Registers a new value change listener.- Specified by:
addValueChangeListener
in interfaceTableItems<E>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addItemSetChangeListener
Description copied from interface:TableItems
Registers a new item set change listener.- Specified by:
addItemSetChangeListener
in interfaceTableItems<E>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addSelectedItemChangeListener
public Subscription addSelectedItemChangeListener(Consumer<TableItems.SelectedItemChangeEvent<E>> listener) Description copied from interface:TableItems
Registers a new selected item change listener.- Specified by:
addSelectedItemChangeListener
in interfaceTableItems<E>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
getEntityMetaClass
- Specified by:
getEntityMetaClass
in interfaceEntityDataUnit
- Returns:
MetaClass
of an entity contained in the source
-
nextItemId
Description copied from interface:TableItems.Ordered
Gets the ID of the item following the Item that corresponds toitemId
.- Specified by:
nextItemId
in interfaceTableItems.Ordered<E>
- Parameters:
itemId
- item id- Returns:
- ID of the next visible Item or
null
-
prevItemId
Description copied from interface:TableItems.Ordered
Gets the ID of the item preceding the item that corresponds toitemId
.- Specified by:
prevItemId
in interfaceTableItems.Ordered<E>
- Parameters:
itemId
- item id- Returns:
- ID of the previous visible item or
null
-
firstItemId
- Specified by:
firstItemId
in interfaceTableItems.Ordered<E>
- Returns:
- ID of the first visible item
-
lastItemId
- Specified by:
lastItemId
in interfaceTableItems.Ordered<E>
- Returns:
- ID of the last visible item
-
isFirstId
Description copied from interface:TableItems.Ordered
Tests if the Item corresponding to the given Item ID is the first item.- Specified by:
isFirstId
in interfaceTableItems.Ordered<E>
- Parameters:
itemId
- item id- Returns:
true
if the item is first visible item,false
if not
-
isLastId
Description copied from interface:TableItems.Ordered
Tests if the item corresponding to the given item ID is the last item.- Specified by:
isLastId
in interfaceTableItems.Ordered<E>
- Parameters:
itemId
- item id- Returns:
true
if the item is last visible item in the,false
if not
-
sort
Description copied from interface:TableItems.Sortable
Sorts data.- Specified by:
sort
in interfaceTableItems.Sortable<E>
- Parameters:
propertyId
- id of propertyascending
- asc / desc flags
-
createSort
-
resetSortOrder
public void resetSortOrder()Description copied from interface:TableItems.Sortable
Resets sort order.- Specified by:
resetSortOrder
in interfaceTableItems.Sortable<E>
-
suppressSorting
public void suppressSorting()- Specified by:
suppressSorting
in interfaceTableItems.Sortable<E>
-
enableSorting
public void enableSorting()- Specified by:
enableSorting
in interfaceTableItems.Sortable<E>
-