Class DockableComponentWrapper

java.lang.Object
org.flexdock.docking.defaults.DockableComponentWrapper
All Implemented Interfaces:
EventListener, Dockable, DockingListener, DockingMonitor

public class DockableComponentWrapper extends Object implements Dockable
This class models a Dockable implementation for wrapping a Component. It is essentially the simplest means to turning a generic Component into a Dockable instance. Compound Dockables may have separate child components that are responsible for drag initiation, whereas another component is the actual drag source. This is shown in the manner that a JInternalFrame would be a draggable component, while the frame's title pane is the actual drag initiator.

The class, conversely, deals with the simple case, where a Component itself must be docking-enabled. DockableComponentWrapper wraps a Component and implements the Dockable interface. Since the Component itself is being docking-enabled, it serves as both the drag source and drag initiator. Thus, getComponent() will return a reference to 'this' and getDragSources() return a List containing the same self-reference Component.

This class may be used by application code to enable docking capabilities on a given Component. However, it is recommended that DockingManager.registerDockable(Component evtSrc, String desc) be used as a more automated, less invasive means of enabling docking on a component. DockingManager.registerDockable(Component evtSrc, String desc) will automatically create a DockableComponentWrapper instance and register the required drag listeners.

Author:
Chris Butler