Interface Container.SimpleFilterable
- All Superinterfaces:
Container,Serializable
- All Known Implementing Classes:
AbstractBeanContainer,BeanContainer,BeanItemContainer,IndexedContainer
- Enclosing interface:
Container
Container.Filterable, and implementing the new
Container.Filterable instead of or in addition to Container.SimpleFilterable
is recommended. This interface might be removed in future Vaadin
versions.
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 contents and
the filtered indices to the container.
How filtering is performed when a Container.Hierarchical container
implements Container.SimpleFilterable 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. The unfiltered position of items added at index
0, at index Container.size() or at an undefined position is up to
the implementation.
The functionality of SimpleFilterable can be implemented using the
Container.Filterable API and SimpleStringFilter.
- Since:
- 5.0 (renamed from Filterable to SimpleFilterable in 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(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix) Add a filter for given property.voidRemove all filters from all properties.voidremoveContainerFilters(Object propertyId) Remove all filters from the given property.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
void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix) Add a filter for given property.The API
Container.Filterable.addContainerFilter(Filter)is recommended instead of this method. ASimpleStringFiltercan be used with the new API to implement the old string filtering functionality.The filter accepts items for which toString() of the value of the given property contains or starts with given filterString. Other items are not visible in the container when filtered.
If a container has multiple filters, only items accepted by all filters are visible.
- Parameters:
propertyId- Property for which the filter is applied to.filterString- String that must match the value of the propertyignoreCase- Determine if the casing can be ignored when comparing strings.onlyMatchPrefix- Only match prefixes; no other matches are included.
-
removeAllContainerFilters
void removeAllContainerFilters()Remove all filters from all properties. -
removeContainerFilters
Remove all filters from the given property.- Parameters:
propertyId- for which to remove filters
-