Package org.apache.empire.jsf2.controls
Class InputControl
java.lang.Object
org.apache.empire.jsf2.controls.InputControl
- Direct Known Subclasses:
CheckboxInputControl,RadioInputControl,SelectInputControl,TextAreaInputControl,TextInputControl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDisabledTypestatic interfaceThis interface extends the value information by information about the input control used with the renderInput functionstatic interfaceThis interface allows access to a value and its metainformation used with the renderData function -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent) protected voidaddDataValueStyle(StyleClass styleClass, InputControl.ValueInfo vi, Object value) adds style attributes related to the current valueprotected voidaddRemoveStyle(javax.faces.component.UIInput input, String styleName, boolean setStyle) protected voidaddRemoveValueNullStyle(javax.faces.component.UIInput input, boolean nullValue) protected voidclearLocalValues(javax.faces.context.FacesContext context, javax.faces.component.UIComponent comp) protected voidclearSubmittedValue(javax.faces.component.UIInput input) protected voidcopyAttribute(InputControl.InputInfo ii, javax.faces.component.UIInput input, String name) protected voidcopyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input) protected voidcopyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input, String inputId) voidcreateInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context) protected abstract voidcreateInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, List<javax.faces.component.UIComponent> compList) protected ObjectformatInputValue(Object value, InputControl.InputInfo ii) protected StringformatValue(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 detailsformatValue(Object value, InputControl.ValueInfo vi, boolean escapeHtml) Returns the formatted value Do not override this function, but override formatValue(Object, ValueInfo) instead.getConvertedValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, Object submittedValue) final Stringprotected javax.faces.component.UIInputgetFirstInput(List<javax.faces.component.UIComponent> compList) protected intgetFormatInteger(InputControl.ValueInfo vi, String option, String columnAttributeName) protected StringgetFormatOption(InputControl.ValueInfo vi, String option) protected ObjectgetFormatOption(InputControl.ValueInfo vi, String option, String columnAttributeName) protected StringgetFormatString(InputControl.ValueInfo vi, String option, String columnAttributeName) protected javax.faces.component.UIInput[]getInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii) protected intgetInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, boolean submitted) getInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.component.UIInput input, boolean submitted) final StringgetName()protected StringgetOptionText(Options options, Object value, InputControl.ValueInfo vi) Returns the display text for an optionprotected booleanhasFormatOption(InputControl.ValueInfo vi, String option) checks if a particular formating option has been specified.protected booleanhasFormatOption(InputControl.ValueInfo vi, String option, String columnAttributeName) protected Stringbooleanprotected booleanprotected ObjectparseInputValue(Object[] values, InputControl.InputInfo ii) Parses a value for multiple input components All individual values must be combined to a single output valueprotected ObjectparseInputValue(String value, InputControl.InputInfo ii) Parses a value for a single input componentvoidpostUpdateModel(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext fc) voidrenderInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context) Renders the input element(s) for editing the underlying record valuevoidrenderValue(Object value, InputControl.ValueInfo vi, javax.faces.context.ResponseWriter writer) Renders the control value without a surrounding tag (Text only)voidrenderValue(javax.faces.component.UIComponent comp, String tagName, StyleClass styleClass, String tooltip, InputControl.ValueInfo vi, javax.faces.context.FacesContext context) Renders the control value with a surrounding HTML tag, if a tagName is suppliedprotected booleanrestoreSubmittedValue(javax.faces.component.UIInput input, InputControl.InputInfo ii) protected voidsetInputStyleClass(javax.faces.component.UIInput input, InputControl.InputInfo ii) protected voidsetInputStyleClass(javax.faces.component.UIInput input, InputControl.InputInfo ii, StyleClass styleClass) protected voidsetInputStyleClass(javax.faces.component.UIInput input, StyleClass styleClass) protected voidsetInputValue(javax.faces.component.UIInput input, InputControl.InputInfo ii) protected voidsetInputValue(javax.faces.component.UIInput input, InputControl.InputInfo ii, Object value) protected voidsetInputValueExpression(javax.faces.component.UIInput input, javax.el.ValueExpression value, InputControl.InputInfo ii) protected voidupdateAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent) protected abstract voidupdateInputState(List<javax.faces.component.UIComponent> compList, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId) voidupdateInputState(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
-
Field Details
-
CSS_STYLE_CLASS
- See Also:
-
FORMAT_NULL
- See Also:
-
FORMAT_NULL_ATTRIBUTE
- See Also:
-
FORMAT_NO_VALUE_STYLES
- See Also:
-
HTML_TAG_DIV
- See Also:
-
HTML_TAG_SPAN
- See Also:
-
HTML_TAG_TABLE
- See Also:
-
HTML_TAG_TR
- See Also:
-
HTML_TAG_TD
- See Also:
-
HTML_TAG_INPUT
- See Also:
-
HTML_TAG_LABEL
- See Also:
-
HTML_ATTR_ID
- See Also:
-
HTML_ATTR_CLASS
- See Also:
-
HTML_ATTR_STYLE
- See Also:
-
HTML_ATTR_TYPE
- See Also:
-
HTML_ATTR_DISABLED
- See Also:
-
HTML_ATTR_CHECKED
- See Also:
-
HTML_EXPR_NBSP
-
-
Constructor Details
-
InputControl
-
-
Method Details
-
getName
-
getCssStyleClass
-
getLabelForId
-
isCreatingComponents
public boolean isCreatingComponents() -
getInputCount
-
createInput
public void createInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context) -
formatValue
Returns the formatted value Do not override this function, but override formatValue(Object, ValueInfo) instead.- Parameters:
value- the value to formatvi- the valueInfoescapeHtml- when true the value will be escaped for Html- Returns:
- the formatted value
-
renderValue
public void renderValue(javax.faces.component.UIComponent comp, String tagName, StyleClass styleClass, String tooltip, InputControl.ValueInfo vi, javax.faces.context.FacesContext context) throws IOException Renders the control value with a surrounding HTML tag, if a tagName is supplied- Parameters:
comp- the JSF componenttagName- the tag name of the HTML wrapper tag (optional)styleClass- the style class of the HTML wrapper tag (optional)tooltip- the title of the HTML wrapper tag (optional)vi- the value infocontext- the FacesContext- Throws:
IOException- from ResponseWriter
-
renderValue
public void renderValue(Object value, InputControl.ValueInfo vi, javax.faces.context.ResponseWriter writer) throws IOException Renders the control value without a surrounding tag (Text only)- Parameters:
value- the value to rendervi- the value infowriter- the output writer- Throws:
IOException- from ResponseWriter
-
renderInput
public void renderInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context) throws IOException Renders the input element(s) for editing the underlying record value- Parameters:
comp- the JSF componentii- the input infocontext- the FacesContext- Throws:
IOException- from ResponseWriter
-
updateInputState
public void updateInputState(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId) -
postUpdateModel
public void postUpdateModel(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext fc) -
getInputValue
public Object getInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.component.UIInput input, boolean submitted) -
getInputValue
public Object getInputValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, boolean submitted) -
getConvertedValue
public Object getConvertedValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, Object submittedValue) -
initCssStyleClass
-
addDataValueStyle
adds style attributes related to the current value- Parameters:
styleClass- the style classvi- the value infovalue- the current value
-
addAttachedObjects
protected void addAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent) -
updateAttachedObjects
protected void updateAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent) -
isInputValueExpressionEnabled
protected boolean isInputValueExpressionEnabled() -
setInputValue
protected void setInputValue(javax.faces.component.UIInput input, InputControl.InputInfo ii, Object value) -
setInputValue
-
setInputValueExpression
protected void setInputValueExpression(javax.faces.component.UIInput input, javax.el.ValueExpression value, InputControl.InputInfo ii) -
restoreSubmittedValue
protected boolean restoreSubmittedValue(javax.faces.component.UIInput input, InputControl.InputInfo ii) -
clearSubmittedValue
protected void clearSubmittedValue(javax.faces.component.UIInput input) -
clearLocalValues
protected void clearLocalValues(javax.faces.context.FacesContext context, javax.faces.component.UIComponent comp) -
formatInputValue
-
parseInputValue
Parses a value for a single input component- Parameters:
value- the value to parseii- the input info- Returns:
- the parsed and converted value
-
parseInputValue
Parses a value for multiple input components All individual values must be combined to a single output value- Parameters:
values- the input valuesii- the input info- Returns:
- the combined value
-
createInputComponents
protected abstract void createInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, List<javax.faces.component.UIComponent> compList) -
updateInputState
protected abstract void updateInputState(List<javax.faces.component.UIComponent> compList, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId) -
getFirstInput
protected javax.faces.component.UIInput getFirstInput(List<javax.faces.component.UIComponent> compList) -
getInputComponents
protected javax.faces.component.UIInput[] getInputComponents(javax.faces.component.UIComponent parent, InputControl.InputInfo ii) -
setInputStyleClass
-
setInputStyleClass
protected void setInputStyleClass(javax.faces.component.UIInput input, InputControl.InputInfo ii, StyleClass styleClass) -
setInputStyleClass
-
copyAttributes
protected void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input, String inputId) -
copyAttributes
protected void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input) -
copyAttribute
protected void copyAttribute(InputControl.InputInfo ii, javax.faces.component.UIInput input, String name) -
addRemoveValueNullStyle
protected void addRemoveValueNullStyle(javax.faces.component.UIInput input, boolean nullValue) -
addRemoveStyle
protected void addRemoveStyle(javax.faces.component.UIInput input, String styleName, boolean setStyle) -
formatValue
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 formattedvi- Meta-information about the value- Returns:
- the formatted value
-
getOptionText
Returns the display text for an option- Parameters:
options- the optionsvalue- the valuevi- the value info- Returns:
- the display text or null if the option value could not be resolved
-
hasFormatOption
checks if a particular formating option has been specified.- Parameters:
vi- the value infooption- the formating option to check- Returns:
- true if the requested formating option has been specified or false otherwise
-
hasFormatOption
protected boolean hasFormatOption(InputControl.ValueInfo vi, String option, String columnAttributeName) -
getFormatOption
-
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)
-