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

Bug 327252

Summary: [ScrolledComposite] Scrollbars are displayed unnecessarily
Product: [RT] RAP Reporter: Benjamin Wolff <eclipse>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.4   
Target Milestone: 1.4 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Wolff CLA 2010-10-07 11:31:29 EDT
With the current RAP CVS version the scrollbars of a ScrolledComposite are displayed unnecessarily. It can be reproduced with the following snippet:


public class View extends ViewPart {

	public static final String ID = "scrolled_comp_bug.view";

	@Override
	public void createPartControl(Composite parent) {
		ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
		scrolledComp.setExpandHorizontal(true);
		scrolledComp.setExpandVertical(true);

		Composite comp = new Composite(scrolledComp, SWT.NONE);
		GridLayoutFactory.swtDefaults().applyTo(comp);
		scrolledComp.setContent(comp);
		scrolledComp.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	}

	@Override
	public void setFocus() {}

}


This should be the default idiom for using a ScrolledComposite to show the scrollbars if the content of the composite does not fit in the receivers window.
However, in this case the scrollbars are display allthough the content fits into the window. Using the same snippet in RCP does not show the scrollbars.

The problem can be reproduced with FF 3.6, Chrome & IE8.

This issue exists since the fix of this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327150
Comment 1 Benjamin Wolff CLA 2010-10-07 11:33:52 EDT
Sorry, i was refering to this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326751
Comment 2 Tim Buschtoens CLA 2010-10-07 16:52:26 EDT
Fixed in CVS HEAD.
ScrolledCompositeLCA had assumed wrong default-values for scrollbar-visibility. 

@Benjamin: It should now work again as expected, otherwise reopen bug.