... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2006-03-22

Eclipse RCP Forms

If you are using a MasterDetailBlock, if you try to create content for an IDetailsPage setting the marginHeight on a Section to anything other than zero, the content of the whole section will be displayed incorrectly.  e.g.

    public void createContents(Composite parent) {
        TableWrapLayout layout = new TableWrapLayout();
        layout.topMargin = 5;
        layout.leftMargin = 5;
        layout.rightMargin = 2;
        layout.bottomMargin = 2;
        parent.setLayout(layout);

        FormToolkit toolkit = _managedForm.getToolkit();
        Section section = toolkit.createSection(parent, Section.DESCRIPTION);
        toolkit.paintBordersFor(section);
        section.marginWidth = 10;
        section.marginHeight = 5; // don't try to do this
        section.setText("Lookup Types");
        section.setDescription("Some description...");
        ...

Also, if you do not set the layout on the parent of a details page, the details won't show up at all.

Blog Archive