Bug 405348

Summary: [Eclipse Platform Utilities] incorrect implementation in org.eclipse.sphinx.platform.ui.preferences.AbstractPreferenceAndPropertyPage
Product: [Automotive] Sphinx Reporter: pdu <pierre.dufay>
Component: CoreAssignee: Project Inbox <sphinx-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: balazs.grill, idydieng, pierre.dufay, r.sezestre
Version: 0.7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch proposal none

Description pdu CLA 2013-04-10 08:42:28 EDT
I noticed that for most of FieldEditor included in types which inherit AbstractPreferenceAndPropertyPage, method setEnabled doesn't work correctly, when called (for example) from enablePreferenceContent method

Root cause comes from method createFieldEditors() method, which returns composite variable instead of parent, which is set to getFieldEditorParent()

createFieldEditors() must return 'parent' instead of 'composite', as written in attached patch
Comment 1 pdu CLA 2013-04-10 08:43:21 EDT
Created attachment 229552 [details]
patch proposal

This patch applies on sphinx svn trunk
Comment 2 Pierre Dufay CLA 2013-08-28 09:30:46 EDT
Further investigation show that the previously sent patch is not totally effective.
As a matter of fact, with this patch, 'composite' variable is useless, but nevertheless added to parent. This leads in display problem when adding StringFieldEditor.
As a conclusion, added to this patch, code linked to 'composite' variable must be removed:

protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();
    initializeDialogUnits(parent);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    parent.setLayout(layout);
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    addFields(parent);
}
Comment 3 Balazs Grill CLA 2024-05-06 23:29:41 EDT
Closed stale issue before migration