Package org.flexdock.docking
Interface DockableFactory
-
- All Known Implementing Classes:
DockableFactory.Stub
public interface DockableFactory
This interface is designed to provide an API for allowing theDockingManager
to obtainDockable
instances on the fly. It has a single method,getDockableComponent(String dockableId)
, responsible for returningComponent
instances, possibly creating and registeringDockables
in the process. Implementations of this interface will be application-specific and may be plugged into theDockingManager
via the callDockingManager.setDockableFactory(myFactory)
. Throughout the framework, FlexDock makes many calls toDockingManager.getDockable(String id)
under the assumption that at some point, the requestedDockable
instance has been registered viaDockingManager.registerDockable(Dockable dockable)
. In the event that aDockable
with the specified ID has never been formally registered, theDockingManager
will check for a factory viaDockingManager.getDockableFactory()
. If a factory is present, itsgetDockableComponent()
method is invoked. If a validComponent
is returned fromgetDockableComponent()
, the DockingManager will attempt to register it as aDockable
and return theDockable
.DockableFactory
implementations are especially useful for applications with persisted layouts where theDockables
required during a layout restoration may be constructed automatically on demand by the framework.- Author:
- Christopher Butler
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DockableFactory.Stub
An empty implementation ofDockableFactory
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Dockable
getDockable(java.lang.String dockableId)
Returns aDockable
for the specified Dockable ID, possibly creating and registering it in the process.java.awt.Component
getDockableComponent(java.lang.String dockableId)
Returns aComponent
for the specified Dockable ID, possibly creating and registering aDockable
in the process.
-
-
-
Method Detail
-
getDockableComponent
java.awt.Component getDockableComponent(java.lang.String dockableId)
Returns aComponent
for the specified Dockable ID, possibly creating and registering aDockable
in the process.- Parameters:
dockableId
- the ID for the requested dockableComponent
- Returns:
- the
Component
for the specified ID
-
getDockable
Dockable getDockable(java.lang.String dockableId)
Returns aDockable
for the specified Dockable ID, possibly creating and registering it in the process.- Parameters:
dockableId
- the ID for the requestedDockable
- Returns:
- the
Dockable
for the specified ID
-
-