Community
Participate
Working Groups
Created attachment 103090 [details] Screenshot of TableViewer with horizontal scrollbar Hi, The attached screenshots shows that the TableViewer column is wide enough to fit the text, yet the horizontal scrollbar is drawn. Regards, Setya
Created attachment 103091 [details] Screenshot of TableViewer with its horizontal scrollbar scrolled.
Can you attach the test case that reproduce the problem?
Created attachment 103911 [details] Snippet to reproduce the problem
Created attachment 104840 [details] Screenshot of TableViewer with unneccessary vertical scrollbar I also notice the same behavior with vertical scrollbar
I think the issue here is that the vertical and horizontal scrollbars are always drawn for TableViewers, regardless of whether they need to scroll or not. If the area occupied by Table columns is smaller than the client area, then the scrollbars are just displayed disabled, but if a TableColumnLayout with ColumnWeightData is used (for example), the horizontal scrollbar becomes active. It appears that the layout is calculating column widths based on the total width, not knowing that a scrollbar is taking up a bunch of that width. In comparison, TreeViewer doesn't have the spurious scrollbars.
Ah, It would seem from the comments in the org.eclipse.swt.widgets.Table.java file that the problem is known, and needs to be inplemented * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * <p>Current state of Table implementation:</p> * <ul> * <li>showSelection and showItem currently do a very rough proximation since * getClientArea is not yet implemented properly</li> * <li>Scroll bars are visible even though not necessary</li> * <li>No keyboard navigation</li> * </ul>
*** Bug 264422 has been marked as a duplicate of this bug. ***
Fixed in CVS HEAD. The scrollbars are now only displayed when necessary.