Interface AdvancedFilterable
- All Known Subinterfaces:
EntityContainer<T>,HierarchicalEntityContainer<T>
- All Known Implementing Classes:
AdvancedFilterableSupport,JPAContainer
public interface AdvancedFilterable
Container that supports a bit more advanced filtering than
Container.Filterable
. It has been designed to be used explicitly with JPA.- Since:
- 1.0
- Author:
- Petter Holmström (Vaadin Ltd)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThis event indicates that the filters of aAdvancedFilterablehave been applied. -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the filters to the data, possibly causing the items in the container to change.Gets the list of filters that are currently applied.Gets the IDs of all the properties that are filterable.Gets the list of filters to apply.booleanChecks if there are filters that have not yet been applied, or applied filters that have been removed usingorinvalid reference
#removeAllFilters().invalid reference
#removeFilter(com.vaadin.addon.jpacontainer.Filter)booleanReturns whether the filters should be applied immediately when a filter is added or removed.booleanisFilterable(Object propertyId) Checks ifpropertyIdis filterable.voidsetApplyFiltersImmediately(boolean applyFiltersImmediately) Sets whether the filters should be applied immediately when a filter is added or removed.
-
Method Details
-
getFilterablePropertyIds
Collection<Object> getFilterablePropertyIds()Gets the IDs of all the properties that are filterable.- Returns:
- an unmodifiable collection of property IDs (never null).
-
isFilterable
Checks ifpropertyIdis filterable.- Parameters:
propertyId- the property ID to check (must not be null).- Returns:
- true if the property is filterable, false otherwise.
-
getFilters
List<Container.Filter> getFilters()Gets the list of filters to apply. The filters will be applied as a conjunction (i.e. AND) in the order they appear in.- Returns:
- an unmodifiable list of filters (never null).
-
getAppliedFilters
List<Container.Filter> getAppliedFilters()Gets the list of filters that are currently applied. IfisApplyFiltersImmediately()returns true, this list will be the same as the one returned bygetFilters().- Returns:
- an unmodifiable list of filters (never null).
-
setApplyFiltersImmediately
void setApplyFiltersImmediately(boolean applyFiltersImmediately) Sets whether the filters should be applied immediately when a filter is added or removed.- Parameters:
applyFiltersImmediately- true to apply filters immediately, false to apply whenapplyFilters()is called.- See Also:
-
isApplyFiltersImmediately
boolean isApplyFiltersImmediately()Returns whether the filters should be applied immediately when a filter is added or removed. Default is true. If false,applyFilters()has to be called to apply the filters and update the container.- Returns:
- true if the filters are applied immediately, false otherwise.
- See Also:
-
applyFilters
void applyFilters()Applies the filters to the data, possibly causing the items in the container to change.- See Also:
-
hasUnappliedFilters
boolean hasUnappliedFilters()Checks if there are filters that have not yet been applied, or applied filters that have been removed usingorinvalid reference
#removeAllFilters().invalid reference
#removeFilter(com.vaadin.addon.jpacontainer.Filter)If
isApplyFiltersImmediately()is true, this method always returns false.- Returns:
- true if there are unapplied filters, false otherwise.
- See Also:
-