Using CellTree you have to provide a TreeViewModel. For each node in the tree you will create a ListDataProvider that contains the child elements of a given node. If you want to filter your tree you have to filter all these ListDataProviders. To do so you should create a sub class of ListDataProvider and add filter capabilities to it. Maybe something like:
FilterListDataProvider<T> extends ListDataProvider<T> {
void setFilter(Filter<T> filter) {
//store it
}
public List<T> getOriginalList() {
return super.getList();
}
@Override
public List<T> getList() {
List<T> originalData = super.getList();
if(filter == null) {
return originalData;
}
//filter.apply() should return a new list. Do not modify originalData.
return filter.apply(originalData);
}
}
After you have setup the filter you have to call ListDataProvider.refresh() to update the CellTree (which hopefully causes getList() to be called). Maybe you also have to overwrite other methods of ListDataProvider to make the filtered behavior correct.
Also I think CellTree won't open up itself upon refreshing ListDataProviders. So you have to do it yourself using CellTree.getRootTreeNode().setChildOpen(). Note that setChildOpen() returns the child node if its successfully opened so you can walk through the tree nodes.
I haven't implemented all of this myself, but I think thats the way I would try it.