Skip to main content



      Home
Home » Eclipse Projects » NatTable » Frequent calls of DisplayConverter
Frequent calls of DisplayConverter [message #1728173] Thu, 31 March 2016 10:30 Go to next message
Eclipse UserFriend
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 11:10 Go to previous message
Eclipse UserFriend
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: Wed Jun 18 12:09:07 EDT 2025

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

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

Back to the top