Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339333

Summary: ScrollBar.setVisible() doesn't work for Tree and Table
Product: [Eclipse Project] Platform Reporter: Lakshmi P Shanmugam <lshanmug>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED WONTFIX QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Lakshmi P Shanmugam CLA 2011-03-09 05:46:17 EST
Happens on Cocoa with 3.7 HEAD.
Comment 1 Felipe Heidrich CLA 2011-03-21 13:42:32 EDT
> ScrollBar.setVisible() doesn't work for Tree and Table 

I believe that is not supposed to work anyway.
Comment 2 Lakshmi P Shanmugam CLA 2011-03-31 07:06:13 EDT
(In reply to comment #1)
> > ScrollBar.setVisible() doesn't work for Tree and Table 
> 
> I believe that is not supposed to work anyway.

Hi Felipe,
But, Table/Tree.getVerticalBar()/getHorizontalBar().setVisible() works on all the platforms except Cocoa. Why is not supposed to work?
Comment 3 Felipe Heidrich CLA 2011-03-31 10:49:47 EDT
(In reply to comment #2)
> Hi Felipe,
> But, Table/Tree.getVerticalBar()/getHorizontalBar().setVisible() works on all
> the platforms except Cocoa. Why is not supposed to work?

Because the scrollbar belongs to the control (table and tree in this case), it is the control's job to configure the scrollbar (max, min, selection, thumb, visibility).
The only way the user should be able to change something in the scrollbar is by using API available in the control.

For example, if the user wants the control to scroll verticall it has to use setTopIndex(), calling getVerticalBar().setSelection() is invalid.

Likewise, if the user does not want the scrollbars to show it has to create the control with SWT.NO_SCROLL.
Comment 4 Felipe Heidrich CLA 2011-03-31 10:59:30 EDT
see Bug 341495

the problem is, if you say  Table/Tree.getVerticalBar()/getHorizontalBar().setVisible()  is supported. Then people will expect all API in Scollbar to be supported also.

Our position is that get* method can be used in a scrollbar for tree/table, but set* can not.

closing as wont fix.
Comment 5 Felipe Heidrich CLA 2011-03-31 11:01:34 EDT
> But, Table/Tree.getVerticalBar()/getHorizontalBar().setVisible() works on all
> the platforms except Cocoa. Why is not supposed to work?

btw, I don't think this is true, if you hide the scrollbar using setVisible(false) it will hide but if you resize the control (or add/remove item) the control will eventually show the scrollbar again.