bibliothek.gui.dock.frontend
Interface FrontendPerspectiveCache

All Known Implementing Classes:
DefaultFrontendPerspectiveCache

public interface FrontendPerspectiveCache

This cache is used by a DockFrontend to create a Perspective. The strategy will be provided with the registered DockElements of the frontend (root-stations and dockables) and has to convert them into PerspectiveElements.

Author:
Benjamin Sigg

Method Summary
 String get(PerspectiveElement element)
          Gets the unique identifier of element.
 PerspectiveElement get(String id, boolean rootStation)
          Called to convert id to a PerspectiveElement.
 PerspectiveElement get(String id, DockElement element, boolean isRootStation)
          Given an element that was earlier created by the client and added to a DockFrontend, this method converts element to a PerspectiveElement.
When called multiple times with the same arguments, then this method is free to either return different objects or to always return the same object.
 boolean isRootStation(PerspectiveStation station)
          Tells whether station is supposed to be a root-station.
 

Method Detail

get

PerspectiveElement get(String id,
                       DockElement element,
                       boolean isRootStation)
Given an element that was earlier created by the client and added to a DockFrontend, this method converts element to a PerspectiveElement.
When called multiple times with the same arguments, then this method is free to either return different objects or to always return the same object.

Parameters:
id - the unique identifier under which element is known to the DockFrontend
element - the element whose perspective must be created
isRootStation - whether element is registered as root-station at the DockFrontend or as Dockable
Returns:
the perspective, must not be null

get

PerspectiveElement get(String id,
                       boolean rootStation)
Called to convert id to a PerspectiveElement. This method will only be called with identifiers that were not used for get(String, DockElement, boolean).

Parameters:
id - the identifier of some element
rootStation - whether id represents a root-station or not
Returns:
the element, can be null

get

String get(PerspectiveElement element)
Gets the unique identifier of element.

Parameters:
element - some element, can be either a dockable or a root-station
Returns:
the unique identifier or null if this cache is unable to associate element with an identifier. Should not be null for elements that were created by get(String, boolean) or get(String, DockElement, boolean).

isRootStation

boolean isRootStation(PerspectiveStation station)
Tells whether station is supposed to be a root-station.

Parameters:
station - the element which may be a root-station
Returns:
true if station should be treated as root-station