Reputation: 618
I have a TableViewer
, with 15 columns in the table. I have implemented my own content and label providers. I need sorting for all those columns and hence called setComparator()
on table Viewer for all the columns. Each time this setComparator()
is called, the getElements()
of the content provider is called, and thus causing delay in loading of table.
How would I fix this problem?
Upvotes: 0
Views: 53
Reputation: 21025
If getElements()
actually causes the delay in that it does a costly operation (e.g. fetch data from a database) then you could buffer or cache the fetched data instead of retrieving it anew on each call.
If sorting is fixed (i.e. cannot be changed by the user) you could return pre-sorted elements from getElements()
instead of calling setComparator()
.
Upvotes: 0