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

Bug 327513

Summary: [Forms] Expandable Section inside a TabFolder does not expand on title click
Product: [RT] RAP Reporter: Andrew Mising name <avyaborov>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Andrew Mising name CLA 2010-10-12 02:53:32 EDT
Build Identifier: 20100617-1415

Hi, 
I've got a problem with a tab folder and form with section on it. 
Expand event doesn't work by pressing title of section.

Reproducible: Always

Steps to Reproduce:
1. Create sample project with a view.
2. Change method createPartControl:

public void createPartControl(Composite parent) {

    final FormToolkit toolkit = new FormToolkit(parent.getDisplay());

    parent.setLayout(new FillLayout());

    TabFolder folder = new TabFolder(parent, SWT.BOTTOM);

    TabItem tabItem = new TabItem(folder, SWT.NONE);
    tabItem.setText("OBJECT");

    Composite composite = new Composite(folder, SWT.NONE);
    tabItem.setControl(composite);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    ScrolledForm form = toolkit.createScrolledForm(composite);
    toolkit.decorateFormHeading(form.getForm());
    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);

    GridData layoutData = new GridData(GridData.FILL_BOTH);
    form.setLayoutData(layoutData);
    form.getBody().setLayout(new GridLayout());

    Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE
        | ExpandableComposite.EXPANDED);
    section.setText("Section name");
    section.setDescription(section.getText());
    section.setLayoutData(layoutData);

    Composite bComposite = toolkit.createComposite(section);
    bComposite.setLayout(new GridLayout(2, true));

    GridData gd = new GridData(GridData.FILL_BOTH);
    bComposite.setLayoutData(gd);

    section.setClient(bComposite);

  }
Comment 1 Ivan Furnadjiev CLA 2010-11-08 10:23:01 EST
Created attachment 182622 [details]
Proposed fix

The bug is only valid in case of TabFolder with SWT.BOTTOM style flag. TabFolder#getClientArea() was calculated wrong. More over, there was no TabFolder#computeTrim at all. As a result, Display#map returns wrong (negative) coordinates of title label mouse event and event was not fired. Tests will follow.
Comment 2 Ivan Furnadjiev CLA 2010-11-09 03:38:13 EST
Fixed in CVS HEAD.