bibliothek.gui.dock.title
Class DockTitleVersion

java.lang.Object
  extended by bibliothek.gui.dock.title.DockTitleVersion
All Implemented Interfaces:
DockTitleFactory

public class DockTitleVersion
extends Object
implements DockTitleFactory

A DockTitleVersion is a hint which DockTitleFactory has to be used to create one or more DockTitle for some Dockable.
DockTitleVersions are created and registered by a DockTitleManager.
Every version consists of three slots for factories, each with different priority. If a new title is required, the factory with the highest priority will be used.
DockTitleVersion implements DockTitleFactory for convenience.

Author:
Benjamin Sigg

Field Summary
static Path DOCK_TITLE_VERSION_EXTENSION
          Name of the ExtensionName that allows to load additional DockFactorys into this DockTitleVersion.
static String DOCK_TITLE_VERSION_EXTENSION_PARAMETER
          Name of the only property of an ExtensionName, the property points to this
 
Constructor Summary
DockTitleVersion(DockController controller, String id)
          Creates a new version.
 
Method Summary
 boolean equals(Object obj)
           
 DockController getController()
          Gets the controller for which the titles are created.
 DockTitleFactory getFactory()
          Gets the factory with the highest priority
 DockTitleFactory getFactory(Priority priority)
          Gets the factory with the given priority.
 String getID()
          Gets the name of this version.
 int hashCode()
           
 void install(DockTitleRequest request)
          Adds request to this version.
 boolean isSet(Priority priority)
          Tells whether there is a factory with the importance priority, or not.
 void request()
          Calls DockTitleRequest.request() for all DockTitleRequests that are currently installed on this version.
 void request(DockTitleRequest request)
          Calls DockTitleFactory.request(DockTitleRequest) for the current factory.
 void setFactory(DockTitleFactory factory, Priority priority)
          Stores factory at the slot priority.
 void uninstall(DockTitleRequest request)
          Removes request from this version.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCK_TITLE_VERSION_EXTENSION

public static final Path DOCK_TITLE_VERSION_EXTENSION
Name of the ExtensionName that allows to load additional DockFactorys into this DockTitleVersion. These factories will be asked to create a DockTitle before the real factory is asked.


DOCK_TITLE_VERSION_EXTENSION_PARAMETER

public static final String DOCK_TITLE_VERSION_EXTENSION_PARAMETER
Name of the only property of an ExtensionName, the property points to this

See Also:
Constant Field Values
Constructor Detail

DockTitleVersion

public DockTitleVersion(DockController controller,
                        String id)
Creates a new version.

Parameters:
controller - the controller for which titles will be created
id - the unique name of this version
Method Detail

install

public void install(DockTitleRequest request)
Adds request to this version. The request will be installed on the current DockTitleFactory of this version. This method should not be called by clients, clients should call DockTitleRequest.install().

Specified by:
install in interface DockTitleFactory
Parameters:
request - the new request, not null

uninstall

public void uninstall(DockTitleRequest request)
Removes request from this version. This method should not be called by clients, clients should call DockTitleRequest.uninstall().

Specified by:
uninstall in interface DockTitleFactory
Parameters:
request - the request to remove

request

public void request(DockTitleRequest request)
Calls DockTitleFactory.request(DockTitleRequest) for the current factory. If there are any extensions installed, then these extensions are questioned first.

Specified by:
request in interface DockTitleFactory
Parameters:
request - the request to answer

request

public void request()
Calls DockTitleRequest.request() for all DockTitleRequests that are currently installed on this version.


getFactory

public DockTitleFactory getFactory()
Gets the factory with the highest priority

Returns:
the factory or null if there is no factory registered.

setFactory

public void setFactory(DockTitleFactory factory,
                       Priority priority)
Stores factory at the slot priority.

Parameters:
factory - the factory
priority - the importance of the factory

getFactory

public DockTitleFactory getFactory(Priority priority)
Gets the factory with the given priority.

Parameters:
priority - the priority
Returns:
the factory or null

isSet

public boolean isSet(Priority priority)
Tells whether there is a factory with the importance priority, or not.

Parameters:
priority - the searched priority
Returns:
true if there is a factory

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getID

public String getID()
Gets the name of this version. The name is set when this version is created. It should be unique; it is unique if all versions are created through the same DockTitleManager.

Returns:
the name

getController

public DockController getController()
Gets the controller for which the titles are created.

Returns:
the owner of this version