Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Simple filter without row
Simple filter without row [message #1768838] Mon, 24 July 2017 09:19 Go to next message
Jean-Marc LARRE is currently offline Jean-Marc LARREFriend
Messages: 5
Registered: January 2016
Junior Member
Hi,

I would like add un filter to data showned in NatTable. The filter depend on the selected Part and it will be calculated automatically.

I don't want a row to write the filter text. I read and tested the NatTable exemple. But in all exemples, there a row for the filter and I don't know how use my own filter.
Someone would have any exemple or any link to help me to use the filter correctly ?

Sincerely
Jean-Marc
Re: Simple filter without row [message #1768847 is a reply to message #1768838] Mon, 24 July 2017 10:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
If you use a FilterList, simply apply a custom Matcher to it. Otherwise you need to implement a custom IDataProvider that is able to filter. I personally suggest to use FilterList.
Re: Simple filter without row [message #1768856 is a reply to message #1768847] Mon, 24 July 2017 11:35 Go to previous message
Jean-Marc LARRE is currently offline Jean-Marc LARREFriend
Messages: 5
Registered: January 2016
Junior Member
Thank you very much, effectively, with that, the filter works correctly :

.
.
.
EventList<HazardRow> eventList = GlazedLists.eventList(myData.getRows());
FilterList<HazardRow> filterList = new FilterList<>(eventList, new Matcher<HazardRow>() {
@Override
public boolean matches(HazardRow item) {
return !(item.getName().contains("Message"));
}
} );
IRowDataProvider<HazardRow> bodyDataProvider = new ListDataProvider<HazardRow>(filterList, columnPropertyAccessor );.
.
.
.


Jean-Marc
Previous Topic:Selective edit of rows in Nattable
Next Topic:How to set native SWT images in CheckBoxPainter?
Goto Forum:
  


Current Time: Tue Apr 23 12:04:20 GMT 2024

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

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

Back to the top