org.pietschy.command

Class DefaultFaceBuilder


public class DefaultFaceBuilder
extends AbstractFaceBuilder

Provides the default implementation of AbstractFaceBuilder.

Constructor Summary

DefaultFaceBuilder()
Creats a new builder.

Method Summary

protected void
buildAccelerator(Face face, Element commandElement)
Interprets the accelerator string for the specified command and returns a representative KeyStroke.
protected void
buildIcons(Face face, Element faceElement)
Scans the specified face element, extracts all the faces specified and adds them to the face.
protected void
buildText(Face face, Element faceElement)
Configures the text properties of the face from the specified face element.
void
configure(Face face, Element faceElement)
Implementers of this class are responsible for building a Face element for the specified configuration data.
Face
createFace(FaceId id, FaceManager faceManager)
Creates a new empty face with the specified id and uses the specified CommandManager for locating its parent.
protected Icon
loadIcon(Element iconElement)
Loads the icon specified by the element.
protected void
populateClientProperties(Face face, Element faceRoot)

Methods inherited from class org.pietschy.command.AbstractFaceBuilder

configure, createFace

Methods inherited from class org.pietschy.command.AbstractBuilder

getAttribute, getCommandManager, getElementPath, getElementText, isEmptyElement, isIncluded, populateProperties, setCommandManager

Constructor Details

DefaultFaceBuilder

public DefaultFaceBuilder()
Creats a new builder.

Method Details

buildAccelerator

protected void buildAccelerator(Face face,
                                Element commandElement)
Interprets the accelerator string for the specified command and returns a representative KeyStroke.

The property form for the accelerator is as follows.
commandId.accel=alt-shift-ctrl-meta-c


buildIcons

protected void buildIcons(Face face,
                          Element faceElement)
Scans the specified face element, extracts all the faces specified and adds them to the face.
Parameters:
face - the Face to configureMenu.
faceElement - the element defining the faces properties.

buildText

protected void buildText(Face face,
                         Element faceElement)
Configures the text properties of the face from the specified face element.
Parameters:
face - the Face to configureMenu.
faceElement - the element defining the faces properties.

configure

public void configure(Face face,
                      Element faceElement)
Implementers of this class are responsible for building a Face element for the specified configuration data.
Overrides:
configure in interface AbstractFaceBuilder
Parameters:
face - the Face to configureMenu.
faceElement - the element defining the faces properties.

createFace

public Face createFace(FaceId id,
                       FaceManager faceManager)
Creates a new empty face with the specified id and uses the specified CommandManager for locating its parent.
Overrides:
createFace in interface AbstractFaceBuilder
Parameters:
id - the id of the face.
faceManager - the FaceManager the face belongs to.

loadIcon

protected Icon loadIcon(Element iconElement)
Loads the icon specified by the element.
Parameters:
iconElement -

populateClientProperties

protected void populateClientProperties(Face face,
                                        Element faceRoot)