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

Bug 376381

Summary: [preferences][clean up] ICleanUpConfigurationUI parent Composite has excess margins
Product: [Eclipse Project] JDT Reporter: Martin Robertson <mchr3k>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.8   
Target Milestone: 3.8 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Martin Robertson CLA 2012-04-10 05:22:48 EDT
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857

ContributedCleanUpTabPage.doCreatePreferences(...) creates a Composite to pass into fContribution.createContents(parent). This composite is setup with a GridData and GridLayout as follows:

  final Composite parent= new Composite(composite, SWT.NONE);
  GridData layoutData= new GridData(SWT.FILL, SWT.FILL, true, true);
  layoutData.horizontalSpan= numColumns;
  parent.setLayoutData(layoutData);
  parent.setLayout(new GridLayout(1, false));

This results in adding extra margin around UI within contributed tabs. To work around this I have to use the following code at the start of my createContents(...) method:

  // Fix parent layout which added some extra margin
  GridLayout parentLayout = new GridLayout();
  parentLayout.marginHeight = 0;
  parentLayout.marginWidth = 0;
  parent.setLayout(parentLayout);

Reproducible: Always

Steps to Reproduce:
1. Implement ICleanUpConfigurationUI.
2. Create some UI within the createContents(...) method.
3. Resulting UI has extra margin compared to the existing UI tabs.
Comment 2 Martin Robertson CLA 2012-04-10 17:23:28 EDT
Thanks for such a quick resolution.