Forms MasterDetailsBlock Wizard

Subclasses of the Eclipse Forms MasterDetailsBlock class can be created using the Forms MasterDetailsBlock wizard. The wizard can be selected from the drop down Designer 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 and hit the Finish button.

For more information on using Eclipse Forms, see the Eclipse Forms Programming Guide.

 

The wizard generates the following code.

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.DetailsPart;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.MasterDetailsBlock;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
 
public class FormsMasterDetailsBlockTest extends MasterDetailsBlock{
    public FormsMasterDetailsBlockTest () {
    }
    protected void createMasterPart(IManagedForm managedForm, Composite parent) {
        FormToolkit toolkit = managedForm.getToolkit();
        final Section section = toolkit.createSection(parent,
            ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
        section.setText("Empty Master Section");
        final Composite composite = 
            toolkit.createComposite(section, SWT.NONE);
        toolkit.paintBordersFor(composite);
        section.setClient(composite);
    }
    protected void registerPages(DetailsPart detailsPart) {
    }
    protected void createToolBarActions(IManagedForm managedForm) {
    }
}

When editing Eclipse Forms MasterDetailsBlocks, a set of specialized Eclipse Forms widgets is available with their own unique widget palette. These widgets provide the "flat" look that is a signature element of the Eclipse Forms API. Standard widgets and layout managers can also be used although they won't use the flat look.