|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.addon.jpacontainer.filter.util.AdvancedFilterableSupport
public class AdvancedFilterableSupport
Helper class that implements the filtering methods defined in
AdvancedFilterable and can be either extended or used as a delegate.
| Nested Class Summary | |
|---|---|
static interface |
AdvancedFilterableSupport.ApplyFiltersListener
ApplyFiltersListener interface to be implemented by classes that want to be notified when the filters are applied. |
| Nested classes/interfaces inherited from interface com.vaadin.addon.jpacontainer.AdvancedFilterable |
|---|
AdvancedFilterable.FiltersAppliedEvent<C extends com.vaadin.data.Container & AdvancedFilterable> |
| Constructor Summary | |
|---|---|
AdvancedFilterableSupport()
|
|
| Method Summary | ||
|---|---|---|
void |
addFilter(com.vaadin.data.Container.Filter filter)
|
|
void |
addListener(AdvancedFilterableSupport.ApplyFiltersListener listener)
Adds listener to the list of listeners to be notified when
the filters are applied. |
|
void |
applyFilters()
Applies the filters to the data, possibly causing the items in the container to change. |
|
protected void |
fireListeners()
|
|
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. |
|
static javax.persistence.criteria.Path<String> |
getPropertyPath(javax.persistence.criteria.From<?,?> root,
Object propertyId)
|
|
static
|
getPropertyPathTyped(javax.persistence.criteria.From<X,Y> root,
Object propertyId)
|
|
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. |
|
boolean |
isValidFilter(com.vaadin.data.Container.Filter filter)
Checks if filter is a valid filter, i.e. |
|
void |
removeAllFilters()
|
|
void |
removeFilter(com.vaadin.data.Container.Filter filter)
|
|
void |
removeListener(AdvancedFilterableSupport.ApplyFiltersListener listener)
Removes listener from the list of listeners. |
|
void |
setApplyFiltersImmediately(boolean applyFiltersImmediately)
Sets whether the filters should be applied immediately when a filter is added or removed. |
|
void |
setFilterablePropertyIds(Collection<?> propertyIds)
Sets the filterable property IDs. |
|
void |
setFilterablePropertyIds(Object... propertyIds)
Sets the filterable property IDs. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdvancedFilterableSupport()
| Method Detail |
|---|
public void addListener(AdvancedFilterableSupport.ApplyFiltersListener listener)
listener to the list of listeners to be notified when
the filters are applied. The listener will be notified as many times as
it has been added.
listener - the listener to add (must not be null).public void removeListener(AdvancedFilterableSupport.ApplyFiltersListener listener)
listener from the list of listeners. If the listener
has been added more than once, it will be notified one less time. If the
listener has not been added at all, nothing happens.
listener - the listener to remove (must not be null).protected void fireListeners()
public Collection<Object> getFilterablePropertyIds()
AdvancedFilterable
getFilterablePropertyIds in interface AdvancedFilterableAdvancedFilterable.getFilterablePropertyIds()public void setFilterablePropertyIds(Collection<?> propertyIds)
propertyIds - the property IDs to set (must not be null).public void setFilterablePropertyIds(Object... propertyIds)
propertyIds - the property IDs to set (must not be null).public boolean isFilterable(Object propertyId)
AdvancedFilterablepropertyId is filterable.
isFilterable in interface AdvancedFilterablepropertyId - the property ID to check (must not be null).
AdvancedFilterable.isFilterable(java.lang.Object)public boolean isValidFilter(com.vaadin.data.Container.Filter filter)
filter is a valid filter, i.e. that all the
properties that the filter restricts are filterable.
filter - the filter to check (must not be null).
public List<com.vaadin.data.Container.Filter> getFilters()
AdvancedFilterable
getFilters in interface AdvancedFilterableAdvancedFilterable.getFilters()public List<com.vaadin.data.Container.Filter> getAppliedFilters()
AdvancedFilterableAdvancedFilterable.isApplyFiltersImmediately() returns true, this list will be the
same as the one returned by AdvancedFilterable.getFilters().
getAppliedFilters in interface AdvancedFilterableAdvancedFilterable.getAppliedFilters()public void setApplyFiltersImmediately(boolean applyFiltersImmediately)
AdvancedFilterable
setApplyFiltersImmediately in interface AdvancedFilterableapplyFiltersImmediately - true to apply filters immediately, false to apply when
AdvancedFilterable.applyFilters() is called.AdvancedFilterable.setApplyFiltersImmediately(boolean)public boolean isApplyFiltersImmediately()
AdvancedFilterableAdvancedFilterable.applyFilters()
has to be called to apply the filters and update the container.
isApplyFiltersImmediately in interface AdvancedFilterableAdvancedFilterable.isApplyFiltersImmediately()public void applyFilters()
AdvancedFilterable
applyFilters in interface AdvancedFilterableAdvancedFilterable.applyFilters()public boolean hasUnappliedFilters()
AdvancedFilterable#removeAllFilters() or
#removeFilter(com.vaadin.addon.jpacontainer.Filter) .
If AdvancedFilterable.isApplyFiltersImmediately() is true, this method always
returns false.
hasUnappliedFilters in interface AdvancedFilterableAdvancedFilterable.hasUnappliedFilters()
public static javax.persistence.criteria.Path<String> getPropertyPath(javax.persistence.criteria.From<?,?> root,
Object propertyId)
public static <X,Y> javax.persistence.criteria.Path<X> getPropertyPathTyped(javax.persistence.criteria.From<X,Y> root,
Object propertyId)
public void addFilter(com.vaadin.data.Container.Filter filter)
filter - public void removeFilter(com.vaadin.data.Container.Filter filter)
filter - public void removeAllFilters()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||