public class DefaultDockable extends AbstractDockable
Dockable
which consists only of one Component
called
"content pane". It's possible to add or remove components from the
content pane at any time.Constructor and Description |
---|
DefaultDockable()
Constructs a new DefaultDockable
|
DefaultDockable(java.awt.Component component)
Constructs a new DefaultDockable and places one component onto the
content pane.
|
DefaultDockable(java.awt.Component component,
javax.swing.Icon icon)
Constructs a new DefaultDockable, sets an icon and places one
component.
|
DefaultDockable(java.awt.Component component,
java.lang.String title)
Constructs a new DefaultDockable, sets the title and places one
component.
|
DefaultDockable(java.awt.Component component,
java.lang.String title,
javax.swing.Icon icon)
Constructs a new DefaultDockable, sets the icon and the title, and
places a component.
|
DefaultDockable(java.awt.Component component,
java.lang.String title,
javax.swing.Icon icon,
IconHandling handling)
Constructs a new DefaultDockable, sets the icon and the title, and
places a component.
|
DefaultDockable(javax.swing.Icon icon)
Constructs a new DefaultDockable and sets the icon.
|
DefaultDockable(java.lang.String title)
Constructs a new DefaultDockable and sets the title.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.awt.Component component)
Adds
component to the content pane. |
void |
add(java.awt.Component component,
java.lang.Object constraints)
Adds
component to the content pane. |
DockStation |
asDockStation()
|
protected DockComponentRootHandler |
createRootHandler()
Creates the
DockComponentRootHandler which configures the Component s of this dockable. |
protected DockIcon |
createTitleIcon()
|
java.awt.Component |
getClientComponent()
Gets the
Component which was given to this DefaultDockable through the constructor. |
java.awt.Component |
getComponent()
Gets the
Component which represents this Dockable . |
java.awt.Component |
getComponent(int index)
Gets the index'th child of this
Dockable , this is equivalent of calling
getContentPane().getComponent( index ) . |
int |
getComponentCount()
Gets the number of
Component s on this dockable, this is equivalent of calling
getContentPane().getComponentCount() . |
java.awt.Container |
getContentPane()
Gets a panel for children of this Dockable.
|
java.lang.String |
getFactoryID()
Gets the unique name of the
DockFactory which can read
and write elements of this type. |
void |
remove(java.awt.Component component)
Removes
component from the content pane. |
void |
setController(DockController controller)
Sets the controller in whose realm this Dockable is.
|
void |
setFactoryID(java.lang.String factoryId)
Sets the id for the
DockFactory which will be used to store
and load this dockable. |
void |
setLayout(java.awt.LayoutManager layout)
Sets the layout of the content pane.
|
accept, accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, addMouseInputListener, asDockable, bind, configureDisplayerHints, fireTitleBound, fireTitleExchanged, fireTitleExchanged, fireTitleIconChanged, fireTitleTextChanged, fireTitleTooltipChanged, fireTitleUnbound, getComponentConfiguration, getConfigurableDisplayerHints, getController, getDockableStateListeners, getDockElementObserver, getDockParent, getElement, getGlobalActionOffers, getLocalActionOffers, getPopupLocation, getRootHandler, getTitleIcon, getTitleIconHandling, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, isUsedAsTitle, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeKeyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, resetTitleIcon, setActionOffers, setComponentConfiguration, setDockParent, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbind
public DefaultDockable()
public DefaultDockable(javax.swing.Icon icon)
icon
- the icon, to be shown at various placespublic DefaultDockable(java.lang.String title)
title
- the title, to be shown at various placespublic DefaultDockable(java.awt.Component component)
component
- the only child of the content panepublic DefaultDockable(java.awt.Component component, javax.swing.Icon icon)
component
- the only child of the content paneicon
- the icon, to be shown at various placespublic DefaultDockable(java.awt.Component component, java.lang.String title)
component
- the only child of the content panetitle
- the title, to be shown at various placespublic DefaultDockable(java.awt.Component component, java.lang.String title, javax.swing.Icon icon)
component
- the only child of the content panetitle
- the title, to be shown at various placesicon
- the icon, to be shown at various placespublic DefaultDockable(java.awt.Component component, java.lang.String title, javax.swing.Icon icon, IconHandling handling)
component
- the only child of the content panetitle
- the title, to be shown at various placesicon
- the icon, to be shown at various placeshandling
- how to understand the icon
parameterprotected DockIcon createTitleIcon()
AbstractDockable
DockIcon
which represents this Dockable
or this DockStation
. The
icon must call AbstractDockable.fireTitleIconChanged(Icon, Icon)
if the icon changes.createTitleIcon
in class AbstractDockable
protected DockComponentRootHandler createRootHandler()
AbstractDockable
DockComponentRootHandler
which configures the Component
s of this dockable.createRootHandler
in class AbstractDockable
null
public java.lang.String getFactoryID()
DockElement
DockFactory
which can read
and write elements of this type.public void setFactoryID(java.lang.String factoryId)
DockFactory
which will be used to store
and load this dockable.factoryId
- the id of the factorypublic java.awt.Component getComponent()
Dockable
Component
which represents this Dockable
. Note that
the component should be a focus cycle root
public DockStation asDockStation()
DockElement
this
or null
. Must not return null
if DockElement.asDockable()
already returns null
public int getComponentCount()
Component
s on this dockable, this is equivalent of calling
getContentPane().getComponentCount()
.getContentPane()
,
Container.getComponentCount()
public java.awt.Component getComponent(int index)
Dockable
, this is equivalent of calling
getContentPane().getComponent( index )
.index
- the index of the childgetContentPane()
,
Container.getComponent(int)
public java.awt.Component getClientComponent()
Component
which was given to this DefaultDockable
through the constructor. If the client
ever removes and the client component from the content-pane
, and then adds the component
again, then the result of this method gets unspecified.null
if that component
was removed from the content-pane
public java.awt.Container getContentPane()
public void add(java.awt.Component component)
component
to the content pane.component
- the new childpublic void add(java.awt.Component component, java.lang.Object constraints)
component
to the content pane.component
- the new childconstraints
- information for th LayoutManager
public void remove(java.awt.Component component)
component
from the content pane.component
- the child to removepublic void setLayout(java.awt.LayoutManager layout)
FlowLayout
, except the constructor has added a component to the
layout. In that case, the layout is a GridLayout
.layout
- the new layout of the content panepublic void setController(DockController controller)
Dockable
null
means that this Dockable
is not managed by a controller.DockHierarchyListener
s about the change.DockHierarchyObserver
, invoke
DockHierarchyObserver.controllerChanged(DockController)
setController
in interface Dockable
setController
in class AbstractDockable
controller
- the owner, may be null