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

Bug 369470

Summary: [Tree] Right Tree-Cell padding ignored when text is aligned to the right
Product: [RT] RAP Reporter: Austin Riddle <austin.riddle>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch to add proper padding
none
Patch that fixes the issue and updates test cases none

Description Austin Riddle CLA 2012-01-24 00:19:04 EST
Reproducible in CVS HEAD with Controls Demo.

Go to the Tree Tab.
Check "linesVisible" 
Click "Change Columns Alignment"

Notice that the right justified column's text has no padding between the line and the end of the text.
Comment 1 Austin Riddle CLA 2012-02-02 14:10:12 EST
I am not sure if this is how it is supposed to be, but if you shrink a column to smaller than the cell data, then there is also a lack of padding between the right end of the cell content and the column line. I don't recall this being the case in previous versions, but I do know for a fact that there was right cell padding when the content was right justified.
Comment 2 Austin Riddle CLA 2012-02-07 18:38:27 EST
Created attachment 210700 [details]
Patch to add proper padding

This solves the right padding issue. I am not sure if the adapter or the LCA is the correct place for the fix.
Comment 3 Tim Buschtoens CLA 2012-02-09 06:34:42 EST
I *think* inside getTextWidth would be better, TreeItem#getTextBounds might be depend on it. Anyway the patch is currently breaking tests, fix those first.
Comment 4 Austin Riddle CLA 2012-02-09 17:38:26 EST
Created attachment 210830 [details]
Patch that fixes the issue and updates test cases
Comment 5 Austin Riddle CLA 2012-02-09 17:44:11 EST
Patch applied to CVS HEAD.