bibliothek.gui.dock.common.intern
Class DefaultCommonDockable

java.lang.Object
  extended by bibliothek.gui.dock.dockable.AbstractDockable
      extended by bibliothek.gui.dock.DefaultDockable
          extended by bibliothek.gui.dock.common.intern.DefaultCommonDockable
All Implemented Interfaces:
CommonDockable, CommonElement, DockElement, DockElementRepresentative, PlaceholderListItem<Dockable>, Dockable

public class DefaultCommonDockable
extends DefaultDockable
implements CommonDockable

A default implementation of CommonDockable, based on a DefaultDockable.

Author:
Benjamin Sigg

Constructor Summary
DefaultCommonDockable(CDockable dockable, DockActionSource... sources)
          Creates a new dockable
 
Method Summary
 CommonDockable asDockable()
          Returns this if this is an instance of Dockable.
 CommonDockStation<?,?> asDockStation()
          Returns this if this is an instance of DockStation.
 CActionSource getActions()
          Gets the action source for actions that are added by the client.
 CDockable getDockable()
          Gets the model of this dockable.
 DockActionSource[] getSources()
          Gets a set of DockActionSources which are to be displayed on this CommonDockable.
 CStation<?> getStation()
          Gets the model of this dockable as station.
 void requestDockTitle(DockTitleRequest request)
          The default behavior of this method is to do nothing.
 
Methods inherited from class bibliothek.gui.dock.DefaultDockable
add, add, createTitleIcon, getClientComponent, getComponent, getComponent, getComponentCount, getContentPane, getFactoryID, remove, setController, setFactoryID, setLayout
 
Methods inherited from class bibliothek.gui.dock.dockable.AbstractDockable
accept, accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, addMouseInputListener, bind, configureDisplayerHints, fireTitleBound, fireTitleExchanged, fireTitleExchanged, fireTitleIconChanged, fireTitleTextChanged, fireTitleTooltipChanged, fireTitleUnbound, getConfigurableDisplayerHints, getController, getDockableStateListeners, getDockElementObserver, getDockParent, getElement, getGlobalActionOffers, getLocalActionOffers, getPopupLocation, getTitleIcon, getTitleIconHandling, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, isUsedAsTitle, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeKeyListener, removeMouseInputListener, requestDisplayer, resetTitleIcon, setActionOffers, setDockParent, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.common.intern.CommonDockable
getFactoryID
 
Methods inherited from interface bibliothek.gui.Dockable
accept, accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addMouseInputListener, bind, configureDisplayerHints, getComponent, getController, getDockParent, getGlobalActionOffers, getLocalActionOffers, getTitleIcon, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeMouseInputListener, requestDisplayer, setController, setDockParent, unbind
 
Methods inherited from interface bibliothek.gui.dock.DockElementRepresentative
getElement, getPopupLocation, isUsedAsTitle, shouldFocus, shouldTransfersFocus
 

Constructor Detail

DefaultCommonDockable

public DefaultCommonDockable(CDockable dockable,
                             DockActionSource... sources)
Creates a new dockable

Parameters:
dockable - the model of this element
sources - action source which shows the close action
Method Detail

getActions

public CActionSource getActions()
Gets the action source for actions that are added by the client.

Returns:
the source, not null

getDockable

public CDockable getDockable()
Description copied from interface: CommonDockable
Gets the model of this dockable.

Specified by:
getDockable in interface CommonDockable
Returns:
the model

asDockable

public CommonDockable asDockable()
Description copied from interface: DockElement
Returns this if this is an instance of Dockable. Otherwise null is returned.

Specified by:
asDockable in interface CommonElement
Specified by:
asDockable in interface DockElement
Specified by:
asDockable in interface PlaceholderListItem<Dockable>
Overrides:
asDockable in class AbstractDockable
Returns:
this or null. Must not return null if DockElement.asDockable() already returns null.

asDockStation

public CommonDockStation<?,?> asDockStation()
Description copied from interface: DockElement
Returns this if this is an instance of DockStation. Otherwise null is returned.

Specified by:
asDockStation in interface CommonElement
Specified by:
asDockStation in interface DockElement
Overrides:
asDockStation in class DefaultDockable
Returns:
this or null. Must not return null if DockElement.asDockable() already returns null

getStation

public CStation<?> getStation()
Description copied from interface: CommonDockable
Gets the model of this dockable as station.

Specified by:
getStation in interface CommonDockable
Returns:
the model, may be null

getSources

public DockActionSource[] getSources()
Description copied from interface: CommonDockable
Gets a set of DockActionSources which are to be displayed on this CommonDockable. Note that every call to this method should return the same array of sources. Callers should not modify the result.

Specified by:
getSources in interface CommonDockable
Returns:
the action sources, can be an empty array

requestDockTitle

public void requestDockTitle(DockTitleRequest request)
Description copied from class: AbstractDockable
The default behavior of this method is to do nothing.

Specified by:
requestDockTitle in interface Dockable
Overrides:
requestDockTitle in class AbstractDockable
Parameters:
request - which title is required. If this Dockable does not have a special rule for the given request it just ignores the call