| Summary: | [Viewers] Unnecessary horizontal scrollbar shown for TableViewer+TableColumnLayout | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Ralf Ebert <ralf> | ||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | gouessej, remy.suen | ||||
| Version: | 3.5.2 | Keywords: | helpwanted | ||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Ralf Ebert
Created attachment 160390 [details]
Snippet demonstrating the problem
Ralf, thanks for the snippet, shows the problem nicely. If you just run it, notice that resizing the window so that is has *less* width makes the horizontal scroll bar disappear.. Removing myself from the cc. I guess this is a problem with the triage script. The same that Remy mentioned in Bug 304530. Still happening for 3.6RC4 Calling layout() on the table's parent composite after setting the input object works around this problem, f.e.: http://github.com/ralfebert/addressbook/blob/d94b0f14/plugins/com.example.addressbook/src/com/example/addressbook/internal/ui/AddressListViewPart.java#L60 Hi
Just do that to work around your problem:
final TableViewer viewer = new TableViewer(shell, SWT.FULL_SELECTION | SWT.MULTI
| SWT.V_SCROLL | SWT.NO_SCROLL);
I use Eclipse 3.7 under Cent OS Linux 5.3 and it works fine now. However, using SWT.NO_SCROLL should not be necessary, there is clearly a bug.
Table.checkStyle(int style) adds scrollbars except if you use NO_SCROLL as you can see here:
static int checkStyle (int style) {
/*
* Feature in Windows. Even when WS_HSCROLL or
* WS_VSCROLL is not specified, Windows creates
* trees and tables with scroll bars. The fix
* is to set H_SCROLL and V_SCROLL.
*
* NOTE: This code appears on all platforms so that
* applications have consistent scroll bar behavior.
*/
if ((style & SWT.NO_SCROLL) == 0) {
style |= SWT.H_SCROLL | SWT.V_SCROLL;
}
/* GTK is always FULL_SELECTION */
style |= SWT.FULL_SELECTION;
return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
}
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the stalebug whiteboard tag. |