From: Joonas Lehtinen Date: Thu, 1 Nov 2007 16:46:55 +0000 (+0000) Subject: Container.Filterable API X-Git-Tag: 6.7.0.beta1~5715 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=37fd886cc14dfd2ff4757107e817ef3609598bad;p=vaadin-framework.git Container.Filterable API svn changeset:2663/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/data/Container.java b/src/com/itmill/toolkit/data/Container.java index 6116a55815..8c54a4e514 100644 --- a/src/com/itmill/toolkit/data/Container.java +++ b/src/com/itmill/toolkit/data/Container.java @@ -571,6 +571,39 @@ public interface Container { public boolean hasChildren(Object itemId); } + /** Interface is implemented by containers that allow reducing their visiblecontents with + * set of filters. + * + * When a set of filters are set, only items that match 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. + * + * @since 5.0 + */ + public interface Filterable extends Container { + + /** Add a filter for given property. + * + * Only items where given property for which toString() contains or starts + * with given filterString are visible in the container. + * + * @param propertyId Property for which the filter is applied to. + * @param filterString String that must match contents of the property + * @param ignoreCase Determine if the casing can be ignored when comparing strings. + * @param onlyMatchPrefix Only match prefixes; no other matches are included. + */ + public void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix); + + /** Remove all filters from all properties. */ + public void removeAllContainerFilters(); + + /** Remove all filters from given property. */ + public void removeContainerFilters(Object propertyId); + } + + /** * Interface implemented by viewer classes capable of using a Container as a * data source.