Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 235087 - [Table] Scrollbar is drawn unneccessarily
Summary: [Table] Scrollbar is drawn unneccessarily
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P1 normal with 1 vote (vote)
Target Milestone: 1.2 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 264422 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-02 06:18 EDT by Setya Nugdjaja CLA
Modified: 2009-04-17 08:32 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot of TableViewer with horizontal scrollbar (4.29 KB, image/png)
2008-06-02 06:18 EDT, Setya Nugdjaja CLA
no flags Details
Screenshot of TableViewer with its horizontal scrollbar scrolled. (4.21 KB, image/png)
2008-06-02 06:19 EDT, Setya Nugdjaja CLA
no flags Details
Snippet to reproduce the problem (2.24 KB, text/plain)
2008-06-06 06:03 EDT, Setya Nugdjaja CLA
no flags Details
Screenshot of TableViewer with unneccessary vertical scrollbar (8.49 KB, image/png)
2008-06-13 07:07 EDT, Setya Nugdjaja CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Setya Nugdjaja CLA 2008-06-02 06:18:04 EDT
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
Comment 1 Setya Nugdjaja CLA 2008-06-02 06:19:25 EDT
Created attachment 103091 [details]
Screenshot of TableViewer with its horizontal scrollbar scrolled.
Comment 2 Ivan Furnadjiev CLA 2008-06-06 05:25:01 EDT
Can you attach the test case that reproduce the problem?
Comment 3 Setya Nugdjaja CLA 2008-06-06 06:03:35 EDT
Created attachment 103911 [details]
Snippet to reproduce the problem
Comment 4 Setya Nugdjaja CLA 2008-06-13 07:07:46 EDT
Created attachment 104840 [details]
Screenshot of TableViewer with unneccessary vertical scrollbar

I also notice the same behavior with vertical scrollbar
Comment 5 Tim Whittington CLA 2009-02-09 21:33:51 EST
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.
Comment 6 Tom H CLA 2009-02-16 12:00:00 EST
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>
Comment 7 Ivan Furnadjiev CLA 2009-03-02 06:02:36 EST
*** Bug 264422 has been marked as a duplicate of this bug. ***
Comment 8 Ralf Sternberg CLA 2009-04-17 08:32:21 EDT
Fixed in CVS HEAD. The scrollbars are now only displayed when necessary.