org.apache.empire.jsf2.controls
Class InputControl

java.lang.Object
  extended by org.apache.empire.jsf2.controls.InputControl
Direct Known Subclasses:
CheckboxInputControl, SelectInputControl, TextAreaInputControl, TextInputControl

public abstract class InputControl
extends Object


Nested Class Summary
static interface InputControl.InputInfo
          This interface extends the value information by information about the input control used with the renderInput function
static interface InputControl.ValueInfo
          This interface allows access to a value and its metainformation used with the renderData function
 
Field Summary
static String CURRENCY_CODE_ATTRIBUTE
           
static String FORMAT_NULL
           
static String FORMAT_NULL_ATTRIBUTE
           
static String MAXVALUE_ATTRIBUTE
           
static String MINVALUE_ATTRIBUTE
           
static String NUMBER_FRACTION_DIGITS
           
static String NUMBER_GROUPSEP_ATTRIBUTE
           
static String NUMBER_TYPE_ATTRIBUTE
           
 
Constructor Summary
  InputControl()
           
protected InputControl(String name)
           
 
Method Summary
protected  void copyAttribute(javax.faces.component.UIComponent parent, javax.faces.component.UIInput input, String name)
           
protected  void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input)
           
protected  void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input, String additonalStyle)
           
protected abstract  void createInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, List<javax.faces.component.UIComponent> compList)
           
protected  String escapeHTML(String text)
          escapes a String for html
protected  String formatValue(InputControl.ValueInfo vi)
          Returns the value formated as a string This is a shortcut for formatString(vi.getValue(), vi) Derived classes may override formatString
protected  String formatValue(Object value, InputControl.ValueInfo vi, boolean hasError)
          Returns the value formated as a string this is a simple default implementation that does no type-secific formatting Derived classes may override formatString an provide further formmatting see TextInputControl for details
protected  int getFormatInteger(InputControl.ValueInfo vi, String option, String columnAttributeName)
           
protected  Object getFormatOption(InputControl.ValueInfo vi, String option, String columnAttributeName)
           
protected  String getFormatString(InputControl.ValueInfo vi, String option, String columnAttributeName)
           
protected  javax.faces.component.UIInput getInputComponent(javax.faces.component.UIComponent parent)
           
 Object getInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, boolean submitted)
           
 String getName()
           
protected  boolean hasFormatOption(InputControl.ValueInfo vi, String option)
          checks if a particular formating option has been specified.
 void renderInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context, boolean encode)
           
 void renderValue(InputControl.ValueInfo vi, javax.faces.context.ResponseWriter writer)
           
protected  void setInputValue(javax.faces.component.UIInput input, InputControl.InputInfo ii)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_TYPE_ATTRIBUTE

public static final String NUMBER_TYPE_ATTRIBUTE
See Also:
Constant Field Values

NUMBER_GROUPSEP_ATTRIBUTE

public static final String NUMBER_GROUPSEP_ATTRIBUTE
See Also:
Constant Field Values

NUMBER_FRACTION_DIGITS

public static final String NUMBER_FRACTION_DIGITS
See Also:
Constant Field Values

MINVALUE_ATTRIBUTE

public static final String MINVALUE_ATTRIBUTE
See Also:
Constant Field Values

MAXVALUE_ATTRIBUTE

public static final String MAXVALUE_ATTRIBUTE
See Also:
Constant Field Values

CURRENCY_CODE_ATTRIBUTE

public static final String CURRENCY_CODE_ATTRIBUTE
See Also:
Constant Field Values

FORMAT_NULL

public static final String FORMAT_NULL
See Also:
Constant Field Values

FORMAT_NULL_ATTRIBUTE

public static final String FORMAT_NULL_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

InputControl

public InputControl()

InputControl

protected InputControl(String name)
Method Detail

getName

public final String getName()

renderValue

public void renderValue(InputControl.ValueInfo vi,
                        javax.faces.context.ResponseWriter writer)
                 throws IOException
Throws:
IOException

renderInput

public void renderInput(javax.faces.component.UIComponent comp,
                        InputControl.InputInfo ii,
                        javax.faces.context.FacesContext context,
                        boolean encode)
                 throws IOException
Throws:
IOException

getInputValue

public Object getInputValue(javax.faces.component.UIComponent comp,
                            InputControl.InputInfo ii,
                            boolean submitted)

setInputValue

protected void setInputValue(javax.faces.component.UIInput input,
                             InputControl.InputInfo ii)

createInputComponents

protected abstract void createInputComponents(javax.faces.component.UIComponent parent,
                                              InputControl.InputInfo ii,
                                              javax.faces.context.FacesContext context,
                                              List<javax.faces.component.UIComponent> compList)

getInputComponent

protected javax.faces.component.UIInput getInputComponent(javax.faces.component.UIComponent parent)

copyAttributes

protected void copyAttributes(javax.faces.component.UIComponent parent,
                              InputControl.InputInfo ii,
                              javax.faces.component.UIInput input,
                              String additonalStyle)

copyAttributes

protected final void copyAttributes(javax.faces.component.UIComponent parent,
                                    InputControl.InputInfo ii,
                                    javax.faces.component.UIInput input)

copyAttribute

protected void copyAttribute(javax.faces.component.UIComponent parent,
                             javax.faces.component.UIInput input,
                             String name)

formatValue

protected String formatValue(Object value,
                             InputControl.ValueInfo vi,
                             boolean hasError)
Returns the value formated as a string this is a simple default implementation that does no type-secific formatting Derived classes may override formatString an provide further formmatting see TextInputControl for details

Parameters:
value - the value to be formatted
vi - Meta-information about the value
Returns:
the formatted value

formatValue

protected final String formatValue(InputControl.ValueInfo vi)
Returns the value formated as a string This is a shortcut for formatString(vi.getValue(), vi) Derived classes may override formatString


escapeHTML

protected String escapeHTML(String text)
escapes a String for html

Parameters:
text -
Returns:
the escaped html String

hasFormatOption

protected boolean hasFormatOption(InputControl.ValueInfo vi,
                                  String option)
checks if a particular formating option has been specified.

Parameters:
vi - the value info
option - the formating option to check
Returns:
true if the requested formating option has been specified or false otherwise

getFormatOption

protected Object getFormatOption(InputControl.ValueInfo vi,
                                 String option,
                                 String columnAttributeName)

getFormatString

protected String getFormatString(InputControl.ValueInfo vi,
                                 String option,
                                 String columnAttributeName)

getFormatInteger

protected int getFormatInteger(InputControl.ValueInfo vi,
                               String option,
                               String columnAttributeName)


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.