Search code examples
javaeclipseeclipse-pde

Adding a panel container to a PreferencePage in an Eclipse PDE project


I'm using the FieldEditorPreferencePage class in order to create a preferences page for my Eclipse plug-in. I've been able to add all the controls I need to the page, however there are several controls that I'd like to group together using a panel.

Here's an example from Eclipse's documentation. However, there's no information about how the "Open mode" panel was added to the page, and how controls were added to it.

How do I add a panel to an Eclipse PreferencePage?

enter image description here


Solution

  • I ended up writing my own GroupFieldEditor class, based on two implementations I found that didn't exactly meet my requirements. FieldEditors can be added to that control, and the group can then be added to a FieldEditorPreferencePage object using the addField() method.

    The implementation is available here

    For example, this is how the group looks in my plug-in project:

    enter image description here