Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Using FieldEditors inside a Group
Using FieldEditors inside a Group [message #175874] Mon, 05 January 2004 15:50
Eclipse UserFriend
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
Previous Topic:An Editor problem - double clicking a resource file won't ope it!
Next Topic:It's funny (at least in 2.1)
Goto Forum:
  


Current Time: Tue May 13 01:12:23 EDT 2025

Powered by FUDForum. Page generated in 0.49444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top