public class ContainerGroupTableItems<E> extends ContainerTableItems<E> implements GroupTableItems<E>
TableItems.ItemSetChangeEvent<T>, TableItems.Ordered<T>, TableItems.SelectedItemChangeEvent<T>, TableItems.Sortable<T>, TableItems.ValueChangeEvent<T>
DataUnit.StateChangeEvent
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<GroupInfo,java.util.List<GroupInfo>> |
children |
protected java.util.Map<GroupInfo,java.util.List<?>> |
groupItems |
protected java.lang.Object[] |
groupProperties |
protected boolean |
isGrouping |
protected java.util.Map<java.lang.Object,GroupInfo> |
itemGroups |
protected java.util.Map<GroupInfo,GroupInfo> |
parents |
protected java.util.List<GroupInfo> |
roots |
protected boolean[] |
sortAscending |
protected java.lang.Object[] |
sortProperties |
aggregatableDelegate, container, events, suppressSorting
Constructor and Description |
---|
ContainerGroupTableItems(CollectionContainer<E> container) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsGroup(GroupInfo groupId)
Indicates that a group is contained in the groups tree
|
protected void |
doGroup() |
java.util.List<E> |
getChildItems(GroupInfo groupId) |
java.util.List<GroupInfo> |
getChildren(GroupInfo groupId) |
java.util.List<GroupInfo> |
getChildrenInternal(GroupInfo groupId) |
java.util.Collection |
getGroupItemIds(GroupInfo groupId) |
int |
getGroupItemsCount(GroupInfo groupId) |
java.util.List<GroupInfo> |
getGroupPath(E item) |
java.util.Collection<?> |
getGroupProperties() |
java.lang.Object |
getGroupProperty(GroupInfo groupId) |
java.lang.Object |
getGroupPropertyValue(GroupInfo groupId) |
java.util.List<E> |
getOwnChildItems(GroupInfo groupId) |
GroupInfo |
getParentGroup(E item) |
protected java.lang.Object |
getValueByProperty(E item,
io.jmix.core.metamodel.model.MetaPropertyPath property) |
void |
groupBy(java.lang.Object[] properties)
Perform grouping by the list of properties
|
protected GroupInfo<io.jmix.core.metamodel.model.MetaPropertyPath> |
groupItems(int propertyIndex,
GroupInfo parent,
java.util.List<GroupInfo> children,
E item,
org.apache.commons.collections4.map.LinkedMap<io.jmix.core.metamodel.model.MetaPropertyPath,java.lang.Object> groupValues) |
boolean |
hasChildren(GroupInfo groupId)
Indicates that group has nested groups
|
boolean |
hasGroups()
Indicated that a datasource has groups
|
java.util.List<GroupInfo> |
rootGroups() |
void |
sort(java.lang.Object[] propertyId,
boolean[] ascending)
Sorts data.
|
addItemSetChangeListener, addSelectedItemChangeListener, addStateChangeListener, addValueChangeListener, containerCollectionChanged, containerItemChanged, containerItemPropertyChanged, containsId, createSort, enableSorting, firstItemId, getContainer, getEntityMetaClass, getItem, getItemIds, getItemNN, getItems, getItemValue, getSelectedItem, getState, getType, isFirstId, isLastId, lastItemId, nextItemId, prevItemId, resetSortOrder, setSelectedItem, size, supportsProperty, suppressSorting, updateItem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enableSorting, resetSortOrder, suppressSorting
firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
addItemSetChangeListener, addSelectedItemChangeListener, addValueChangeListener, containsId, getItem, getItemIds, getItemNN, getItems, getItemValue, getType, size, supportsProperty, updateItem
addStateChangeListener, getState
protected java.lang.Object[] groupProperties
protected java.util.List<GroupInfo> roots
protected java.util.Map<GroupInfo,java.util.List<?>> groupItems
protected java.util.Map<java.lang.Object,GroupInfo> itemGroups
protected boolean isGrouping
protected java.lang.Object[] sortProperties
protected boolean[] sortAscending
public ContainerGroupTableItems(CollectionContainer<E> container)
public void sort(java.lang.Object[] propertyId, boolean[] ascending)
TableItems.Sortable
sort
in interface TableItems.Sortable<E>
sort
in class ContainerTableItems<E>
propertyId
- id of propertyascending
- asc / desc flagspublic void groupBy(@Nullable java.lang.Object[] properties)
GroupTableItems
groupBy
in interface GroupTableItems<E>
protected void doGroup()
@Nullable protected GroupInfo<io.jmix.core.metamodel.model.MetaPropertyPath> groupItems(int propertyIndex, @Nullable GroupInfo parent, java.util.List<GroupInfo> children, E item, org.apache.commons.collections4.map.LinkedMap<io.jmix.core.metamodel.model.MetaPropertyPath,java.lang.Object> groupValues)
@Nullable protected java.lang.Object getValueByProperty(E item, io.jmix.core.metamodel.model.MetaPropertyPath property)
public java.util.List<GroupInfo> rootGroups()
rootGroups
in interface GroupTableItems<E>
public boolean hasChildren(GroupInfo groupId)
GroupTableItems
hasChildren
in interface GroupTableItems<E>
public java.util.List<GroupInfo> getChildren(GroupInfo groupId)
getChildren
in interface GroupTableItems<E>
public java.util.List<E> getOwnChildItems(GroupInfo groupId)
getOwnChildItems
in interface GroupTableItems<E>
public java.util.List<E> getChildItems(GroupInfo groupId)
getChildItems
in interface GroupTableItems<E>
@Nullable public GroupInfo getParentGroup(E item)
getParentGroup
in interface GroupTableItems<E>
public java.util.List<GroupInfo> getGroupPath(E item)
getGroupPath
in interface GroupTableItems<E>
@Nullable public java.lang.Object getGroupProperty(GroupInfo groupId)
getGroupProperty
in interface GroupTableItems<E>
@Nullable public java.lang.Object getGroupPropertyValue(GroupInfo groupId)
getGroupPropertyValue
in interface GroupTableItems<E>
public java.util.Collection getGroupItemIds(GroupInfo groupId)
getGroupItemIds
in interface GroupTableItems<E>
public int getGroupItemsCount(GroupInfo groupId)
getGroupItemsCount
in interface GroupTableItems<E>
public boolean hasGroups()
GroupTableItems
hasGroups
in interface GroupTableItems<E>
public java.util.Collection<?> getGroupProperties()
getGroupProperties
in interface GroupTableItems<E>
public boolean containsGroup(GroupInfo groupId)
GroupTableItems
containsGroup
in interface GroupTableItems<E>