public class ContainerGroupTableItems<E extends Entity<K>,K> 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<K>> |
groupItems |
protected java.lang.Object[] |
groupProperties |
protected boolean |
isGrouping |
protected java.util.Map<K,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<K> |
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,
MetaPropertyPath property) |
void |
groupBy(java.lang.Object[] properties)
Perform grouping by the list of properties
|
protected GroupInfo<MetaPropertyPath> |
groupItems(int propertyIndex,
GroupInfo parent,
java.util.List<GroupInfo> children,
E item,
org.apache.commons.collections4.map.LinkedMap<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, aggregate, aggregateValues, containerCollectionChanged, containerItemChanged, containerItemPropertyChanged, containsId, createAggregatableDelegate, 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 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 extends Entity<K>>
sort
in class ContainerTableItems<E extends Entity<K>>
propertyId
- id of propertyascending
- asc / desc flagspublic void groupBy(java.lang.Object[] properties)
GroupTableItems
groupBy
in interface GroupTableItems<E extends Entity<K>>
protected void doGroup()
protected GroupInfo<MetaPropertyPath> groupItems(int propertyIndex, GroupInfo parent, java.util.List<GroupInfo> children, E item, org.apache.commons.collections4.map.LinkedMap<MetaPropertyPath,java.lang.Object> groupValues)
protected java.lang.Object getValueByProperty(E item, MetaPropertyPath property)
public java.util.List<GroupInfo> rootGroups()
rootGroups
in interface GroupTableItems<E extends Entity<K>>
public boolean hasChildren(GroupInfo groupId)
GroupTableItems
hasChildren
in interface GroupTableItems<E extends Entity<K>>
public java.util.List<GroupInfo> getChildren(GroupInfo groupId)
getChildren
in interface GroupTableItems<E extends Entity<K>>
public java.util.List<E> getOwnChildItems(GroupInfo groupId)
getOwnChildItems
in interface GroupTableItems<E extends Entity<K>>
public java.util.List<E> getChildItems(GroupInfo groupId)
getChildItems
in interface GroupTableItems<E extends Entity<K>>
@Nullable public GroupInfo getParentGroup(E item)
getParentGroup
in interface GroupTableItems<E extends Entity<K>>
public java.util.List<GroupInfo> getGroupPath(E item)
getGroupPath
in interface GroupTableItems<E extends Entity<K>>
public java.lang.Object getGroupProperty(GroupInfo groupId)
getGroupProperty
in interface GroupTableItems<E extends Entity<K>>
public java.lang.Object getGroupPropertyValue(GroupInfo groupId)
getGroupPropertyValue
in interface GroupTableItems<E extends Entity<K>>
public java.util.Collection<K> getGroupItemIds(GroupInfo groupId)
getGroupItemIds
in interface GroupTableItems<E extends Entity<K>>
public int getGroupItemsCount(GroupInfo groupId)
getGroupItemsCount
in interface GroupTableItems<E extends Entity<K>>
public boolean hasGroups()
GroupTableItems
hasGroups
in interface GroupTableItems<E extends Entity<K>>
public java.util.Collection<?> getGroupProperties()
getGroupProperties
in interface GroupTableItems<E extends Entity<K>>
public boolean containsGroup(GroupInfo groupId)
GroupTableItems
containsGroup
in interface GroupTableItems<E extends Entity<K>>