Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353011 - [Tree] getPreferredCellWidth returns same value for different columns
Summary: [Tree] getPreferredCellWidth returns same value for different columns
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 10:57 EDT by Ivan Furnadjiev CLA
Modified: 2011-07-25 11:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Furnadjiev CLA 2011-07-25 10:57:39 EDT
The TreeItem#preferredWidthBuffer field is not column aware. Test case to reproduce it:
public void testGetPreferredCellWidthForColumn() {
    Tree tree = new Tree( composite, SWT.NONE );
    createColumns( tree, 3 );
    TreeItem item = new TreeItem( tree, SWT.NONE );
    item.setText( 0, "short" );
    item.setText( 1, "very long text" );
    
    int width1 = tree.getPreferredCellWidth( item, 0, false );
    int width2 = tree.getPreferredCellWidth( item, 1, false );
    assertTrue( width2 > width1 );
  }
Comment 1 Ivan Furnadjiev CLA 2011-07-25 11:46:34 EDT
Fixed by moving the prefferedWidthBuffer into the TreeItem#Data class.