bibliothek.extension.gui.dock.theme.eclipse.rex.tab
Class DockTitleTab

java.lang.Object
  extended by bibliothek.extension.gui.dock.theme.eclipse.rex.tab.DockTitleTab
All Implemented Interfaces:
TabComponent

public class DockTitleTab
extends Object
implements TabComponent

A DockTitleTab is a wrapper around an ordinary DockTitle to get a TabComponent.
This DockTitleTab will use EclipseDockTitleEvents to inform its DockTitle when a property has changed, the method DockTitle.changed(bibliothek.gui.dock.event.DockTitleEvent) is called for that purpose.

Author:
Benjamin Sigg

Field Summary
static TabPainter FACTORY
          A TabPainter that uses the id EclipseTheme.TAB_DOCK_TITLE to get a DockTitleVersion from the DockTitleManager and create a new DockTitle which is then wrapped by a DockTitleTab.
 
Constructor Summary
DockTitleTab(DockStation station, Dockable dockable, DockTitle title, int index)
          Creates a new tab.
 
Method Summary
 void addMouseListener(MouseListener listener)
           
 void addMouseMotionListener(MouseMotionListener listener)
           
 void bind()
          Informs this tab that it will be shown soon
static TabPainter createFactory(TabPainter fallback)
          Creates a new factory which uses fallback to create a TabComponent when no DockTitle is available.
protected  void fire()
          Fires an event to the DockTitle of this DockTitleTab.
 Component getComponent()
           
 Border getContentBorder()
           
 int getOverlap()
          Gets the number of pixels which should be covered at the left side of this component by its left neighbour.
 void removeMouseListener(MouseListener listener)
           
 void removeMouseMotionListener(MouseMotionListener listener)
           
 void setFocused(boolean focused)
           
 void setIndex(int index)
           
 void setPaintIconWhenInactive(boolean paint)
           
 void setSelected(boolean selected)
           
 void unbind()
          Informs this tab that it is invisible and must not have any connections to other resources
 void update()
          Called when a property of the tab has been changed and this component has to reevaluate its content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

public static final TabPainter FACTORY
A TabPainter that uses the id EclipseTheme.TAB_DOCK_TITLE to get a DockTitleVersion from the DockTitleManager and create a new DockTitle which is then wrapped by a DockTitleTab.

Constructor Detail

DockTitleTab

public DockTitleTab(DockStation station,
                    Dockable dockable,
                    DockTitle title,
                    int index)
Creates a new tab.

Parameters:
station - the station which uses the tabbed pane, might be null
dockable - the element for which this tab is shown
title - the title which represents the tab
index - the location of this tab
Method Detail

createFactory

public static final TabPainter createFactory(TabPainter fallback)
Creates a new factory which uses fallback to create a TabComponent when no DockTitle is available.

Parameters:
fallback - the backup-factory
Returns:
a new TabPainter

bind

public void bind()
Description copied from interface: TabComponent
Informs this tab that it will be shown soon

Specified by:
bind in interface TabComponent

unbind

public void unbind()
Description copied from interface: TabComponent
Informs this tab that it is invisible and must not have any connections to other resources

Specified by:
unbind in interface TabComponent

addMouseListener

public void addMouseListener(MouseListener listener)
Specified by:
addMouseListener in interface TabComponent

addMouseMotionListener

public void addMouseMotionListener(MouseMotionListener listener)
Specified by:
addMouseMotionListener in interface TabComponent

getComponent

public Component getComponent()
Specified by:
getComponent in interface TabComponent

getContentBorder

public Border getContentBorder()
Specified by:
getContentBorder in interface TabComponent

getOverlap

public int getOverlap()
Description copied from interface: TabComponent
Gets the number of pixels which should be covered at the left side of this component by its left neighbour.

Specified by:
getOverlap in interface TabComponent
Returns:
the number of overlapped pixels

removeMouseListener

public void removeMouseListener(MouseListener listener)
Specified by:
removeMouseListener in interface TabComponent

removeMouseMotionListener

public void removeMouseMotionListener(MouseMotionListener listener)
Specified by:
removeMouseMotionListener in interface TabComponent

setFocused

public void setFocused(boolean focused)
Specified by:
setFocused in interface TabComponent

setIndex

public void setIndex(int index)
Specified by:
setIndex in interface TabComponent

setPaintIconWhenInactive

public void setPaintIconWhenInactive(boolean paint)
Specified by:
setPaintIconWhenInactive in interface TabComponent

setSelected

public void setSelected(boolean selected)
Specified by:
setSelected in interface TabComponent

update

public void update()
Description copied from interface: TabComponent
Called when a property of the tab has been changed and this component has to reevaluate its content.

Specified by:
update in interface TabComponent

fire

protected void fire()
Fires an event to the DockTitle of this DockTitleTab.