Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Frequent calls of DisplayConverter
Frequent calls of DisplayConverter [message #1728173] Thu, 31 March 2016 14:30 Go to next message
Carsten Tsara is currently offline Carsten TsaraFriend
Messages: 11
Registered: March 2016
Junior Member
Seems like NatTable repainting itself very frequently and on every cell painting DisplayConverter.canonicalToDisplayValue() is called. In my case computation of display value is expensive and I want calculate it only when data from DataProvider really changes. So why canonicalToDisplayValue() called so frequently and is there a way to call it when it really needed? Or should I provide some kind of caching of display values myself?
If I should do it myself, then how can I access DataProvider from DisplayConverter? I can't find straightforward way (I tried via ILayerCell using ContextualDisplayConverter)
Re: Frequent calls of DisplayConverter [message #1728177 is a reply to message #1728173] Thu, 31 March 2016 15:10 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
So why canonicalToDisplayValue() called so frequently and is there a way to call it when it really needed?


Because it is needed for rendering the display value and we don't cache the display values internally. Therefore no, there is no way to only call it when it is "really" needed, because it is needed always.

Quote:
In my case computation of display value is expensive


That is your problem! You should not use expensive operations for computing the display value.

Quote:
Or should I provide some kind of caching of display values myself?


If you need that, yes.

Quote:
how can I access DataProvider from DisplayConverter?


You can't via NatTable API. You will need to create your implementation of a DisplayConverter that holds a reference to the IDataProvider. Not sure what you are trying to achieve if you need the IDataProvider in order to convert a cell, but I suppose you know what you are doing.
Previous Topic:Columns shall be arrange on the available width of nattable
Next Topic:Sorting a tree table
Goto Forum:
  


Current Time: Mon May 13 12:13:40 GMT 2024

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

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

Back to the top