Take the 2-minute tour ×

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

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

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

share|improve this answer
Thanks for this. I have managed to do something similar based on this. This I found to be the only way to update a single cell , by extending the table viewer and thus having access to some protected methods that allow me to get access to individual cells in the tableviewer. –  Mircea Feb 23 '13 at 5:46
add comment

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.

share|improve this answer
I have tried update() as well but it seems that no matter how I call it (no matter what variant I use ... ), it will always update the whole line which is unacceptable for me because it will cause a big performance penalty. –  Mircea Feb 21 '13 at 21:02
I've never seen an update of a single row to take significant amount of time. I'd take a look at your label provider implementation. Perhaps you are doing too much there. If you doing heavy computation in your label provider, you should consider caching the results so that the label lookup is instantaneous. –  Konstantin Komissarchik Feb 21 '13 at 22:10
Updating a single row takes a very small amount of time , but I have 5k rows in there and the update must be done every 2-3 sconds , so you can imagine the load. –  Mircea Feb 22 '13 at 11:46
add comment

Your Answer


