bibliothek.extension.gui.dock.theme.eclipse.stack
Class EclipseTabPane

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.AbstractTabPane<T,M,I>
      extended by bibliothek.gui.dock.station.stack.CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
          extended by bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane
All Implemented Interfaces:
BorderedComponent, StackDockComponent, TabPane
Direct Known Subclasses:
EclipseDockableDisplayer

public class EclipseTabPane
extends CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
implements BorderedComponent

The EclipseTabPane uses a generic TabPainter to create its tabs and to change its border.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.station.stack.CombinedStackDockComponent
CombinedStackDockComponent.Meta
 
Field Summary
 
Fields inherited from interface bibliothek.gui.dock.station.stack.tab.TabPane
LAYOUT_MANAGER
 
Constructor Summary
EclipseTabPane(EclipseTheme theme, DockStation station)
          Creates a new pane.
 
Method Summary
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()
          Gets an estimate of the Insets between the selected Dockable and this whole component.
 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 Dockables 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)
          Creates a new Tab that has this as parent and represents dockable.
 void setContentBorderAt(int index, Border border)
          Used by TabComponents and by TabPainters 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.
 
Methods inherited from class bibliothek.gui.dock.station.stack.CombinedStackDockComponent
addStackDockComponentListener, addTab, addToMenu, clearTabs, createBackground, createDefaultRepresentation, fireTabChanged, getAvailableArea, getBoundsAt, getComponent, getConfiguration, getContentAt, getDockableAt, getInfoHandler, getMenuHandler, getMinimumSize, getOnTab, 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
 
Methods inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabPane
addTabPaneListener, createMenu, destroyMenu, discardComponentsAndRebuild, doLayout, fireAdded, fireControllerChanged, fireInfoComponentChanged, fireRemoved, fireSelectionChanged, getController, getDockable, getDockableCount, getDockables, getDockTabPlacement, getInfoComponent, getLayoutManager, getMenu, getMenuList, getMenus, getMinimumSize, getPreferredSize, getSelectedDockable, getTab, getTabs, getTabsList, getVisibleTab, getVisibleTabCount, indexOf, indexOfVisible, insert, listeners, move, putInMenu, removeTabPaneListener, setDockTabPlacement, setLayoutManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.extension.gui.dock.theme.eclipse.stack.tab.BorderedComponent
getDockTabPlacement
 
Methods inherited from interface bibliothek.gui.dock.station.stack.StackDockComponent
getDockTabPlacement, setDockTabPlacement
 

Constructor Detail

EclipseTabPane

public EclipseTabPane(EclipseTheme theme,
                      DockStation station)
Creates a new pane.

Parameters:
theme - the theme which created this pane
station - the owner of this pane, may be null
Method Detail

createContentPane

protected CombinedStackDockContentPane createContentPane(CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo> self)
Description copied from class: CombinedStackDockComponent
Creates the content pane for this component. This method may be called by the constructor.

Overrides:
createContentPane in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
self - this
Returns:
a new panel, not null

setController

public void setController(DockController controller)
Description copied from class: AbstractTabPane
Connects this pane with controller.

Specified by:
setController in interface StackDockComponent
Overrides:
setController in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
controller - the realm in which this pane works, may be null

setInfoComponent

public void setInfoComponent(EclipseTabInfo info)
Description copied from class: AbstractTabPane
Sets the info component.

Overrides:
setInfoComponent in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
info - the new component, can be null
See Also:
AbstractTabPane.getInfoComponent()

getTheme

public EclipseTheme getTheme()
Gets the theme which created this pane.

Returns:
the theme, not null

getStation

public DockStation getStation()
Gets the station on which this pane lies.

Returns:
the station

getTabPainter

public TabPainter getTabPainter()
Gets the TabPainter that is currently responsible for creating new tabs for this pane.

Returns:
the tab painter

updateTabPainter

protected void updateTabPainter()
Called when the TabPainter has been exchanged or to initialize this EclipseTabPane.


setPainter

public void setPainter(TabPanePainter painter)
Sets the TabPanePainter which will paint decorations for this panel.

Parameters:
painter - the new painter, can be null

getPainter

public TabPanePainter getPainter()
Gets the TabPanePainter which paints decorations for this panel.

Returns:
the painter, may be null

updateFullBorder

public void updateFullBorder()
Updates the border that is around this whole pane.

Specified by:
updateFullBorder in interface BorderedComponent

createBorderModifier

protected BorderForwarder createBorderModifier(JComponent target)
Creates the BorderForwarder that is used to set the border of this panel.

Parameters:
target - the target component, not null
Returns:
the new forwarder, not null

createContentBorderModifier

protected BorderForwarder createContentBorderModifier(Dockable dockable,
                                                      JComponent component)
Description copied from class: CombinedStackDockComponent
Creates a BorderForwarder for the content component for the tab of dockable

Overrides:
createContentBorderModifier in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
dockable - the item that is shown
component - the component which is influenced
Returns:
the forwarder or null

newTab

protected EclipseTab newTab(Dockable dockable)
Description copied from class: AbstractTabPane
Creates a new Tab that has this as parent and represents dockable. The new tab should not be stored in any collection.

Specified by:
newTab in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
dockable - the element for which a new tab is required
Returns:
the new tab

tabRemoved

protected void tabRemoved(EclipseTab tab)
Description copied from class: AbstractTabPane
Informs this pane that tab will never be used again and all resources associated with tab should be freed. This method is only called if tab is invisible.

Specified by:
tabRemoved in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
tab - the tab to destroy

indexOfVisible

public int indexOfVisible(TabComponent tab)
Gets the index of tab in respect to the Dockables of this pane, ignores any invisible tab.

Parameters:
tab - the tab to search
Returns:
its index or -1 if not found or invisible

newMenu

public EclipseMenu newMenu()
Description copied from class: AbstractTabPane
Creates a new TabMenu that has this as parent.

Specified by:
newMenu in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
Returns:
the new menu

menuRemoved

protected void menuRemoved(EclipseMenu menu)
Description copied from class: AbstractTabPane
Informs this pane that menu will never be used again and all resources associated with menu should be freed. This method is only called if menu is invisible.

Specified by:
menuRemoved in class AbstractTabPane<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
menu - the destroyed menu

setContentBorderAt

public void setContentBorderAt(int index,
                               Border border)
Used by TabComponents and by TabPainters this method advises the EclipseTabPane to put border around the contents of tab index.

Parameters:
index - the index of the tab
border - the new border, may be null

createLayerAt

protected Component createLayerAt(Component component,
                                  Dockable dockable)
Description copied from class: CombinedStackDockComponent
Creates a layer between 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.

Overrides:
createLayerAt in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
component - the representation of dockable
dockable - the element for which a new layer is created
Returns:
the new layer which must be a parent of component or component

getLayerAt

public JComponent getLayerAt(int index)
Description copied from class: CombinedStackDockComponent
Gets the index'th Component on this tab. This Component is not a Dockable but a layer between dockable and this panel.

Overrides:
getLayerAt in class CombinedStackDockComponent<EclipseTab,EclipseMenu,EclipseTabInfo>
Parameters:
index - the index of a tab.
Returns:
the layer between tab and dockable

getContentInsets

public Insets getContentInsets()
Gets an estimate of the Insets between the selected Dockable and this whole component.

Returns:
the insets

hasBorder

public boolean hasBorder()
Description copied from interface: StackDockComponent
Whether this kind of component already has a border.

Specified by:
hasBorder in interface StackDockComponent
Returns:
true if this has a border, false if the parent should paint one.

isSingleTabComponent

public boolean isSingleTabComponent()
Description copied from interface: StackDockComponent
Tells whether this StackDockComponent should be shown even if the StackDockStation has only one child.

Specified by:
isSingleTabComponent in interface StackDockComponent
Returns:
true if this component should always be shown