Using FieldEditors inside a Group [message #175874] |
Mon, 05 January 2004 15:50 |
Eclipse User |
|
|
|
Hi,
I am trying to put two ColorFieldEditors on a FieldEditorPreferencePage
inside a Group, but I don't think I understand how the field editors
relate to the layout very well.
The preference store has values for foreground and background colours.
I tried the following inside createFieldEditors():
Group group = new Group(getFieldEditorParent(), SWT.NORMAL);
group.setText("Select Colours");
GridData gpData = new GridData();
gpData.horizontalSpan = 2;
group.setLayoutData(gpData);
group.setLayout(new GridLayout(2, false));
ColorFieldEditor fgField =
new ColorFieldEditor("foreground", "Foreground", group);
addField(fgField);
ColorFieldEditor bgField =
new ColorFieldEditor("background", "Background", group);
addField(bgField);
but this put everything into 1 column of the grid.
Stepping through it looks like the fields are picking up grid info from
the preference page layout manager rather than that of the Group.
If I comment out the addField lines, it aligns everything nicely, but
obviously the field editors are not set by the preference page.
Any suggestions?
Thanks
Roger
|
|
|
Powered by
FUDForum. Page generated in 0.49444 seconds