Skip to main content



      Home
Home » Eclipse Projects » NatTable » how to create a custom filter
how to create a custom filter [message #1818532] Wed, 18 December 2019 22:27 Go to next message
Eclipse UserFriend
I want to add a filter to my popupmenu which can filter the cell text,but i don't know how to do it .I think it may be create a command,but I don't know what to do next ,I want to use NatTable 's filter
Re: how to create a custom filter [message #1818535 is a reply to message #1818532] Thu, 19 December 2019 00:38 Go to previous messageGo to next message
Eclipse UserFriend
If you want to programmatically filter using GlazedLists you need to pass a Matcher or MatcherEditor to the FilterList. If you have also the filter row in place that would interfere with the defaults. For such cases we have the DefaultGlazedListsStaticFilterStrategy where you can pass a Matcher that works in combination with the filter row.
Re: how to create a custom filter [message #1818583 is a reply to message #1818535] Fri, 20 December 2019 02:08 Go to previous messageGo to next message
Eclipse UserFriend
If I use DefaultGlazedListsStaticFilterStrategy,I need to use FilterRowHeaderComposite but,I want to use MenuItem ,When I click the menuitem,filter the selected cell text
Re: how to create a custom filter [message #1818584 is a reply to message #1818583] Fri, 20 December 2019 03:01 Go to previous messageGo to next message
Eclipse UserFriend
Then pass the matcher directly to the FilterList. There is no default implementation for that. You have to impl it yourself
Re: how to create a custom filter [message #1818638 is a reply to message #1818584] Fri, 20 December 2019 22:20 Go to previous messageGo to next message
Eclipse UserFriend
Here's my code
EventList eventlist =new BasicEventList(myDatas);
Matcher matcher =new FilterMatcher(myDatas);
FilterList filterlist =new FilterList (eventlist,matcher);
DefaultGlazedListStaticFilterStrategy strategy = new DefaultGlazedListStaticFilterStrategy (filterlist,accessor, new ConfigRegistry());
strategy.applyFilter(map);
but it didn't work. the filterlist's size always is 0.
Re: how to create a custom filter [message #1818640 is a reply to message #1818638] Sat, 21 December 2019 01:59 Go to previous message
Eclipse UserFriend
I thought you don't want to use the DefaultGlazedListStaticFilterStrategy. If you don't want the filter row it is not needed. You only need the matcher on the FilterList.

Probably the Matcher is not correct. For example I don't understand why you pass the FilterList as parameter. Check for the GlazedLists documentation to see how plain filtering works.
Previous Topic:Nattable saveState and loadState issue
Next Topic:NPE while saving State (with Filters
Goto Forum:
  


Current Time: Fri May 16 17:53:24 EDT 2025

Powered by FUDForum. Page generated in 0.03554 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top