bibliothek.extension.gui.dock.theme.eclipse
Class DefaultEclipseThemeConnector

java.lang.Object
  extended by bibliothek.extension.gui.dock.theme.eclipse.DefaultEclipseThemeConnector
All Implemented Interfaces:
EclipseThemeConnector
Direct Known Subclasses:
CommonEclipseThemeConnector

public class DefaultEclipseThemeConnector
extends Object
implements EclipseThemeConnector

This default implementation of EclipseThemeConnector draws the typical eclipse-header over Dockables and neither border nor title over DockStations. It checks each DockAction for the annotation EclipseTabDockAction and the actions with the annotation are painted on tabs.


Nested Class Summary
 
Nested classes/interfaces inherited from interface bibliothek.extension.gui.dock.theme.eclipse.EclipseThemeConnector
EclipseThemeConnector.TitleBar
 
Constructor Summary
DefaultEclipseThemeConnector()
           
 
Method Summary
 void addEclipseThemeConnectorListener(EclipseThemeConnectorListener listener)
          Adds listener to this connector.
protected  EclipseTabDockActionLocation getLocation(DockAction action, EclipseTabStateInfo tab)
          Gets the location of action.
protected  EclipseTabDockActionLocation getLocation(EclipseTabDockAction annotation, EclipseTabStateInfo tab)
          Gets the location encoded in annotation.
 EclipseThemeConnector.TitleBar getTitleBarKind(DockStation parent, Dockable dockable)
          Tells which kind of title and DockableDisplayer should be shown for dockable assuming everything can be chosen freely.
protected  boolean hasListeners()
          Tells whether this has any registered listeners.
protected  EclipseThemeConnectorListener[] listeners()
          Gets all listeners that are currently registered at this connector.
 void removeEclipseThemeConnectorListener(EclipseThemeConnectorListener listener)
          Removes listener from this connector.
 boolean shouldShowOnSide(DockAction action, EclipseTabStateInfo tab)
          Tells whether action should be shown on the right side of the tab of dockable.
Note that #shouldShowOnSide(DockAction, Dockable) and EclipseThemeConnector.shouldShowOnTab(DockAction, EclipseTabStateInfo) are independent of each other.
 boolean shouldShowOnTab(DockAction action, EclipseTabStateInfo tab)
          Tells whether action should be shown on the tab of dockable.
Note that #shouldShowOnSide(DockAction, Dockable) and EclipseThemeConnector.shouldShowOnTab(DockAction, EclipseTabStateInfo) are independent of each other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEclipseThemeConnector

public DefaultEclipseThemeConnector()
Method Detail

addEclipseThemeConnectorListener

public void addEclipseThemeConnectorListener(EclipseThemeConnectorListener listener)
Description copied from interface: EclipseThemeConnector
Adds listener to this connector.

Specified by:
addEclipseThemeConnectorListener in interface EclipseThemeConnector
Parameters:
listener - the listener, not null

removeEclipseThemeConnectorListener

public void removeEclipseThemeConnectorListener(EclipseThemeConnectorListener listener)
Description copied from interface: EclipseThemeConnector
Removes listener from this connector.

Specified by:
removeEclipseThemeConnectorListener in interface EclipseThemeConnector
Parameters:
listener - the listener to remove

listeners

protected EclipseThemeConnectorListener[] listeners()
Gets all listeners that are currently registered at this connector.

Returns:
all listeners

hasListeners

protected boolean hasListeners()
Tells whether this has any registered listeners.

Returns:
true if there is at least one listener registered.

getTitleBarKind

public EclipseThemeConnector.TitleBar getTitleBarKind(DockStation parent,
                                                      Dockable dockable)
Description copied from interface: EclipseThemeConnector
Tells which kind of title and DockableDisplayer should be shown for dockable assuming everything can be chosen freely.

Specified by:
getTitleBarKind in interface EclipseThemeConnector
Parameters:
parent - the future or current parent of dockable that will show the DockableDisplayer. May be null.
dockable - the element that stands alone on a DockStation
Returns:
which kind of title and displayer should be used

shouldShowOnSide

public boolean shouldShowOnSide(DockAction action,
                                EclipseTabStateInfo tab)
Description copied from interface: EclipseThemeConnector
Tells whether action should be shown on the right side of the tab of dockable.
Note that #shouldShowOnSide(DockAction, Dockable) and EclipseThemeConnector.shouldShowOnTab(DockAction, EclipseTabStateInfo) are independent of each other.

Specified by:
shouldShowOnSide in interface EclipseThemeConnector
Parameters:
action - the action to show
tab - information about the tab that shows the Dockable
Returns:
whether action should be shown on the right side

shouldShowOnTab

public boolean shouldShowOnTab(DockAction action,
                               EclipseTabStateInfo tab)
Description copied from interface: EclipseThemeConnector
Tells whether action should be shown on the tab of dockable.
Note that #shouldShowOnSide(DockAction, Dockable) and EclipseThemeConnector.shouldShowOnTab(DockAction, EclipseTabStateInfo) are independent of each other.

Specified by:
shouldShowOnTab in interface EclipseThemeConnector
Parameters:
action - the action to show
tab - information about the tab that shows the Dockable
Returns:
whether action should be shown on the tab

getLocation

protected EclipseTabDockActionLocation getLocation(DockAction action,
                                                   EclipseTabStateInfo tab)
Gets the location of action.

Parameters:
action - the action whose location is searched
tab - the state of a tab
Returns:
the location of action, not null

getLocation

protected EclipseTabDockActionLocation getLocation(EclipseTabDockAction annotation,
                                                   EclipseTabStateInfo tab)
Gets the location encoded in annotation.

Parameters:
annotation - an annotation, can be null
tab - the state of a tab
Returns:
the location a DockAction should have according to annotation