com.pietschy.command.face
Class FaceManager

java.lang.Object
  extended by com.pietschy.command.face.FaceManager

public class FaceManager
extends java.lang.Object

FaceManager provides support for the various command implementations to manage thier faces.


Constructor Summary
FaceManager()
          Creates a new instance.
 
Method Summary
 void addFace(Face face)
          Adds the specified face.
(package private)  Face createFace(java.lang.String context)
          Creates a new empty face with the specified name.
 boolean faceExists(java.lang.String context)
          Checks if a face exist for the specified context.
 Face findBestFace(java.lang.String context, java.lang.String[] alternativeFaces)
          Finds the best face for the specified context.
 Face getDefaultFace(boolean createIfMissing)
          Gets the default face.
 Face getFace(java.lang.String context, boolean createFace)
          Gets the face for the specified context.
(package private)  void rebuildFaceDependencies()
           
 void setFacePropertyChangeListener(java.beans.PropertyChangeListener faceListener)
          Sets the global property change listener callback that will listen to all properties on all faces.
(package private)  void updateParentFace(Face face)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaceManager

public FaceManager()
Creates a new instance.

Method Detail

setFacePropertyChangeListener

public void setFacePropertyChangeListener(java.beans.PropertyChangeListener faceListener)
Sets the global property change listener callback that will listen to all properties on all faces.

Parameters:
faceListener - the listener.

getFace

public Face getFace(java.lang.String context,
                    boolean createFace)
Gets the face for the specified context. This method can optionally create the face if it doesn't already exist.

Parameters:
context - the context
createFace - true to create when not defined.
Returns:
the face for the specified context.

findBestFace

public Face findBestFace(java.lang.String context,
                         java.lang.String[] alternativeFaces)
Finds the best face for the specified context.

Parameters:
context - the context
alternativeFaces - alternative contexts so search in order.
Returns:
the best face for the specified context, null if none face was found.
See Also:
Defaults.getAlternativeFaceContexts(String)

getDefaultFace

public Face getDefaultFace(boolean createIfMissing)
Gets the default face. This method will optionally create the face if it hasn't been defined.

Parameters:
createIfMissing - true to create the face when not defined, false to return null.
Returns:
the default face, or null.

createFace

Face createFace(java.lang.String context)
Creates a new empty face with the specified name.

The face is automatically added to the command so there is no need explicitly installFace it.

Parameters:
context - the name of the face, "button" for example.
Returns:
the newly created face.

faceExists

public boolean faceExists(java.lang.String context)
Checks if a face exist for the specified context.

Parameters:
context - the context.
Returns:
true if the face exists, false otherwise.

addFace

public void addFace(Face face)
Adds the specified face. If a face with the same context exists an IllegalStateException will be thrown.

Parameters:
face - the face to add.

rebuildFaceDependencies

void rebuildFaceDependencies()

updateParentFace

void updateParentFace(Face face)


Copyright © 2006 - 2007 Andrew Pietsch