public interface TabPane
TabPane
is a view onto some component that shows a set of
Dockable
s. Only one Dockable
is visible at any time, the others
are hidden behind the visible Dockable
. The user can select
the visible Dockable
by clicking onto some button (called
a "tab"). There is always one or none button per Dockable
. TabPane
can be seen as an extension of StackDockComponent
providing more control over the content of the component.Modifier and Type | Field and Description |
---|---|
static PropertyKey<TabLayoutManager> |
LAYOUT_MANAGER
The layout manager used by any
TabPane to set the boundaries of its children. |
static PropertyKey<java.lang.Boolean> |
USE_SMALL_MINIMUM_SIZE
When calculating the minimum size of a
TabPane , then prefer using really small minimum sizes
over showing the content correctly. |
Modifier and Type | Method and Description |
---|---|
void |
addTabPaneListener(TabPaneListener listener)
Adds a listener to this pane, the listener has to be informed when
elements are added or removed, and when the selection changes.
|
TabMenu |
createMenu()
Creates a new menu for this pane.
|
void |
destroyMenu(TabMenu menu)
Destroys
menu which was created by
this pane. |
java.awt.Rectangle |
getAvailableArea()
Gets the area in which all the
Tab s, TabMenu s and
the visible Dockable (setSelectedBounds(Rectangle) )
must find their place. |
DockController |
getController()
Gets the
DockController this pane is associated with. |
Dockable[] |
getDockables()
Gets a list of all
Dockable s that are stored on this pane. |
TabPlacement |
getDockTabPlacement()
Tells at which side tabs are to be displayed.
|
LonelyTabPaneComponent |
getInfoComponent()
Gets the info component, the info component shows some additional
information.
|
java.awt.Dimension |
getMinimumSize(Dockable dockable)
Gets the minimum size that is required to show the child
dockable . |
Tab |
getOnTab(Dockable dockable)
Gets the tab-button for
dockable , if no tab-button
for dockable exists a new button should be created. |
java.awt.Dimension |
getPreferredSize(Dockable dockable)
Gets the preferred size that is required to show the child
dockable . |
java.awt.Rectangle |
getSelectedBounds()
Gets the boundaries the
selected Dockable
has (independent of whether such a Dockable exists). |
Dockable |
getSelectedDockable()
Gets the currently selected
Dockable on this pane (this
is the one child that is visible). |
Tab[] |
getTabs()
Gets all the tabs that are currently visible on this pane.
|
void |
putInMenu(TabMenu menu,
Dockable dockable)
Adds
dockable somewhere on menu . |
Tab |
putOnTab(Dockable dockable)
Informs this pane that its child
dockable should have a
tab-button. |
void |
removeTabPaneListener(TabPaneListener listener)
Removes a listener from this pane.
|
void |
setSelectedBounds(java.awt.Rectangle bounds)
Sets the boundaries of the
selected Dockable . |
void |
setSelectedDockable(Dockable dockable)
Sets the dockable which is current selected on this pane.
|
static final PropertyKey<TabLayoutManager> LAYOUT_MANAGER
TabPane
to set the boundaries of its children.static final PropertyKey<java.lang.Boolean> USE_SMALL_MINIMUM_SIZE
TabPane
, then prefer using really small minimum sizes
over showing the content correctly.void addTabPaneListener(TabPaneListener listener)
listener
- the new listenervoid removeTabPaneListener(TabPaneListener listener)
listener
- the listener to removeDockController getController()
DockController
this pane is associated with.null
Dockable[] getDockables()
Dockable
s that are stored on this pane. The list
should be ordered.null
but maybe emptyjava.awt.Dimension getMinimumSize(Dockable dockable)
dockable
.dockable
- one of the children of this panedockable
java.awt.Dimension getPreferredSize(Dockable dockable)
dockable
.dockable
- one of the children of this panedockable
Dockable getSelectedDockable()
Dockable
on this pane (this
is the one child that is visible).null
unless there are no
children at allvoid setSelectedDockable(Dockable dockable)
Dockable
that is already a child of this pane.dockable
- the newly selected dockableTabPlacement getDockTabPlacement()
TabLayoutManager
, but may be ignored.null
Tab[] getTabs()
null
but maybe empty. Note
that the size of this array must be smaller or equal to the array returned
by getDockables()
.Tab putOnTab(Dockable dockable)
dockable
should have a
tab-button. This TabPane
may create a new Tab
or reuse an existing Tab
. Reusing an existing tab is
recommended. If dockable
was part of a TabMenu
,
then it should be removed from that menu.dockable
already is on a tab then this tab should be reused.dockable
- the element which needs a tab-buttonTab
that is only used for dockable
java.lang.IllegalArgumentException
- if dockable
is either
null
or not child of this paneTab getOnTab(Dockable dockable)
dockable
, if no tab-button
for dockable
exists a new button should be created. Reusing
existing tabs is recommended. Other than putOnTab(Dockable)
this
method must not affect any TabMenu
showing Dockable
.dockable
- the element whose tab is requesteddockable
TabMenu createMenu()
void destroyMenu(TabMenu menu)
menu
which was created
by
this pane.menu
- a menu to destroyvoid putInMenu(TabMenu menu, Dockable dockable)
dockable
somewhere on menu
. If dockable
is already shown on another menu or Tab
, then it has to
be removed from that other menu or tab.menu
- a menu created by this TabPane
dockable
- some child of thisputOnTab(Dockable)
java.awt.Rectangle getAvailableArea()
Tab
s, TabMenu
s and
the visible Dockable
(setSelectedBounds(Rectangle)
)
must find their place.width
and
height
1.java.awt.Rectangle getSelectedBounds()
selected Dockable
has (independent of whether such a Dockable
exists).null
void setSelectedBounds(java.awt.Rectangle bounds)
selected Dockable
.bounds
- the boundaries of the selected childjava.lang.IllegalArgumentException
- if bounds
is null
LonelyTabPaneComponent getInfoComponent()
null