|
CustomSimpleRowFilter
This is a quick example that shows how you can modify the SimpleRowFilter to do something more custom. It gets around an edge case that I was not sure what to do about yet. I thought I would take the opportunity to put a support interface in so that custom code could get a hold of the FilterMatcherRegistry and solve problem. Right now this example will only work on the trunk code base but will be part of the 2.4.3 release. First you need to extend the SimpleRowFilter and override the getFilterMatchers() method. public class CustomSimpleRowFilter extends SimpleRowFilter {
@Override
protected Map<Filter, FilterMatcher> getFilterMatchers(Collection<?> items, FilterSet filterSet) {
Map<Filter, FilterMatcher> filterMatchers = new HashMap<Filter, FilterMatcher>();
FilterMatcherRegistry registry = getFilterMatcherRegistry();
// insert custom code
return filterMatchers;
}
}Then plug your custom RowFilter into the TableFacade.
tableFacade.setRowFilter(new CustomSimpleRowFilter());
<jmesa:tableFacade rowFilter="com.mycompany.CustomSimpleRowFilter"> |