Advanced filters with expressions [message #1733969] |
Thu, 02 June 2016 10:25  |
Eclipse User |
|
|
|
Hi,
I have found this discussion thread on the old sourceforge forum about enabling multiple filters in the NatTable using also numeric expressions and so on:
https://sourceforge.net/p/nattable/discussion/744992/thread/1e4ea778/
The feature seems impressive and it seems to be integrated in the NatTable API when I dig into it, but I didn't find the way to enable it. All my tests have failed so I'm wondering whether I use the good method:
I started to call the FilterRowHeaderComposite constructor with the additional parameter to create some MatcherEditor:
FilterRowHeaderComposite<T> filterHeaderLayer = new FilterRowHeaderComposite<T>(
new DefaultGlazedListsFilterStrategy<T>(dataProvider.getWrappedFilterList(), getCompositeMatcherEditor(),
dataProvider.getColumnAccessor(), builder.getConfigRegistry()),
topLayer, super.getDataProvider(), builder.getConfigRegistry());
public CompositeMatcherEditor<T> getCompositeMatcherEditor() {
@SuppressWarnings("unchecked")
EventList<MatcherEditor<T>> matchers = GlazedLists.eventListOf((MatcherEditor<T>)new RangeMatcherEditor<Double, T>(), (MatcherEditor<T>)new TextMatcherEditor<T>());
return new CompositeMatcherEditor<T>(matchers);
}
But the behavior does not change in my NatTable, filtering is still done using basic text matcher. I also seen some discussions about "regex" based filtering.
Do you have any tips on how to enable these capabilities, what I have to modify/enable to make it work? I have not found in it the online doc nor in the examples source code but maybe I just looked at the wrong place!
Alain
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05296 seconds