org.apache.myfaces.custom.dynaForm.guiBuilder.impl.jsf
Class JsfGuiBuilder

java.lang.Object
  extended by org.apache.myfaces.custom.dynaForm.guiBuilder.GuiBuilder
      extended by org.apache.myfaces.custom.dynaForm.guiBuilder.impl.jsf.JsfGuiBuilder
Direct Known Subclasses:
JsfGuiBuilderDecorator, MyFacesGuiBuilder

public class JsfGuiBuilder
extends GuiBuilder

concrete gui builder which knows how to build JSF forms


Field Summary
static java.lang.String SEARCH_ENTITY_BINDING
           
static java.lang.String SEARCH_ENTITY_TYPE
           
 
Constructor Summary
JsfGuiBuilder()
           
 
Method Summary
static void addElementBuilder(java.lang.Class elementType, JsfGuiElementBuilder builder)
          Add a specialized builder.
protected  void attachLengthValidator(javax.faces.component.html.HtmlInputText cmp, int minSize, int maxSize)
           
protected  void attachRangeValidator(javax.faces.component.html.HtmlInputText cmp, java.lang.Double minValue, java.lang.Double maxValue)
           
protected  boolean buildField(FieldInterface field)
          actuallly build the fields gui component
static javax.faces.component.UIComponent cloneComponent(javax.faces.component.UIComponent uicomponent)
           
 void createInputBoolean(FieldInterface field)
          select a boolean
 void createInputDate(FieldInterface field)
          input date
 void createInputNumber(FieldInterface field)
          enter a number
 void createInputText(FieldInterface field)
          input field
 javax.faces.component.UIOutput createLabelFor(java.lang.String labelText, javax.faces.component.UIComponent cmp)
          create label for the given labelText and if possible attach it to the cmp.
 void createNative(FieldInterface field)
          this is when the user passed in a component to use for the this field
 void createOutputText(FieldInterface field)
          output text using the field as value provider
 javax.faces.component.UIParameter createParameter(java.lang.String name, java.lang.String value)
           
 void createSearchFor(FieldInterface field)
          search for component
 void createSearchForSelectMenu(FieldInterface field)
          search for component
 void createSelectOneMenu(FieldInterface field)
          select one menu
protected  java.lang.String createValueBindingString(FieldInterface field)
           
 javax.faces.component.html.HtmlCommandLink doCreateCommandLink(FieldInterface field)
           
 javax.faces.component.html.HtmlCommandLink doCreateCommandLinkComponent()
           
 javax.faces.convert.Converter doCreateConverter(FieldInterface field)
           
 javax.faces.convert.DateTimeConverter doCreateDateConverter(FieldInterface field)
           
 javax.faces.component.UISelectBoolean doCreateInputBoolean(FieldInterface field)
           
 javax.faces.component.html.HtmlSelectBooleanCheckbox doCreateInputBooleanComponent()
           
 javax.faces.component.html.HtmlInputText doCreateInputDate(FieldInterface field)
           
 javax.faces.component.html.HtmlInputText doCreateInputDateComponent(FieldInterface field)
           
 javax.faces.component.html.HtmlInputText doCreateInputNumber(FieldInterface field)
           
 javax.faces.component.html.HtmlInputText doCreateInputText(FieldInterface field)
           
 javax.faces.component.html.HtmlInputText doCreateInputTextComponent()
           
 void doCreateNative(FieldInterface field, javax.faces.component.UIComponent uicomponent)
           
 javax.faces.component.html.HtmlOutputLabel doCreateOutputLabel(java.lang.String text)
           
 javax.faces.component.html.HtmlOutputLabel doCreateOutputLabelComponent()
           
 javax.faces.component.html.HtmlOutputText doCreateOutputText(FieldInterface field)
           
 javax.faces.component.html.HtmlOutputText doCreateOutputText(java.lang.String text)
           
 javax.faces.component.html.HtmlOutputText doCreateOutputTextComponent()
           
 javax.faces.component.html.HtmlPanelGroup doCreatePanelGroupComponent()
           
 javax.faces.component.UIComponent doCreateSearchFor(FieldInterface field)
           
 javax.faces.component.UIInput doCreateSearchForSelectMenu(FieldInterface field)
           
 javax.faces.component.html.HtmlSelectManyListbox doCreateSelectManyListbox(FieldInterface field)
           
 javax.faces.component.html.HtmlSelectManyListbox doCreateSelectManyListboxComponent()
           
 javax.faces.component.html.HtmlSelectOneMenu doCreateSelectOneMenu(FieldInterface field)
           
 javax.faces.component.html.HtmlSelectOneMenu doCreateSelectOneMenuComponent()
           
 javax.faces.component.UIInput findInputComponent(javax.faces.component.UIComponent cmp)
          searches the first input component.
 void fireNewComponent(FieldInterface field, javax.faces.component.UIComponent cmp)
          jo, we made a component, create a possible label and fire its creation.
 java.lang.String getBackingBeanPrefix()
           
 java.lang.String getBackingEntityPrefix()
           
protected  java.lang.String getCleanedNameForId(java.lang.String name)
          remove all not allowed characters for an jsf ID from the name
 javax.faces.context.FacesContext getContext()
           
 NewComponentListener getNewComponentListener()
           
 void iniCommandDefaults(javax.faces.component.UICommand cmp, FieldInterface field, java.lang.String action, java.lang.String actionListener)
          init defaults specifically for commands
 void initConverter(javax.faces.component.UIOutput cmp, FieldInterface field)
          setup a converter if required
 void initDefaults(javax.faces.component.UIComponent cmp, FieldInterface field)
          init global defaults like id
 void initInputDefaults(javax.faces.component.html.HtmlInputText cmp, FieldInterface field)
          setup all the validators, maxlength, size, ...
 void initInputDefaults(javax.faces.component.UIInput cmp, FieldInterface field)
          setup defaults for input fields like required
 void initOutputDefaults(javax.faces.component.UIOutput cmp, FieldInterface field)
          init global defaults for output fields
 void initSelections(FieldInterface field, javax.faces.component.UIComponent cmp)
          insert possible selection items
 void initValueBinding(javax.faces.component.UIComponent cmp, FieldInterface field)
          init the default value binding
 void setBackingBeanPrefix(java.lang.String backingBeanPrefix)
           
 void setBackingEntityPrefix(java.lang.String backingEntityPrefix)
           
 void setContext(javax.faces.context.FacesContext context)
           
 void setNewComponentListener(NewComponentListener newComponentListener)
           
 
Methods inherited from class org.apache.myfaces.custom.dynaForm.guiBuilder.GuiBuilder
getLabelBundle, isDisplayOnly, setDisplayOnly, setLabelBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_ENTITY_TYPE

public static final java.lang.String SEARCH_ENTITY_TYPE
See Also:
Constant Field Values

SEARCH_ENTITY_BINDING

public static final java.lang.String SEARCH_ENTITY_BINDING
See Also:
Constant Field Values
Constructor Detail

JsfGuiBuilder

public JsfGuiBuilder()
Method Detail

addElementBuilder

public static void addElementBuilder(java.lang.Class elementType,
                                     JsfGuiElementBuilder builder)
Add a specialized builder. This builder will be used instead of any default.


getBackingBeanPrefix

public java.lang.String getBackingBeanPrefix()

setBackingBeanPrefix

public void setBackingBeanPrefix(java.lang.String backingBeanPrefix)

getBackingEntityPrefix

public java.lang.String getBackingEntityPrefix()

setBackingEntityPrefix

public void setBackingEntityPrefix(java.lang.String backingEntityPrefix)

getNewComponentListener

public NewComponentListener getNewComponentListener()

setNewComponentListener

public void setNewComponentListener(NewComponentListener newComponentListener)

setContext

public void setContext(javax.faces.context.FacesContext context)

createOutputText

public void createOutputText(FieldInterface field)
Description copied from class: GuiBuilder
output text using the field as value provider

Specified by:
createOutputText in class GuiBuilder

createInputDate

public void createInputDate(FieldInterface field)
Description copied from class: GuiBuilder
input date

Specified by:
createInputDate in class GuiBuilder

createInputText

public void createInputText(FieldInterface field)
Description copied from class: GuiBuilder
input field

Specified by:
createInputText in class GuiBuilder

createInputNumber

public void createInputNumber(FieldInterface field)
Description copied from class: GuiBuilder
enter a number

Specified by:
createInputNumber in class GuiBuilder

createInputBoolean

public void createInputBoolean(FieldInterface field)
Description copied from class: GuiBuilder
select a boolean

Specified by:
createInputBoolean in class GuiBuilder

createSelectOneMenu

public void createSelectOneMenu(FieldInterface field)
Description copied from class: GuiBuilder
select one menu

Specified by:
createSelectOneMenu in class GuiBuilder

createSearchFor

public void createSearchFor(FieldInterface field)
Description copied from class: GuiBuilder
search for component

Specified by:
createSearchFor in class GuiBuilder

createSearchForSelectMenu

public void createSearchForSelectMenu(FieldInterface field)
Description copied from class: GuiBuilder
search for component

Specified by:
createSearchForSelectMenu in class GuiBuilder

createNative

public void createNative(FieldInterface field)
Description copied from class: GuiBuilder
this is when the user passed in a component to use for the this field

Specified by:
createNative in class GuiBuilder

cloneComponent

public static javax.faces.component.UIComponent cloneComponent(javax.faces.component.UIComponent uicomponent)

doCreateOutputText

public javax.faces.component.html.HtmlOutputText doCreateOutputText(FieldInterface field)

doCreateOutputTextComponent

public javax.faces.component.html.HtmlOutputText doCreateOutputTextComponent()

doCreateOutputLabel

public javax.faces.component.html.HtmlOutputLabel doCreateOutputLabel(java.lang.String text)

doCreateOutputText

public javax.faces.component.html.HtmlOutputText doCreateOutputText(java.lang.String text)

doCreateOutputLabelComponent

public javax.faces.component.html.HtmlOutputLabel doCreateOutputLabelComponent()

doCreateInputDate

public javax.faces.component.html.HtmlInputText doCreateInputDate(FieldInterface field)

doCreateInputDateComponent

public javax.faces.component.html.HtmlInputText doCreateInputDateComponent(FieldInterface field)

doCreateConverter

public javax.faces.convert.Converter doCreateConverter(FieldInterface field)

doCreateDateConverter

public javax.faces.convert.DateTimeConverter doCreateDateConverter(FieldInterface field)

doCreateInputText

public javax.faces.component.html.HtmlInputText doCreateInputText(FieldInterface field)

doCreateInputTextComponent

public javax.faces.component.html.HtmlInputText doCreateInputTextComponent()

doCreateInputBoolean

public javax.faces.component.UISelectBoolean doCreateInputBoolean(FieldInterface field)

doCreateInputBooleanComponent

public javax.faces.component.html.HtmlSelectBooleanCheckbox doCreateInputBooleanComponent()

doCreateInputNumber

public javax.faces.component.html.HtmlInputText doCreateInputNumber(FieldInterface field)

doCreateSelectOneMenu

public javax.faces.component.html.HtmlSelectOneMenu doCreateSelectOneMenu(FieldInterface field)

doCreateSelectManyListbox

public javax.faces.component.html.HtmlSelectManyListbox doCreateSelectManyListbox(FieldInterface field)

doCreateSelectOneMenuComponent

public javax.faces.component.html.HtmlSelectOneMenu doCreateSelectOneMenuComponent()

doCreateSelectManyListboxComponent

public javax.faces.component.html.HtmlSelectManyListbox doCreateSelectManyListboxComponent()

doCreateSearchFor

public javax.faces.component.UIComponent doCreateSearchFor(FieldInterface field)

doCreateSearchForSelectMenu

public javax.faces.component.UIInput doCreateSearchForSelectMenu(FieldInterface field)

doCreateCommandLink

public javax.faces.component.html.HtmlCommandLink doCreateCommandLink(FieldInterface field)

doCreateCommandLinkComponent

public javax.faces.component.html.HtmlCommandLink doCreateCommandLinkComponent()

doCreatePanelGroupComponent

public javax.faces.component.html.HtmlPanelGroup doCreatePanelGroupComponent()

doCreateNative

public void doCreateNative(FieldInterface field,
                           javax.faces.component.UIComponent uicomponent)

createParameter

public javax.faces.component.UIParameter createParameter(java.lang.String name,
                                                         java.lang.String value)

fireNewComponent

public void fireNewComponent(FieldInterface field,
                             javax.faces.component.UIComponent cmp)
jo, we made a component, create a possible label and fire its creation.


createLabelFor

public javax.faces.component.UIOutput createLabelFor(java.lang.String labelText,
                                                     javax.faces.component.UIComponent cmp)
create label for the given labelText and if possible attach it to the cmp.
If the component and none of its child is a UIInput then a simply outputText is generated.


findInputComponent

public javax.faces.component.UIInput findInputComponent(javax.faces.component.UIComponent cmp)
searches the first input component. e.g the one we can the label attach to.


initDefaults

public void initDefaults(javax.faces.component.UIComponent cmp,
                         FieldInterface field)
init global defaults like id


getCleanedNameForId

protected java.lang.String getCleanedNameForId(java.lang.String name)
remove all not allowed characters for an jsf ID from the name


initOutputDefaults

public void initOutputDefaults(javax.faces.component.UIOutput cmp,
                               FieldInterface field)
init global defaults for output fields


initValueBinding

public void initValueBinding(javax.faces.component.UIComponent cmp,
                             FieldInterface field)
init the default value binding


createValueBindingString

protected java.lang.String createValueBindingString(FieldInterface field)

iniCommandDefaults

public void iniCommandDefaults(javax.faces.component.UICommand cmp,
                               FieldInterface field,
                               java.lang.String action,
                               java.lang.String actionListener)
init defaults specifically for commands


initInputDefaults

public void initInputDefaults(javax.faces.component.html.HtmlInputText cmp,
                              FieldInterface field)
setup all the validators, maxlength, size, ... for HtmlInputText fields


attachRangeValidator

protected void attachRangeValidator(javax.faces.component.html.HtmlInputText cmp,
                                    java.lang.Double minValue,
                                    java.lang.Double maxValue)

attachLengthValidator

protected void attachLengthValidator(javax.faces.component.html.HtmlInputText cmp,
                                     int minSize,
                                     int maxSize)

initInputDefaults

public void initInputDefaults(javax.faces.component.UIInput cmp,
                              FieldInterface field)
setup defaults for input fields like required


initConverter

public void initConverter(javax.faces.component.UIOutput cmp,
                          FieldInterface field)
setup a converter if required


initSelections

public void initSelections(FieldInterface field,
                           javax.faces.component.UIComponent cmp)
insert possible selection items


getContext

public javax.faces.context.FacesContext getContext()

buildField

protected boolean buildField(FieldInterface field)
Description copied from class: GuiBuilder
actuallly build the fields gui component

Overrides:
buildField in class GuiBuilder


Copyright © 2011. All Rights Reserved.