public abstract class InputControl extends Object
Modifier and Type | Class and Description |
---|---|
static class |
InputControl.DisabledType
DisabledType
|
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 |
FORMAT_NULL |
static String |
FORMAT_NULL_ATTRIBUTE |
static String |
FORMAT_VALUE_STYLES |
static String |
FORMAT_VALUE_STYLES_ATTRIBUTE |
static String |
HTML_ATTR_CHECKED |
static String |
HTML_ATTR_CLASS |
static String |
HTML_ATTR_DISABLED |
static String |
HTML_ATTR_ID |
static String |
HTML_ATTR_STYLE |
static String |
HTML_ATTR_TYPE |
static String |
HTML_EXPR_NBSP |
static String |
HTML_TAG_DIV |
static String |
HTML_TAG_INPUT |
static String |
HTML_TAG_LABEL |
static String |
HTML_TAG_SPAN |
static String |
HTML_TAG_TABLE |
static String |
HTML_TAG_TD |
static String |
HTML_TAG_TR |
static String |
STYLECLASS_MODIFIED |
static String |
STYLECLASS_REQUIRED |
Modifier | Constructor and Description |
---|---|
|
InputControl() |
protected |
InputControl(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAttachedObjects(javax.faces.component.UIComponent parent,
javax.faces.context.FacesContext context,
InputControl.InputInfo ii,
javax.faces.component.UIComponentBase inputComponent) |
protected String |
addDataValueStyle(InputControl.ValueInfo vi,
Object value,
String styleClass)
adds style attributes related to the current value
|
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) |
void |
addRemoveValueNullStyle(javax.faces.component.UIInput input,
boolean nullValue) |
protected void |
clearSubmittedValue(javax.faces.component.UIInput input) |
protected void |
copyAttribute(InputControl.InputInfo ii,
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) |
void |
createInput(javax.faces.component.UIComponent comp,
InputControl.InputInfo ii,
javax.faces.context.FacesContext context) |
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
|
Object |
getConvertedValue(javax.faces.component.UIComponent comp,
InputControl.InputInfo ii,
Object submittedValue) |
protected javax.faces.component.UIInput |
getFirstInput(List<javax.faces.component.UIComponent> compList) |
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) |
protected String |
getInputStyleClass(InputControl.InputInfo ii,
String additonalStyle) |
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 boolean |
hasFormatOption(InputControl.ValueInfo vi,
String option,
String columnAttributeName) |
boolean |
isCreatingComponents() |
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)
Renders the input element(s) for editing the underlying record value
|
void |
renderValue(InputControl.ValueInfo vi,
javax.faces.context.ResponseWriter writer)
Renders the control value without a surrounding tag (Text only)
|
void |
renderValue(javax.faces.component.UIComponent comp,
String tagName,
String styleClass,
String tooltip,
InputControl.ValueInfo vi,
javax.faces.context.FacesContext context)
Renders the control value with a surrounding HTML tag, if a tagName is supplied
|
protected void |
setInputStyleClass(javax.faces.component.UIInput input,
String cssStyleClass) |
protected void |
setInputValue(javax.faces.component.UIInput input,
InputControl.InputInfo ii) |
protected void |
updateAttachedObjects(javax.faces.component.UIComponent parent,
javax.faces.context.FacesContext context,
InputControl.InputInfo ii,
javax.faces.component.UIComponentBase inputComponent) |
protected abstract void |
updateInputState(List<javax.faces.component.UIComponent> compList,
InputControl.InputInfo ii,
javax.faces.context.FacesContext context,
javax.faces.event.PhaseId phaseId) |
void |
updateInputState(javax.faces.component.UIComponent parent,
InputControl.InputInfo ii,
javax.faces.context.FacesContext context,
javax.faces.event.PhaseId phaseId) |
public static final String FORMAT_NULL
public static final String FORMAT_NULL_ATTRIBUTE
public static final String FORMAT_VALUE_STYLES
public static final String FORMAT_VALUE_STYLES_ATTRIBUTE
public static final String HTML_TAG_DIV
public static final String HTML_TAG_SPAN
public static final String HTML_TAG_TABLE
public static final String HTML_TAG_TR
public static final String HTML_TAG_TD
public static final String HTML_TAG_INPUT
public static final String HTML_TAG_LABEL
public static final String HTML_ATTR_ID
public static final String HTML_ATTR_CLASS
public static final String HTML_ATTR_STYLE
public static final String HTML_ATTR_TYPE
public static final String HTML_ATTR_DISABLED
public static final String HTML_ATTR_CHECKED
public static String HTML_EXPR_NBSP
public static final String STYLECLASS_REQUIRED
public static final String STYLECLASS_MODIFIED
public InputControl()
protected InputControl(String name)
public final String getName()
public String getLabelForId(InputControl.InputInfo ii)
public boolean isCreatingComponents()
public void createInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context)
public void renderValue(javax.faces.component.UIComponent comp, String tagName, String styleClass, String tooltip, InputControl.ValueInfo vi, javax.faces.context.FacesContext context) throws IOException
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 FacesContextIOException
public void renderValue(InputControl.ValueInfo vi, javax.faces.context.ResponseWriter writer) throws IOException
vi
- the value infowriter
- the output writerIOException
public void renderInput(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, javax.faces.context.FacesContext context) throws IOException
comp
- the JSF componentii
- the input infocontext
- the FacesContextIOException
public void updateInputState(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
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)
public Object getConvertedValue(javax.faces.component.UIComponent comp, InputControl.InputInfo ii, Object submittedValue)
protected String addDataValueStyle(InputControl.ValueInfo vi, Object value, String styleClass)
vi
- value
- the current valuestyleClass
- protected void addAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent)
protected void updateAttachedObjects(javax.faces.component.UIComponent parent, javax.faces.context.FacesContext context, InputControl.InputInfo ii, javax.faces.component.UIComponentBase inputComponent)
protected javax.faces.component.UIInput getFirstInput(List<javax.faces.component.UIComponent> compList)
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 abstract void updateInputState(List<javax.faces.component.UIComponent> compList, InputControl.InputInfo ii, javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
protected javax.faces.component.UIInput getInputComponent(javax.faces.component.UIComponent parent)
protected String getInputStyleClass(InputControl.InputInfo ii, String additonalStyle)
protected void setInputStyleClass(javax.faces.component.UIInput input, String cssStyleClass)
protected void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input, String additonalStyle)
protected final void copyAttributes(javax.faces.component.UIComponent parent, InputControl.InputInfo ii, javax.faces.component.UIInput input)
protected void copyAttribute(InputControl.InputInfo ii, javax.faces.component.UIInput input, String name)
public void addRemoveValueNullStyle(javax.faces.component.UIInput input, boolean nullValue)
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 boolean hasFormatOption(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 int getFormatInteger(InputControl.ValueInfo vi, String option, String columnAttributeName)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.