aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-11-01 16:46:55 +0000
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-11-01 16:46:55 +0000
commit37fd886cc14dfd2ff4757107e817ef3609598bad (patch)
tree41f34b7ce28e0103acefb392499ee5054e6f1041 /src
parent6c66e8bd084a8e2011c50b2dac25022f26208edf (diff)
downloadvaadin-framework-37fd886cc14dfd2ff4757107e817ef3609598bad.tar.gz
vaadin-framework-37fd886cc14dfd2ff4757107e817ef3609598bad.zip
Container.Filterable API
svn changeset:2663/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/data/Container.java33
1 files changed, 33 insertions, 0 deletions
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.