Package com.openhtmltopdf.simple.xhtml
Interface FormControl
- All Known Implementing Classes:
AbstractControl,ButtonControl,CheckControl,HiddenControl,SelectControl,TextControl
public interface FormControl
Interface describing a form control.
- Author:
- Vianney le Clément
-
Method Summary
Modifier and Type Method Description voidaddFormControlListener(FormControlListener listener)ElementgetElement()XhtmlFormgetForm()StringgetInitialValue()String[]getMultipleValues()StringgetName()StringgetValue()booleanisEnabled()Is this control enabled?booleanisMultiple()booleanisSuccessful()Is this control successful?voidremoveFormControlListener(FormControlListener listener)voidreset()Reset the control to it's initial statevoidsetEnabled(boolean enabled)Enable/disable this controlvoidsetMultipleValues(String[] values)Sets the control's current values (when isMultiple returns true).voidsetSuccessful(boolean successful)Sets this control's successful state.voidsetValue(String value)Sets the control's current value.
-
Method Details
-
getElement
Element getElement()- Returns:
- the associated element
-
getForm
XhtmlForm getForm()- Returns:
- the associated form
-
addFormControlListener
-
removeFormControlListener
-
getName
String getName()- Returns:
- the name of the control
-
isEnabled
boolean isEnabled()Is this control enabled?- Returns:
trueif this control is enabled
-
setEnabled
void setEnabled(boolean enabled)Enable/disable this control- Parameters:
enabled-
-
getInitialValue
String getInitialValue()- Returns:
- the initial value
-
isSuccessful
boolean isSuccessful()Is this control successful?- Returns:
trueif this control is successful and its name-value pair should be submitted,falseotherwise.
-
isMultiple
boolean isMultiple()- Returns:
trueif this control accepts multiple values,falseotherwise
-
setSuccessful
void setSuccessful(boolean successful)Sets this control's successful state.- Parameters:
successful-
-
getValue
String getValue()- Returns:
- the control's current value or
nullif isMultiple returns true
-
setValue
Sets the control's current value. This has no effect when isMultiple returns true.- Parameters:
value-
-
getMultipleValues
String[] getMultipleValues()- Returns:
- the control's current values or
nullif isMultiple returns false
-
setMultipleValues
Sets the control's current values (when isMultiple returns true). This has no effect when isMultiple returns false.- Parameters:
values-
-
reset
void reset()Reset the control to it's initial state
-