Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » how to change filter list without effecting the change in event list?(how to change filter list without effecting the change in event list?)
how to change filter list without effecting the change in event list? [message #1058992] Thu, 16 May 2013 07:25 Go to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Hi,

I am a bit confused about event list and filter list , if i clear filter list like filterList.clear() then event list get's also clear and show zero size, but when i apply filter using glazed list implementing IfilterStrategy interface then after filter is applied then filter list have only filter rows while event list contains all the data. Actually i want's to know a way? through which i can change filter list without having a change in the event list,
Any help will be appreciated.

Regards,
Safdar Khan
Re: how to change filter list without effecting the change in event list? [message #1058997 is a reply to message #1058992] Thu, 16 May 2013 07:33 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

Seems you are not familiar with GlazedLists. For an introduction look here: http://www.glazedlists.com/

In short, the FilterList is a wrapper around the EventList, which is usually a wrapper on a Java collection. Every list operation like add(), remove(), clear() is performed down on the base list. The GlazedLists are doing transformations dependent on their scope, so the FilterList for example adds a filter transformation that removes pointers to elements in the base list, but it does not remove them from the base list. That's how a filter should work.

So the real question is, what are you trying to do? What kind of changes do you want to perform on the FilterList that should not be performed on the base list?

Greez,
Dirk
Re: how to change filter list without effecting the change in event list? [message #1059001 is a reply to message #1058997] Thu, 16 May 2013 07:43 Go to previous messageGo to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Thanks for your quick reply, Actually I want's to perform add() or remove() operation on filter list and wants the element should not be remove or added in the event list, is it possible some way or the other?

Thanks,
Safdar Khan
Re: how to change filter list without effecting the change in event list? [message #1059004 is a reply to message #1059001] Thu, 16 May 2013 07:54 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
If you don't want to perform filtering but just adding and removing items, then no, that is not possible and doesn't fit in the concept. As I already said, the FilterList is just a wrapper around another list.
Re: how to change filter list without effecting the change in event list? [message #1059006 is a reply to message #1059004] Thu, 16 May 2013 08:04 Go to previous messageGo to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Okay, got it. Actually i am trying to hide rows using filter strategy , the only thing i have are the indexes of rows which i wants to hide , so i am looking to apply some filer so that these rows will be removed from the filter list and as a result rest of rows will be only visible, Any idea about that?

Thanks,
Safdar Khan
Re: how to change filter list without effecting the change in event list? [message #1059025 is a reply to message #1059006] Thu, 16 May 2013 09:31 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Several:

1. Implement a static filter and use the DefaultGlazedListsStaticFilterStrategy where you add your static filter logic
2. Use the RowHideShowLayer (which is not working 100% perfect with other GlazedLists features like groupBy for example)
3. Use the GlazedListsRowHideShowLayer that is introduced with 1.0.0

Dependent on your composition and the other use cases you support in your table use one of them.

The real problem might be the index stuff. Because hiding rows by index using the FilterList means to remove those rows (thats the transformation) which causes changes of indexes. You could implement some static filter that takes care of indexes of rows in the base list, but that also comes with some issues. Usually you should implement a more functional filtering that is based on some row id and remove the dependency to the index.
Re: how to change filter list without effecting the change in event list? [message #1059045 is a reply to message #1059025] Thu, 16 May 2013 12:20 Go to previous message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
yup, your suggestions are pretty helpful, One more question, what is the expected release data of 1.0.0 ?

thanks,
Safdar Khan
Previous Topic:ComboBoxCellEditor keyboard navigation
Next Topic:How to add Filter row in Nattable
Goto Forum:
  


Current Time: Fri Apr 19 22:46:12 GMT 2024

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

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

Back to the top