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

Bug 382927

Summary: [Scrollable] Scrollable#getClientArea does not respect the size of visible scrollbars
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.5   
Target Milestone: 2.0 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Ivan Furnadjiev CLA 2012-06-19 03:06:51 EDT
The default implementation of Scrollable#getVScrollBarWidth() and Scrollable#getHScrollBarHeight() returns 0. These methods are package private and are overrided by controls like Table, Tree, List... In case of custom widget with scrollbars (like Nebula Grid), it's not possible to override these methods. The correct implementation of these methods is return the correct scrollbar width/height based on Scrollbar "visible" property. Test case:
public void testGetClientArea_WithScrollbars() {
  Composite scrollable = new Composite( shell, SWT.V_SCROLL | SWT.H_SCROLL );
  scrollable.getHorizontalBar().setVisible( true );
  scrollable.getVerticalBar().setVisible( true );
  scrollable.setSize( 100, 100 );
  Rectangle expected = new Rectangle( 0, 0, 90, 90 );
  assertEquals( expected, scrollable.getClientArea() );
}
Comment 1 Ivan Furnadjiev CLA 2012-06-19 03:32:31 EDT
Fixed in master with commit 858996b31764a5ed2b3d6fce7f3a683dee0dff1a.