Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Updating or removing elemetns from DataProvider
Updating or removing elemetns from DataProvider [message #1013450] Sat, 23 February 2013 12:34 Go to next message
Daya D is currently offline Daya D
Messages: 4
Registered: February 2013
Junior Member
Hi Friends,

I'm looking for a way to update element or remove element from a NatTable. However, it looks this would require looping through all elements (ListDataProvider) and finding out index to be removed/added. Is there a way, i can do something like call remove(Object) or update(Object).I just want to avoid this iteration.

OR

Is there a way i can keep a Map<Index, Object>, then i can use this index to directly extract object and update /remove from dataprovider without iterating through whole table? The concern here is with elements added/removed/updated to ListDataProvider, index would change and mapping in HashMap may not be relavant.

Thanks in Advance for your help.
Re: Updating or removing elemetns from DataProvider [message #1013542 is a reply to message #1013450] Sat, 23 February 2013 18:32 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1263
Registered: July 2012
Senior Member
Hi,

For adding / removing objects I usually work on the underlying list directly.

Greez,
Dirk
Re: Updating or removing elemetns from DataProvider [message #1013821 is a reply to message #1013542] Sun, 24 February 2013 07:02 Go to previous messageGo to next message
Daya D is currently offline Daya D
Messages: 4
Registered: February 2013
Junior Member
Dirk, thank you.

Basically, Add is not a problem but yes update and remove as I need to traverse through whole table to find matching. In my case, I update the table based one per sec tick from market data. It might happen that every row get updated.


Any suggestionin to overcome this, such that i can retrieve from Nattable index of element and keep it mapped with my data in Hash Map?
Re: Updating or removing elemetns from DataProvider [message #1013828 is a reply to message #1013821] Sun, 24 February 2013 07:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1263
Registered: July 2012
Senior Member
Hi,
You should think of the NatTable as a viewer to your data. For background processing you should consider working directly on the backed list. If you're using GlazedLists perform your actions there as updating the NatTable will then be done automatically.

Hope that helps,
Dirk
Re: Updating or removing elemetns from DataProvider [message #1013830 is a reply to message #1013828] Sun, 24 February 2013 07:32 Go to previous message
Daya D is currently offline Daya D
Messages: 4
Registered: February 2013
Junior Member
Thanks Dirk
Previous Topic:ListDataProvider update/remove elements
Next Topic:Decommissioning old web site
Goto Forum:
  


Current Time: Thu Aug 28 21:27:25 EDT 2014

Powered by FUDForum. Page generated in 0.07672 seconds