public static interface Container.SimpleFilterable extends Container, Serializable
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.
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| Modifier and Type | Method and Description |
|---|---|
void |
addContainerFilter(Object propertyId,
String filterString,
boolean ignoreCase,
boolean onlyMatchPrefix)
Add a filter for given property.
|
void |
removeAllContainerFilters()
Remove all filters from all properties.
|
void |
removeContainerFilters(Object propertyId)
Remove all filters from the given property.
|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, sizevoid addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix)
The API Filterable#addContainerFilter(Filter) is recommended
instead of this method. A SimpleStringFilter can 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.
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.void removeAllContainerFilters()
void removeContainerFilters(Object propertyId)
propertyId - for which to remove filtersCopyright © 2023 Vaadin Ltd. All rights reserved.