Community
Participate
Working Groups
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
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.
Fixed by resolving bug #171824 >= 20070319
And once more: Fixed by resolving bug #171824 >= 20070319
TreeColumnAdapter has been removed so this bug is verified