Attached please find supporting classes providing integration support for the VLDocking framework.
VLDocking provides similar features to FlexDock, but appears to be a lot more actively developed. It is available under a dual license - CeCILL (French GPL compatible) and a commercial licence.
I found it to be very easy to implement basic support, using the mdi DesktopPage classes as a template. I put them under org.springframework.richclient.application.vldocking, in parallel with the flexdock package.
At this stage, there is no support for persisting a layout to disk and reloading it. I am a little concerned that the Docking framework would end up knowing about PageComponents that the ApplicationPage doesn't know about.
The approach is as follows:
Define and reference an instance of VLDockingApplicationPageFactory as the applicationPageFactoryId in ApplicationServices.
e.g.
<bean id="applicationPageFactory" depends-on="serviceLocator"
class="org.springframework.richclient.application.vldocking.VLDockingApplicationPageFactory" lazy-init="false">
</bean>
<bean id="applicationServices"
class="org.springframework.richclient.application.support.DefaultApplicationServices">
<property name="applicationPageFactoryId"><idref bean="applicationPageFactory" /></property>
</bean>
Define your views using VLDockingViewDescriptor's, which allow you to control closability, etc of your docked views.
e.g.
<bean id="initialView-2"
class="org.springframework.richclient.application.vldocking.VLDockingViewDescriptor">
<property name="viewClass">
<value>net.za.dawes.InitialView</value>
</property>
<property name="autoHideEnabled"><value>true</value></property>
</bean>
As one would use mdi.DesktopApplicationPage to define a number of PageComponents (Views) that should be displayed on startup, one can do exactly the same for VLDockingApplicationPage:
<bean id="initialPage"
class="org.springframework.richclient.application.mdi.DesktopPageDescriptor">
<property name="viewDescriptors">
<list>
<value>initialView</value>
<value>initialView-1</value>
<value>initialView-2</value>
</list>
</property>
</bean>
And then refer to the initialPage in your LifecycleAdvisor as usual.
This will use a default VLDockingLayoutBuilder strategy that simply adds each View into a JTabbedPane. Most people will want to implement something more userfriendly, and can do so by implementing VLDOckingLayoutBuilder, which defines the following methods:
void addDockable(DockingDesktop desktop, Dockable dockable);
void layoutDockables(DockingDesktop desktop);
Implementations can decide exactly where each Dockable should be added to the DockingDesktop, relative to any other Dockables that have already been added, at the time they are added. A useful implementation would be able to save the positions of Dockables in a Desktop to a file, and put the Dockables back into approximately the same positions that they were in previously. This could be tricky, however, since a lot would depend on the order in which components are restored.
Similarly, by providing an implementation of layoutDockables(DockingDesktop desktop), the user can rearrange the existing Dockables in the DockingDesktop according to a previously saved schema (or using a definition created by the VLDocking Layout Manager tool)