Question

I currently have a big table (aprox 1000 rows) and about 20 columns. Out of the 20 columns I need one to be refreshed once every 2-3 seconds ( holds elapsed time from the object creation ) , i have tried this by refreshing the whole table every 3 seconds but because of so many rows it is a big performance penalty this whole table refresh.

Anyone seen a way to refresh only one cell / one column in JFace tableviewer ?? I need that one elapsed time column refresh and that's it.

Any help is greatly appreciated.

Thanks Mircea

Était-ce utile?

La solution

I see TableViewer didn't expect to refresh just one cell in a row.

AbstractTableViewer
protected void doUpdateItem(Widget widget, Object element, boolean fullMap)

you need to override the above method. Current implementation refreshes the entire row ( basically invokes LabelProvider on each cell)

you can follow the same implementation but invoke update on specific ViewerCell

Autres conseils

The TableViewer's refresh() method is meant to be triggered when the list of objects that represents the model for the rows of your table is changed. If you only need to update the text or image shown in a particular row or cell, you should use the update() method. There are variants of that method to let you update as little or us much as necessary.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top