bibliothek.gui.dock.station.stack.tab
Class AbstractTab

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.AbstractTabPaneComponent
      extended by bibliothek.gui.dock.station.stack.tab.AbstractTab
All Implemented Interfaces:
Tab, TabPaneComponent
Direct Known Subclasses:
EclipseTab

public abstract class AbstractTab
extends AbstractTabPaneComponent
implements Tab

Abstract implemention of Tab based on a real Component. Clients should call bind(), unbind() and setController(DockController) to fully utilize this class.

Author:
Benjamin Sigg

Constructor Summary
AbstractTab(TabPane parent, Dockable dockable)
           
 
Method Summary
 void bind()
          Connects this tab with its parent and the DockController.
 Dockable getDockable()
          Gets the element that is associated with this tab.
protected abstract  void informFocusChanged(boolean focused)
          Called when the focus state of this tab has been changed.
protected abstract  void informSelectionChanged(boolean selected)
          Called when the selection state of this tab has been changed.
 boolean isFocused()
          Tells whether this tab is focused.
 boolean isSelected()
          Tells whether this tab is selected.
 void setController(DockController controller)
          Sets the controller in whose realm this AbstractTab works.
 void unbind()
          Disconnects this tab from its parent and from the DockController.
 
Methods inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabPaneComponent
getBounds, getComponent, getMaximumSize, getMinimumSize, getOverlap, getPreferredSize, getTabParent, setBounds
 
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.station.stack.tab.TabPaneComponent
getBounds, getMaximumSize, getMinimumSize, getOverlap, getPreferredSize, getTabParent, getZOrder, isPaneVisible, setBounds, setPaneVisible, setZOrder
 

Constructor Detail

AbstractTab

public AbstractTab(TabPane parent,
                   Dockable dockable)
Method Detail

getDockable

public Dockable getDockable()
Description copied from interface: Tab
Gets the element that is associated with this tab.

Specified by:
getDockable in interface Tab
Returns:
the element

bind

public void bind()
Connects this tab with its parent and the DockController.

Throws:
IllegalStateException - if this method has already been invoked

unbind

public void unbind()
Disconnects this tab from its parent and from the DockController.

Throws:
IllegalStateException - if this method has already been invoked.

isSelected

public boolean isSelected()
Tells whether this tab is selected. This property is updated a TabPaneListener and might not be the correct value while a selection changes.

Returns:
whether this tab is selected

informSelectionChanged

protected abstract void informSelectionChanged(boolean selected)
Called when the selection state of this tab has been changed. Subclasses may choose to ignore the event.

Parameters:
selected - the new selection state

isFocused

public boolean isFocused()
Tells whether this tab is focused. A tab is focused if its Dockable is focused. This property is updated by a DockableFocusListener, hence it might not be accurate while the focus changes.

Returns:
whether this tab is focused

informFocusChanged

protected abstract void informFocusChanged(boolean focused)
Called when the focus state of this tab has been changed. Subclasses may choose to ignore the event.

Parameters:
focused - the new focus state

setController

public void setController(DockController controller)
Sets the controller in whose realm this AbstractTab works.

Parameters:
controller - the controller