Project: Eclipse_Platform_UI
Bug 188663 [Viewers] Virtual TreeViewer with columns: First and last row have wrong labels
Reported: 2007-05-23 11:16:54 | Status: verified fixed

Seen with 3.3 M7 I have a virtual TreeViewer/ILazyTreeContentProvider with multiple columns. Upon setting new input, the first row stays blank with the exception of the first cell. And the last row shows the labels of the first row, with the exception of the first cell. The attached plugin shows the problem: When opening the view, the second column's label is blank on the first row, and the third row's second column shows the label that should be in the first row. Pressing refresh makes the problem go away. Pressing 'New Input' shows the problem again. I did some debugging and here's what I can come up with: When an empty tree is populated, setting an image into the first column on the first row will create a new image list in Tree#imageIndex(Image, int). The call to OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_NORMAL, hImageList); somehow causes all following SWT.SetData events to be handled before the first one that was about to set the image into the tree item. The attached SWT snippet shows this clearer (logged on the console). Once the first SetData callback gets control again, ColumnViewer's cached cell already points to the last row, which would explain why the first one stays empty and the last one gets the first row's labels.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java