Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 164038 - [Viewers] Issues with TreeColumnAdapter
Summary: [Viewers] Issues with TreeColumnAdapter
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 165296
Blocks: 171824
  Show dependency tree
 
Reported: 2006-11-09 17:23 EST by Benjamin Pasero CLA
Modified: 2007-03-23 09:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2006-11-09 17:23:17 EST
The new TreeColumnAdapter is really great. However I am seeing a bug, demonstrated by this snippet:

public class Main {
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());

    Tree tree = new Tree(shell, SWT.NONE);
    tree.setHeaderVisible(true);

    TreeItem item1 = new TreeItem(tree, SWT.NONE);
    item1.setText("Item 1");

    for (int i = 0; i < 100; i++) {
      TreeItem item2 = new TreeItem(item1, SWT.NONE);
      item2.setText("Item 2");
    }
    TreeColumn col1 = new TreeColumn(tree, SWT.NONE);
    col1.setText("Col 1");

    TreeColumn col2 = new TreeColumn(tree, SWT.NONE);
    col2.setText("Col 2");

    TreeColumnAdapter adapter = new TreeColumnAdapter(tree);
    tree.addControlListener(adapter);

    adapter.addColumnData(new ColumnWeightData(60));
    adapter.addColumnData(new ColumnWeightData(40));

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
}

Just expand the first item and notice the horizontal scrollbar appearing. This is unexpected. Also note that the horizontal bar is not going away, even when resizing the window.

Ben
Comment 1 Thomas Schindl CLA 2006-11-09 17:52:57 EST
Ok here are my findings. The problem for Trees seem to be that the call to
----------------8<----------------
Point result = scrollable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
----------------8<----------------

Always returns the size the tree needs to have to display the items at the top-level. This way we never remove the veritcal scrollbar from the maximal number of pixels to fill with columns. Maybe one of the SWT-Members could give us a more detail insight in the problem.
Comment 2 Thomas Schindl CLA 2007-03-19 11:03:46 EDT
Fixed by resolving bug #171824 >= 20070319
Comment 3 Thomas Schindl CLA 2007-03-19 11:04:54 EDT
And once more: Fixed by resolving bug #171824 >= 20070319
Comment 4 Tod Creasey CLA 2007-03-23 09:03:13 EDT
TreeColumnAdapter has been removed so this bug is verified