org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder
Class GuiBuilder

java.lang.Object
  extended by org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder.GuiBuilder
Direct Known Subclasses:
JsfGuiBuilder

public abstract class GuiBuilder
extends Object

A factory for creating gui-framework-specific representations of data to be displayed to a user.

A concrete subclass of this type is needed for each specific UI framework. Component-based frameworks (such as JSF) may create component objects and add them to a "component tree", while other frameworks may simply write data to the current response stream.

This base class defines the abstract factory methods, and also provides a number of utility classes for the concrete subclasses to use.


Constructor Summary
GuiBuilder()
           
 
Method Summary
protected  boolean buildField(MetaField field)
          actuallly build the fields gui component
abstract  void createInputBoolean(MetaField field)
          select a boolean
abstract  void createInputDate(MetaField field)
          input date
abstract  void createInputNumber(MetaField field)
          enter a number
abstract  void createInputText(MetaField field)
          input field
abstract  void createNative(MetaField field)
          this is when the user passed in a component to use for the this field
abstract  void createOutputText(MetaField field)
          Output text using the field as value provider.
abstract  void createSearchFor(MetaField field)
          search for component
abstract  void createSearchForSelectMenu(MetaField field)
          search for component
abstract  void createSelectOneMenu(MetaField field)
          select one menu
 javax.faces.component.UIComponent getDestCmp()
           
 Map<String,String> getLabelBundle()
           
 boolean isFieldDisplayOnly(MetaField field)
          Returns true if this field should be rendered display only.
 boolean isIdAsDisplayOnly()
           
 void setDestCmp(javax.faces.component.UIComponent destCmp)
           
 void setFormDisplayOnly(boolean displayOnly)
          Set to true if the guiBuilder should build a read-only form only.
 void setIdAsDisplayOnly(boolean idAsDisplayOnly)
          set if the guiBuilder should build all id fields display only
 void setLabelBundle(Map<String,String> labelBundle)
          The resource bundle to be used when translating field names into text labels.
protected  String translateText(String key, String dflt)
          Localise a text string using the resource-bundle specified for the dynaform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiBuilder

public GuiBuilder()
Method Detail

setDestCmp

public void setDestCmp(javax.faces.component.UIComponent destCmp)

getDestCmp

public javax.faces.component.UIComponent getDestCmp()

isFieldDisplayOnly

public boolean isFieldDisplayOnly(MetaField field)
Returns true if this field should be rendered display only.


setFormDisplayOnly

public void setFormDisplayOnly(boolean displayOnly)
Set to true if the guiBuilder should build a read-only form only.


isIdAsDisplayOnly

public boolean isIdAsDisplayOnly()
See Also:
setIdAsDisplayOnly(boolean)

setIdAsDisplayOnly

public void setIdAsDisplayOnly(boolean idAsDisplayOnly)
set if the guiBuilder should build all id fields display only


getLabelBundle

public Map<String,String> getLabelBundle()
See Also:
setLabelBundle(Map)

setLabelBundle

public void setLabelBundle(Map<String,String> labelBundle)
The resource bundle to be used when translating field names into text labels.

A labelBundle is optional; if not specified then the field name will be used as the label. In addition, if a field-name is not defined in the resource bundle then the raw field-name will also be used.


createOutputText

public abstract void createOutputText(MetaField field)
Output text using the field as value provider.


createInputText

public abstract void createInputText(MetaField field)
input field


createInputDate

public abstract void createInputDate(MetaField field)
input date


createSelectOneMenu

public abstract void createSelectOneMenu(MetaField field)
select one menu


createInputNumber

public abstract void createInputNumber(MetaField field)
enter a number


createInputBoolean

public abstract void createInputBoolean(MetaField field)
select a boolean


createSearchFor

public abstract void createSearchFor(MetaField field)
search for component


createSearchForSelectMenu

public abstract void createSearchForSelectMenu(MetaField field)
search for component


createNative

public abstract void createNative(MetaField field)
this is when the user passed in a component to use for the this field


buildField

protected boolean buildField(MetaField field)
actuallly build the fields gui component


translateText

protected String translateText(String key,
                               String dflt)
Localise a text string using the resource-bundle specified for the dynaform.

If the key is null, or there is no resource-bundle, or there is no entry in the resource bundle for the specified key, then return the dflt string.



Copyright © 2012 The Apache Software Foundation. All Rights Reserved.