bibliothek.gui.dock.title
Class DockTitleManager

java.lang.Object
  extended by bibliothek.gui.dock.title.DockTitleManager

public class DockTitleManager
extends java.lang.Object

The manager of the DockTitleFactories. Every DockStation will try to register some factories here. The factories can be overridden by a client or a DockTheme.

Author:
Benjamin Sigg

Field Summary
private  DockController controller
          The controller for which the factories are stored
private  java.util.Map<java.lang.String,DockTitleVersion> titleVersions
          A map of all versions registered at this manager
 
Constructor Summary
DockTitleManager(DockController controller)
          Creates a new manager
 
Method Summary
 void clearThemeFactories()
          Removes all factories that were added by a theme
 boolean existsTitleVersion(java.lang.String id)
          Tests whether there is a handle registered at id or not.
 DockTitleVersion getVersion(java.lang.String id)
          Gets the handle with the key id.
 DockTitleVersion register(java.lang.String id, DockTitleFactory factory, Priority priority)
          Registers a factory at the given key
 DockTitleVersion registerClient(java.lang.String id, DockTitleFactory factory)
          Registers a factory with client-priority
 DockTitleVersion registerDefault(java.lang.String id, DockTitleFactory factory)
          Registers a factory with default-priority
 DockTitleVersion registerTheme(java.lang.String id, DockTitleFactory factory)
          Registers a factory with theme-priority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

titleVersions

private java.util.Map<java.lang.String,DockTitleVersion> titleVersions
A map of all versions registered at this manager


controller

private DockController controller
The controller for which the factories are stored

Constructor Detail

DockTitleManager

public DockTitleManager(DockController controller)
Creates a new manager

Parameters:
controller - the controller for which the titles are used
Method Detail

existsTitleVersion

public boolean existsTitleVersion(java.lang.String id)
Tests whether there is a handle registered at id or not.

Parameters:
id - the id
Returns:
true if there is a handle, false otherwise

getVersion

public DockTitleVersion getVersion(java.lang.String id)
Gets the handle with the key id.

Parameters:
id - the key
Returns:
the handle or null if no handle is registered

registerClient

public DockTitleVersion registerClient(java.lang.String id,
                                       DockTitleFactory factory)
Registers a factory with client-priority

Parameters:
id - the key of the factory
factory - the factory
Returns:
a handle of the factories of this id

registerTheme

public DockTitleVersion registerTheme(java.lang.String id,
                                      DockTitleFactory factory)
Registers a factory with theme-priority

Parameters:
id - the key of the factory
factory - the factory
Returns:
a handle of the factories of this id

registerDefault

public DockTitleVersion registerDefault(java.lang.String id,
                                        DockTitleFactory factory)
Registers a factory with default-priority

Parameters:
id - the key of the factory
factory - the factory
Returns:
a handle of the factories of this id

register

public DockTitleVersion register(java.lang.String id,
                                 DockTitleFactory factory,
                                 Priority priority)
Registers a factory at the given key

Parameters:
id - the key of the factory
factory - the factory
priority - the priority of this registration
Returns:
the handle to the factory or a factory with higher priority

clearThemeFactories

public void clearThemeFactories()
Removes all factories that were added by a theme