Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 310055

Summary: [Table] Column icons misaligned when tableviewer scrolled and refreshed
Product: [RT] RAP Reporter: Austin Riddle <austin.riddle>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample project illustrating problem
none
Updated sample project to show background color misalignment none

Description Austin Riddle CLA 2010-04-21 23:48:35 EDT
Created attachment 165686 [details]
Sample project illustrating problem

Version: CVS HEAD

Steps to reproduce:

1) Create a tableviewer that has many columns and horizontal scrollbars
2) Provide at least one column that shows an icon
3) Create a way to toggle between an empty table and one with at least a few rows of data
4) Run app, and resize shell to ensure horizontal scrollbar is present.
5) Scroll to the right
6) Toggle the data "on".
7) Scroll to the left and observe the misaligned icons.

-----OR------

Use the sample project provided and follow steps 4-7 above. TableView.java is the compilation unit of interest.

Implications:

This issue becomes evident when using a master/detail arrangement of views.
If the content of the table is cleared or filled-in based on workbench selection (i.e., detail view) and the user has the viewer scrolled, this ugly problem manifests.
Comment 1 Austin Riddle CLA 2010-04-21 23:51:22 EDT
It seems like the icons are offset to the left by the amount that the scrollbar is scrolled to the right.
Comment 2 Austin Riddle CLA 2010-04-22 00:05:01 EDT
Created attachment 165688 [details]
Updated sample project to show background color misalignment

After more testing, the problem also applies to custom column background colors. See the label provider in TableView.java for details.
Comment 3 Ivan Furnadjiev CLA 2010-04-22 09:21:34 EDT
We need to add the leftOffset back to the item bounds, imageBounds and textBounds before writing them to the client, as leftOffset shifts the complete TableRow on the client.
Apart of that, now TableItem#getTextBounds() now uses TableItem#getLeft() too like in TableItem#getBounds() and TableItem#getImageBounds().