... 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-31

Eclipse TreeViewer

I tried an experiment to explore the behaviour of Eclipse TreeViewers when their input model was changed.  I was hoping that if the new model was equivalent to the old using equals(), then the tree would not collapse and lose its selection.  No such luck.  The new model must be '==' the old model to retain tree state.

2006-03-29

Eclipse Bundles vs. BEA SDO Classloaders

I had a set of Eclipse plug-ins, one of which contained BEA's SDO implementation and another that used it.  Most of the time, SDO objects could be loaded and manipulated without problems.  But when I tried this snippet:

String graphXml = originalObject.getDataGraph().toString();
DataGraph newGraph = new DataGraphImpl(graphXml);

I got the exception:

SDO generated classes for: {http://www.mm.com/xmlns/2006/esi.manage/api/}DataModelis not in the classpath

The fix was to adjust the manifest for the SDO plug-in so that it would look in dependent plug-ins when trying to load classes.  The relevant entry in MANIFEST.MF was:

Eclipse-BuddyPolicy: dependent

2006-03-24

Eclipse RCP Forms

On forms at least, if you create a composite but do not associate a layout with it, none of the component widgets will appear within the composite.

If you are using a managed block on a form, but you do not set the text ("title") of the form to anything, the detail panel will not resize properly when the window is resized.  The detail panel will remain a fixed size and a scrollbar will appear on the bottom.

Many types of changes (like changing the form text to fix the detail panel resizing problem, above) do not take full effect if you are relying upon hot code downloading in a debugging session.  You have to exit the application and restart it.

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