Setting up a perspective with history for externalized mode

Hi everyone,

I am trying to set up a CPerspective with preset bounds that the dockable shold have when the dockable is externalized later on. Initially it should be shown normalized.
But the dockable is initially externalized.
What I am I doing wrong ?

I do the following:

JFrame frame = …
CControl control = new CControl(new DirectWindowProvider(frame)
CControlPespective perspectives = control.getPerspectives()
CPerspective perspective = perspectives.createEmptyPerspective()
CContentPerspective contentPerspective = perspective.getContentArea(parent.getUniqueId())

SingleCDockable dockable = …
SingleCDockablePerspective dockPerspective = new SingleCDockablePerspective(dockable.getUniqueId())

CExternalizePerspective root = contentPerspective.perspective.getRoot(‘external’)
root.add(dockPerspective, 100, 200, 300, 400, false)
perspective.storeLocations()

contentPerspective.center.gridAdd(0, 0, 1, 1, dockPerspective)
perspective.storeLocations()
perspective.shrink()

perspectives.setPerspective(perspective, true)

frame.setVisible(true)

Thank you for any advice,
karfunkel

It’s a bug of the framework, “CExternalizePerspective” does not properly set itself as parent of “dockPerspective”. I’ll have that fixed in the next release (within the next 3 days). Afterwards this code should work as intended.

I’ve just uploaded a small bugfix, version 1.1.1p4a, this should elimite that bug. If it does still not work, or if some other bug shows up, please let me know.

Works like a charm, thank you.

For your information, I am currently working on a griffon-plugin for DockingFrames with complete commons-support.
I would wait for the 1.1.1 release before releasing the plugin - if it will come soon.
Any timeline ? You said in the next days. Did this mean a few days for 1.1.1 or the next preview ?

Sorry, that was a misunderstanding. With “next release” I meant just 1.1.1p5, not the final version. The final version will at least need another 4 weeks.

If I were you I would not wait for the final release. Just go with the newest preview version - there is not that much change between versions that you run in any (big) issues.