Interface Container.Filterable
- All Superinterfaces:
Container,Serializable
- All Known Subinterfaces:
EntityContainer<T>,HierarchicalEntityContainer<T>
- All Known Implementing Classes:
AbstractBeanContainer,BeanContainer,BeanItemContainer,IndexedContainer,JPAContainer
- Enclosing interface:
Container
When a set of filters are set, only items that match all the filters are included in the visible contents of the container. Still new items that do not match filters can be added to the container. Multiple filters can be added and the container remembers the state of the filters. When multiple filters are added, all filters must match for an item to be visible in the container.
When an Container.Ordered or Container.Indexed container is filtered, all
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 filtering is performed when a Container.Hierarchical container
implements Container.Filterable is implementation specific and should be
documented in the implementing class.
Adding items (if supported) to a filtered Container.Ordered or
Container.Indexed container should insert them immediately after the
indicated visible item. However, the unfiltered position of items added
at index 0, at index Container.size() or at an undefined position
is up to the implementation.
This API replaces the old Filterable interface, renamed to
Container.SimpleFilterable in Vaadin 6.6.
- Since:
- 6.6
-
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 TypeMethodDescriptionvoidaddContainerFilter(Container.Filter filter) Adds a filter for the container.Returns the filters which have been applied to the containervoidRemove all active filters from the container.voidRemoves a filter from the container.Methods inherited from interface com.vaadin.featurepack.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size
-
Method Details
-
addContainerFilter
Adds a filter for the container.If a container has multiple filters, only items accepted by all filters are visible.
- Throws:
UnsupportedFilterException- if the filter is not supported by the container
-
removeContainerFilter
Removes a filter from the container.This requires that the equals() method considers the filters as equivalent (same instance or properly implemented equals() method).
-
removeAllContainerFilters
void removeAllContainerFilters()Remove all active filters from the container. -
getContainerFilters
Collection<Container.Filter> getContainerFilters()Returns the filters which have been applied to the container- Returns:
- A collection of filters which have been applied to the container. An empty collection if no filters have been applied.
- Since:
- 7.1
-