|
From: Rogan D. <li...@da...> - 2007-09-05 16:32:52
|
Hi folks,
I am looking at refactoring the docking code to include some generic
interfaces and supporting classes, along with specialised classes for
the various docking frameworks.
I have come up with the following, from examining the JIDE docking and
VLDocking support libs. Comments are welcome.
Create a package org.springframework.richclient.application.docking,
under which common docking support interfaces and classes reside:
Each framework will have a custom implementation of DockingApplicationPage.
interface DockingApplicationPage extends ApplicationPage {
public PerspectiveManager getPerspectiveManager();
public void setPerspectiveManager(PerspectiveManager
perspectiveManager);
}
PerspectiveManager will be responsible for organising the available
Perspectives.
public interface PerspectiveManager {
void setPerspectives(Perspective[] perspectives);
void setDefaultPerspective(Perspective perspective);
Perspective getDefaultPerspective();
Perspective getCurrentPerspective();
void setCurrentPerspective(Perspective perspective);
}
Perspective will be responsible for applying and saving itself on a
particular DockingApplicationPage:
public interface Perspective extends BeanNameAware {
String getId();
void activate(DockingApplicationPage dockingPage);
boolean saveLayout(DockingApplicationPage dockingPage);
}
Each framework will have a custom implementation of Perspective.
Obviously, the custom versions will only be able to operate with the
corresponding version of DockingApplicationPage.
I have also created a common implementation of DockingViewDescriptor,
that adds "hideable", "closeable", "maximizeable", "floatable"
attributes. These should be common to all docking frameworks.
Then implementations for specific frameworks would fall under the
.docking package.
e.g. org.springframework.richclient.application.docking.vldocking
What do you think?
Rogan
|