|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.doui.control.Control lumis.doui.control.DataControl
@StableMinor(version="4.1", sinceVersion="4.0") public abstract class DataControl
Base implementation for IDataControl
Field Summary | |
---|---|
static String |
FORCE_CASE_LOWER
|
static String |
FORCE_CASE_NONE
|
static String |
FORCE_CASE_UPPER
|
protected String |
forceCase
|
protected String |
requestParameterName
|
protected IDouiDataType |
UNKNOWN_DATA_TYPE
The instance used for dataType for controls for which the data type is not known. |
protected Object |
value
|
protected boolean |
valuePreviouslySet
|
Constructor Summary | |
---|---|
DataControl()
|
Method Summary | ||
---|---|---|
protected Object |
convertValueToControlValue(Object value,
Locale locale,
String pattern)
Method to centralize the implementation of conversion of a value to this control's value. |
|
protected IConverter |
createConverter()
Creates the converter instance for this control. |
|
protected IDouiDataType |
createDataType()
Creates the data type to be used for this control. |
|
IConverter |
getConverter()
Returns the converter that is able to convert this control's value. |
|
protected IDouiDataType |
getDataType()
Returns the data type for this control. |
|
protected Object |
getDefaultValue()
|
|
protected String |
getProcessActionHandlerParameterName()
Define the name of the process action parameter to be set. |
|
protected String |
getRequestParameterName()
|
|
Object |
getValue()
|
|
|
getValue(Class<T> expectedClass)
|
|
protected Class<?> |
getValueClass()
Returns the class the possible values of this control are assignable to. |
|
void |
init(Node controlDefinitionNode,
ControlContainer controlContainer,
IControl parentControl)
|
|
protected boolean |
isTrim()
Returns if the value for this control should be trimmed. |
|
void |
loadFromRequest()
|
|
protected void |
loadSubControlFromRequest(IControl control)
|
|
protected void |
loadSubControlsFromRequest()
|
|
protected void |
setDefaultValue()
|
|
protected void |
setProcessActionHandlerParameter(IProcessActionHandler processActionHandler,
String parameterName)
Set the process action parameter for the control, defining the appropriate value. |
|
void |
setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
Sets the control value as a process action handler parameter. |
|
protected void |
setRawValue(Object value)
Sets directly the value in this control. |
|
protected void |
setTrim(boolean trim)
Sets if the value for this control should be trimmed. |
|
void |
setValue(Object value)
Sets the value for this control. |
|
boolean |
valueIsArray()
Returns true if the value in the control is expected to be an array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface lumis.doui.control.IControl |
---|
buildSubControls, createContainer, disconnect, getChildControls, getControlResource, getId, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRenderData, setRuntimeAttributes, setValid |
Methods inherited from interface lumis.doui.render.IRenderer |
---|
getResources, getSourceContext |
Field Detail |
---|
public static final String FORCE_CASE_NONE
public static final String FORCE_CASE_UPPER
public static final String FORCE_CASE_LOWER
protected final IDouiDataType UNKNOWN_DATA_TYPE
createDataType()
,
getDataType()
protected String forceCase
protected Object value
protected boolean valuePreviouslySet
protected String requestParameterName
Constructor Detail |
---|
public DataControl()
Method Detail |
---|
public void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
init
in interface IControl
init
in class Control
PortalException
protected IDouiDataType createDataType() throws PortalException
PortalException
protected final IDouiDataType getDataType()
UNKNOWN_DATA_TYPE
is returned.
createDataType()
protected IConverter createConverter() throws PortalException
PortalException
protected void setDefaultValue() throws PortalException
PortalException
protected Object getDefaultValue() throws PortalException
PortalException
protected Class<?> getValueClass() throws PortalException
This default implementation uses IDouiDataType.getValueClass()
of the data type of this control.
PortalException
protected Object convertValueToControlValue(Object value, Locale locale, String pattern) throws PortalException, ConversionException
Uses this control's converter to convert the value to this control's value class.
value
- the value.locale
- the locale to use in the conversion.pattern
- the pattern to use in the conversion.
ConversionException
- if an exception is thrown by this control's
converter.
PortalException
protected boolean isTrim()
setValue(Object)
method.
protected void setTrim(boolean trim)
trim
- true to enable the trimming or false to disable it.
This does not affect the value already set in the control.isTrim()
public void setValue(Object value) throws PortalException
convertValueToControlValue(Object, Locale, String)
. Then
the value is set using setRawValue(Object)
.
setValue
in interface IDataControl
value
- the value to set. It is automatically converted
as necessary.
PortalException
protected void setRawValue(Object value) throws PortalException
value
- the value to set.
PortalException
public Object getValue() throws PortalException
getValue
in interface IDataControl
PortalException
public <T> T getValue(Class<T> expectedClass) throws PortalException
getValue
in interface IDataControl
PortalException
protected String getRequestParameterName() throws PortalException
PortalException
public void loadFromRequest() throws PortalException
loadFromRequest
in interface IDataControl
PortalException
public boolean valueIsArray() throws PortalException
PortalException
protected void loadSubControlsFromRequest() throws PortalException
PortalException
protected void loadSubControlFromRequest(IControl control) throws PortalException
PortalException
public void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler) throws PortalException
setProcessActionHandlerParameters
in interface IDataControl
processActionHandler
-
PortalException
protected void setProcessActionHandlerParameter(IProcessActionHandler processActionHandler, String parameterName) throws PortalException
processActionHandler
- parameterName
-
PortalException
protected String getProcessActionHandlerParameterName() throws PortalException
PortalException
public IConverter getConverter() throws PortalException
IDataControl
getConverter
in interface IDataControl
getConverter
in interface IRenderer
PortalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |