Interface Container.Sortable
- All Superinterfaces:
Container,Container.Ordered,Serializable
- All Known Subinterfaces:
EntityContainer<T>,HierarchicalEntityContainer<T>
- All Known Implementing Classes:
AbstractBeanContainer,BeanContainer,BeanItemContainer,IndexedContainer,JPAContainer
- Enclosing interface:
Container
Items can be sorted.
When an Container.Ordered or Container.Indexed container is sorted, all
relevant operations of these interfaces should only use the filtered and
sorted contents and the filtered indices to the container. Indices or
item identifiers in the public API refer to the visible view unless
otherwise stated. However, the addItem*() methods may add
items that will be filtered out after addition or moved to another
position based on sorting.
How sorting is performed when a Container.Hierarchical container implements
Container.Sortable is implementation specific and should be documented in
the implementing class. However, the recommended approach is sorting the
roots and the sets of children of each item separately.
Depending on the container type, sorting a container may permanently change the internal order of items in the container.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Container
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer -
Method Summary
Modifier and TypeMethodDescriptionCollection<?> Gets the container property IDs which can be used to sort the items.voidSorts the container items.Methods inherited from interface com.vaadin.featurepack.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, sizeMethods inherited from interface com.vaadin.featurepack.data.Container.Ordered
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
-
Method Details
-
sort
Sorts the container items.Sorting a container can irreversibly change the order of its items or only change the order temporarily, depending on the container.
- Parameters:
propertyId- Array of container property IDs, whose values are used to sort the items in container as primary, secondary, ... sorting criterion. All of the item IDs must be in the collection returned bygetSortableContainerPropertyIds()ascending- Array of sorting order flags corresponding to each property ID used in sorting. If this array is shorter than propertyId array, ascending order is assumed for items where the order is not specified. Usetrueto sort in ascending order,falseto use descending order.
-
getSortableContainerPropertyIds
Collection<?> getSortableContainerPropertyIds()Gets the container property IDs which can be used to sort the items.- Returns:
- the IDs of the properties that can be used for sorting the container
-