com.vaadin.addon.jpacontainer
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 Filterable . It has been designed to be used explicitly with JPA.

Since:
1.0
Author:
Petter Holmström (Vaadin Ltd)

Nested Class Summary
static class AdvancedFilterable.FiltersAppliedEvent<C extends com.vaadin.data.Container & AdvancedFilterable>
          This event indicates that the filters of a AdvancedFilterable have been applied.
 
Method Summary
 void applyFilters()
          Applies the filters to the data, possibly causing the items in the container to change.
 List<com.vaadin.data.Container.Filter> getAppliedFilters()
          Gets the list of filters that are currently applied.
 Collection<Object> getFilterablePropertyIds()
          Gets the IDs of all the properties that are filterable.
 List<com.vaadin.data.Container.Filter> getFilters()
          Gets the list of filters to apply.
 boolean hasUnappliedFilters()
          Checks if there are filters that have not yet been applied, or applied filters that have been removed using #removeAllFilters() or #removeFilter(com.vaadin.addon.jpacontainer.Filter) .
 boolean isApplyFiltersImmediately()
          Returns whether the filters should be applied immediately when a filter is added or removed.
 boolean isFilterable(Object propertyId)
          Checks if propertyId is filterable.
 void setApplyFiltersImmediately(boolean applyFiltersImmediately)
          Sets whether the filters should be applied immediately when a filter is added or removed.
 

Method Detail

getFilterablePropertyIds

Collection<Object> getFilterablePropertyIds()
Gets the IDs of all the properties that are filterable.

Returns:
an unmodifiable collection of property IDs (never null).

isFilterable

boolean isFilterable(Object propertyId)
Checks if propertyId is filterable.

Parameters:
propertyId - the property ID to check (must not be null).
Returns:
true if the property is filterable, false otherwise.

getFilters

List<com.vaadin.data.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<com.vaadin.data.Container.Filter> getAppliedFilters()
Gets the list of filters that are currently applied. If isApplyFiltersImmediately() returns true, this list will be the same as the one returned by getFilters().

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 when applyFilters() is called.
See Also:
isApplyFiltersImmediately()

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:
setApplyFiltersImmediately(boolean)

applyFilters

void applyFilters()
Applies the filters to the data, possibly causing the items in the container to change.

See Also:
AdvancedFilterable.FiltersAppliedEvent

hasUnappliedFilters

boolean hasUnappliedFilters()
Checks if there are filters that have not yet been applied, or applied filters that have been removed using #removeAllFilters() or #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:
applyFilters()


Copyright © 2013 Vaadin Ltd. All rights reserved.