public class EclipseTabPane extends CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo> implements BorderedComponent
EclipseTabPane
uses a generic TabPainter
to create its
tabs and to change its border.CombinedStackDockComponent.Meta
LAYOUT_MANAGER, USE_SMALL_MINIMUM_SIZE
Constructor and Description |
---|
EclipseTabPane(EclipseTheme theme,
DockStation station)
Creates a new pane.
|
Modifier and Type | Method and Description |
---|---|
protected BorderForwarder |
createBorderModifier(JComponent target)
Creates the
BorderForwarder that is used to set the border of this
panel. |
protected BorderForwarder |
createContentBorderModifier(Dockable dockable,
JComponent component)
Creates a
BorderForwarder for the content component for the tab of dockable |
protected CombinedStackDockContentPane |
createContentPane(CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo> self)
Creates the content pane for
this component. |
protected Component |
createLayerAt(Component component,
Dockable dockable)
Creates a layer between
component and this panel. |
Insets |
getContentInsets()
|
JComponent |
getLayerAt(int index)
Gets the index'th
Component on this tab. |
TabPanePainter |
getPainter()
Gets the
TabPanePainter which paints decorations for
this panel. |
DockStation |
getStation()
Gets the station on which this pane lies.
|
TabPainter |
getTabPainter()
Gets the
TabPainter that is currently responsible for creating
new tabs for this pane. |
EclipseTheme |
getTheme()
Gets the theme which created this pane.
|
boolean |
hasBorder()
Whether this kind of component already has a border.
|
int |
indexOfVisible(TabComponent tab)
Gets the index of
tab in respect to the Dockable s
of this pane, ignores any invisible tab. |
boolean |
isSingleTabComponent()
Tells whether this
StackDockComponent should be shown even if
the StackDockStation has only one child. |
protected void |
menuRemoved(EclipseMenu menu)
Informs this pane that
menu will never be used again and
all resources associated with menu should be freed. |
EclipseMenu |
newMenu()
Creates a new
TabMenu that has this as parent. |
protected EclipseTab |
newTab(Dockable dockable)
|
void |
setContentBorderAt(int index,
Border border)
Used by
TabComponent s and by TabPainter s this method
advises the EclipseTabPane to put border
around the contents of tab index . |
void |
setController(DockController controller)
Connects this pane with
controller . |
void |
setInfoComponent(EclipseTabInfo info)
Sets the info component.
|
void |
setPainter(TabPanePainter painter)
Sets the
TabPanePainter which will paint decorations for
this panel. |
protected void |
tabRemoved(EclipseTab tab)
Informs this pane that
tab will never be used again and
all resources associated with tab should be freed. |
void |
updateFullBorder()
Updates the border that is around this whole pane.
|
protected void |
updateTabPainter()
Called when the
TabPainter has been exchanged or to initialize
this EclipseTabPane . |
addStackDockComponentListener, addTab, addToMenu, clearTabs, createBackground, createDefaultRepresentation, fireTabChanged, getAvailableArea, getBoundsAt, getComponent, getConfiguration, getContentAt, getDockableAt, getIndexOfTabAt, getInfoHandler, getMenuHandler, getMinimumSize, getMinimumSize, getOnTab, getPreferredSize, getPreferredSize, getSelectedBounds, getSelectedIndex, getTabAt, getTabCount, getTabHandler, getZOrder, insertTab, moveTab, putOnTab, putTab, remove, removeAll, removeFromMenu, removeStackDockComponentListener, removeTab, repaint, revalidate, setComponentAt, setEnabledAt, setIconAt, setSelectedBounds, setSelectedDockable, setSelectedIndex, setTitleAt, setTooltipAt, setZOrder
addTabPaneListener, createMenu, destroyMenu, discardComponentsAndRebuild, doLayout, fireAdded, fireControllerChanged, fireInfoComponentChanged, fireRemoved, fireSelectionChanged, getController, getDockable, getDockableCount, getDockables, getDockTabPlacement, getInfoComponent, getLayoutManager, getMenu, getMenuList, getMenus, getSelectedDockable, getTab, getTabs, getTabsList, getVisibleTab, getVisibleTabCount, indexOf, indexOfVisible, insert, listeners, move, putInMenu, removeTabPaneListener, setDockTabPlacement, setLayoutManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDockTabPlacement
getDockTabPlacement, setDockTabPlacement
public EclipseTabPane(EclipseTheme theme, DockStation station)
theme
- the theme which created this panestation
- the owner of this pane, may be null
protected CombinedStackDockContentPane createContentPane(CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo> self)
CombinedStackDockComponent
this
component. This method
may be called by the constructor.createContentPane
in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
self
- this
null
public void setController(DockController controller)
AbstractTabPane
controller
.setController
in interface StackDockComponent
setController
in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
controller
- the realm in which this pane works, may be null
public void setInfoComponent(EclipseTabInfo info)
AbstractTabPane
setInfoComponent
in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
info
- the new component, can be null
AbstractTabPane.getInfoComponent()
public EclipseTheme getTheme()
null
public DockStation getStation()
public TabPainter getTabPainter()
TabPainter
that is currently responsible for creating
new tabs for this pane.protected void updateTabPainter()
TabPainter
has been exchanged or to initialize
this EclipseTabPane
.public void setPainter(TabPanePainter painter)
TabPanePainter
which will paint decorations for
this panel.painter
- the new painter, can be null
public TabPanePainter getPainter()
TabPanePainter
which paints decorations for
this panel.null
public void updateFullBorder()
updateFullBorder
in interface BorderedComponent
protected BorderForwarder createBorderModifier(JComponent target)
BorderForwarder
that is used to set the border of this
panel.target
- the target component, not null
null
protected BorderForwarder createContentBorderModifier(Dockable dockable, JComponent component)
CombinedStackDockComponent
BorderForwarder
for the content component for the tab of dockable
createContentBorderModifier
in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
dockable
- the item that is showncomponent
- the component which is influencedprotected EclipseTab newTab(Dockable dockable)
AbstractTabPane
Tab
that has this
as parent and
represents dockable
. The new tab should not be stored in
any collection.newTab
in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
dockable
- the element for which a new tab is requiredprotected void tabRemoved(EclipseTab tab)
AbstractTabPane
tab
will never be used again and
all resources associated with tab
should be freed. This
method is only called if tab
is invisible.tabRemoved
in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
tab
- the tab to destroypublic int indexOfVisible(TabComponent tab)
tab
in respect to the Dockable
s
of this pane, ignores any invisible tab.tab
- the tab to searchpublic EclipseMenu newMenu()
AbstractTabPane
TabMenu
that has this
as parent.newMenu
in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
protected void menuRemoved(EclipseMenu menu)
AbstractTabPane
menu
will never be used again and
all resources associated with menu
should be freed. This
method is only called if menu
is invisible.menuRemoved
in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
menu
- the destroyed menupublic void setContentBorderAt(int index, Border border)
TabComponent
s and by TabPainter
s this method
advises the EclipseTabPane
to put border
around the contents of tab index
.index
- the index of the tabborder
- the new border, may be null
protected Component createLayerAt(Component component, Dockable dockable)
CombinedStackDockComponent
component
and this panel. The
object component
is a representation of dockable
but not necessarily dockable
itself. The default
behavior of this method is to return component
.createLayerAt
in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
component
- the representation of dockable
dockable
- the element for which a new layer is createdcomponent
or component
public JComponent getLayerAt(int index)
CombinedStackDockComponent
Component
on this tab. This Component
is not a Dockable
but a layer between dockable and this panel.getLayerAt
in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
index
- the index of a tab.public Insets getContentInsets()
public boolean hasBorder()
StackDockComponent
hasBorder
in interface StackDockComponent
true
if this has a border, false
if the parent should paint one.public boolean isSingleTabComponent()
StackDockComponent
StackDockComponent
should be shown even if
the StackDockStation
has only one child.isSingleTabComponent
in interface StackDockComponent
true
if this component should always be shown