public abstract class InputControl extends Object
Modifier and Type | Class and Description |
---|---|
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
|
Modifier and Type | Field and Description |
---|---|
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 |
Modifier | Constructor and Description |
---|---|
|
InputControl() |
protected |
InputControl(String name) |
Modifier and Type | Method and Description |
---|---|
void |
addRemoveDisabledStyle(javax.faces.component.UIInput input,
boolean disabled) |
void |
addRemoveInvalidStyle(javax.faces.component.UIInput input,
boolean invalid) |
void |
addRemoveStyle(javax.faces.component.UIInput input,
String styleName,
boolean setStyle) |
protected void |
clearSubmittedValue(javax.faces.component.UIInput input) |
protected void |
copyAttribute(InputControl.InputInfo ii,
javax.faces.component.UIInput input,
String name)
copies a single attribute
|
protected void |
copyAttributes(javax.faces.component.UIComponent parent,
InputControl.InputInfo ii,
javax.faces.component.UIInput input)
copies standard input attributes such as styleClass, style, tabindex and event handlers (onclick, onblur, etc.) from the parent component to the input
|
protected void |
copyAttributes(javax.faces.component.UIComponent parent,
InputControl.InputInfo ii,
javax.faces.component.UIInput input,
String additonalStyle)
copies standard input attributes such as styleClass, style, tabindex and event handlers (onclick, onblur, etc.) from the parent component to the input
|
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 Object |
formatInputValue(Object value,
InputControl.InputInfo ii)
Override this to format a value for output
|
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)
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 String |
getFormatOption(InputControl.ValueInfo vi,
String option) |
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)
returns the first UIInput component that is a direct child of the parent component
|
Object |
getInputValue(javax.faces.component.UIComponent comp,
InputControl.InputInfo ii,
boolean submitted) |
String |
getLabelForId(InputControl.InputInfo ii) |
String |
getName() |
protected boolean |
hasFormatOption(InputControl.ValueInfo vi,
String option)
checks if a particular formating option has been specified.
|
protected Object |
parseInputValue(String value,
InputControl.InputInfo ii) |
void |
postUpdateModel(javax.faces.component.UIComponent comp,
InputControl.InputInfo ii,
javax.faces.context.FacesContext fc) |
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) |
public static final String NUMBER_TYPE_ATTRIBUTE
public static final String NUMBER_GROUPSEP_ATTRIBUTE
public static final String NUMBER_FRACTION_DIGITS
public static final String MINVALUE_ATTRIBUTE
public static final String MAXVALUE_ATTRIBUTE
public static final String CURRENCY_CODE_ATTRIBUTE
public static final String FORMAT_NULL
public static final String FORMAT_NULL_ATTRIBUTE
public InputControl()
protected InputControl(String name)
public final String getName()
public String getLabelForId(InputControl.InputInfo ii)
public void renderValue(InputControl.ValueInfo vi, javax.faces.context.ResponseWriter writer) throws IOException
IOException
public void renderInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context, boolean encode) throws IOException
IOException
public void postUpdateModel(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext fc)
public Object getInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, boolean submitted)
protected void setInputValue(javax.faces.component.UIInput input, InputControl.InputInfo ii)
protected void clearSubmittedValue(javax.faces.component.UIInput input)
protected Object formatInputValue(Object value, InputControl.InputInfo ii)
value
- ii
- protected Object parseInputValue(String value, InputControl.InputInfo ii)
protected abstract void createInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, List<javax.faces.component.UIComponent> compList)
protected javax.faces.component.UIInput getInputComponent(javax.faces.component.UIComponent parent)
parent
- the parent component which node to search forprotected void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input, String additonalStyle)
parent
- (not used)ii
- the input info from which to obtain the attribute valuesinput
- the input component on which to set the attributesadditonalStyle
- additional style classesprotected final void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input)
parent
- (not used)ii
- the input infoinput
- the input component on which to set the attributesprotected void copyAttribute(InputControl.InputInfo ii, javax.faces.component.UIInput input, String name)
ii
- input
- name
- public void addRemoveDisabledStyle(javax.faces.component.UIInput input, boolean disabled)
public void addRemoveInvalidStyle(javax.faces.component.UIInput input, boolean invalid)
public void addRemoveStyle(javax.faces.component.UIInput input, String styleName, boolean setStyle)
protected String formatValue(Object value, InputControl.ValueInfo vi)
value
- the value to be formattedvi
- Meta-information about the valueprotected final String formatValue(InputControl.ValueInfo vi)
protected String escapeHTML(String text)
text
- protected boolean hasFormatOption(InputControl.ValueInfo vi, String option)
vi
- the value infooption
- the formating option to checkprotected String getFormatOption(InputControl.ValueInfo vi, String option)
protected Object getFormatOption(InputControl.ValueInfo vi, String option, String columnAttributeName)
protected String getFormatString(InputControl.ValueInfo vi, String option, String columnAttributeName)
protected int getFormatInteger(InputControl.ValueInfo vi, String option, String columnAttributeName)
Copyright © 2008–2015 Apache Software Foundation. All rights reserved.