com.vaadin.data.
Interface Container.SimpleFilterable
-
All Superinterfaces:
All Known Implementing Classes:
AbstractBeanContainer, BeanContainer, BeanItemContainer, HierarchicalContainer, IndexedContainer
Enclosing interface:
public static interface Container.SimpleFilterable extends Container, Serializable
Interface that is implemented by containers which allow reducing their visible contents based on a set of filters. This interface has been renamed from
Container.Filterable
, and implementing the newContainer.Filterable
instead of or in addition toContainer.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
orContainer.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 implementsContainer.SimpleFilterable
is implementation specific and should be documented in the implementing class.Adding items (if supported) to a filtered
Container.Ordered
orContainer.Indexed
container should insert them immediately after the indicated visible item. The unfiltered position of items added at index 0, at indexContainer.size()
or at an undefined position is up to the implementation.The functionality of SimpleFilterable can be implemented using the
Container.Filterable
API andSimpleStringFilter
.Since:
5.0 (renamed from Filterable to SimpleFilterable in 6.6)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.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
All Methods 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.
-
Methods inherited from interface com.vaadin.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size
-
-
-
-
Method Detail
-
addContainerFilter
void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix)
Add a filter for given property.
The API
Filterable#addContainerFilter(Filter)
is recommended instead of this method. ASimpleStringFilter
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.
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
void removeContainerFilters(Object propertyId)
Remove all filters from the given property.
Parameters:
propertyId
- for which to remove filters
-
-