org.pietschy.command

Class FaceManager


public class FaceManager
extends java.lang.Object

This class is responsible for the management of the faces for a given CommandManager. It is used by faces to locate their parents. Construction of Face instances is delegated to an instance of AbstractFaceBuilder.
See Also:
CommandManager.getFaceManager(), setFaceBuilder(AbstractFaceBuilder)

Constructor Summary

FaceManager(CommandManager manager)

Method Summary

Face
createFace(Command command, String name)
protected void
extractFaces(Element parent)
This is invoked for every element that contains face information in a newly loaded configuration file.
Face
get(FaceId faceId)
AbstractFaceBuilder
getFaceBuilder()
Gets the AbstractFaceBuilder currently in use by the manager.
Face[]
getFacesFor(Command parent)
Retreives the faces that are registered for the specified parent id.
boolean
isMenuTooltipsEnabled()
Checks if tooltip are globally enabled on menus.
void
put(Face face)
void
setFaceBuilder(AbstractFaceBuilder faceBuilder)
Sets the AbstractFaceBuilder that the manager is to use for constructing faces.
void
setMenuTooltipsEnabled(boolean menuTooltipsEnabled)
Configures the current menu tooltip state and notifies all faces that the state has changed.

Constructor Details

FaceManager

protected FaceManager(CommandManager manager)

Method Details

createFace

public Face createFace(Command command,
                       String name)

extractFaces

protected void extractFaces(Element parent)
This is invoked for every element that contains face information in a newly loaded configuration file.
Parameters:
parent - the element that contains one or more face elements.

get

public Face get(FaceId faceId)

getFaceBuilder

public AbstractFaceBuilder getFaceBuilder()
Gets the AbstractFaceBuilder currently in use by the manager.
Returns:
the AbstractFaceBuilder currently in use by the manager.

getFacesFor

public Face[] getFacesFor(Command parent)
Retreives the faces that are registered for the specified parent id.

isMenuTooltipsEnabled

public boolean isMenuTooltipsEnabled()
Checks if tooltip are globally enabled on menus. This setting will only be used by faces that haven't been explicitly configured to enable or disable tooltips on menus.
Returns:
true if tooltips are enabled on menus, false otherwise.

put

public void put(Face face)

setFaceBuilder

public void setFaceBuilder(AbstractFaceBuilder faceBuilder)
Sets the AbstractFaceBuilder that the manager is to use for constructing faces.
Parameters:
faceBuilder - the new builder to use.

setMenuTooltipsEnabled

public void setMenuTooltipsEnabled(boolean menuTooltipsEnabled)
Configures the current menu tooltip state and notifies all faces that the state has changed. This setting will be used by all faces that haven't been explicitly configured to enable or disable tooltips on menus.
Parameters:
menuTooltipsEnabled - true to enable tooltips on menus, false to disable them.