RCP PreferencePage Wizard

Subclasses of the RCP ViewPart class can be created using the RCP PreferencePage wizard. The wizard can be selected from the drop down WindowBuilder wizard menu or from the Eclipse New wizard.

To use the wizard, select the project source folder and package to contain the class. Then enter the class name, view name/title and hit the Finish button.


 

 

The wizard generates the following code.

import org.eclipse.jface.preference.PreferencePage;
import
org.eclipse.swt.SWT;
import
org.eclipse.swt.widgets.Composite;
import
org.eclipse.swt.widgets.Control;
import
org.eclipse.ui.IWorkbench;
import
org.eclipse.ui.IWorkbenchPreferencePage;

public
class RcpPreferencePage extends PreferencePage implements
    IWorkbenchPreferencePage {

   
public RcpPreferencePage() {
   
    super();
   
}

    @Override
    public Control createContents(Composite parent) {
        Composite container = new Composite(parent, SWT.NONE);
   
    return container;
   
}

    public void init(IWorkbench workbench) {
   
    // Initialize the preference page
   
}
}

When editing RCP PreferencePages, all of the standard SWT layouts, containers and widgets are available.