Class AbstractControl
java.lang.Object
org.xhtmlrenderer.simple.xhtml.controls.AbstractControl
- All Implemented Interfaces:
FormControl
- Direct Known Subclasses:
ButtonControl
,CheckControl
,HiddenControl
,SelectControl
,TextControl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFormControlListener
(FormControlListener listener) static String
protected void
protected void
protected void
getForm()
static int
getIntAttribute
(Element e, String attribute, int def) String[]
getName()
private static String
final String
getValue()
boolean
Is this control enabled?boolean
isHidden()
boolean
boolean
Is this control successful?void
removeFormControlListener
(FormControlListener listener) void
reset()
Reset the control to it's initial statevoid
setEnabled
(boolean enabled) Enable/disable this controlprotected final void
setInitialValue
(String value) void
setMultipleValues
(String[] values) Sets the control's current values (when isMultiple returns true).void
setSuccessful
(boolean successful) Sets this control's successful state.void
Sets the control's current value.
-
Field Details
-
_form
-
_element
-
_name
-
_initialValue
-
_value
-
_successful
private boolean _successful -
_enabled
private boolean _enabled -
_listeners
-
-
Constructor Details
-
AbstractControl
-
-
Method Details
-
getNameOrId
-
fireChanged
protected void fireChanged() -
fireSuccessful
protected void fireSuccessful() -
fireEnabled
protected void fireEnabled() -
addFormControlListener
- Specified by:
addFormControlListener
in interfaceFormControl
-
removeFormControlListener
- Specified by:
removeFormControlListener
in interfaceFormControl
-
getElement
- Specified by:
getElement
in interfaceFormControl
- Returns:
- the associated element
-
getForm
- Specified by:
getForm
in interfaceFormControl
- Returns:
- the associated form
-
getName
- Specified by:
getName
in interfaceFormControl
- Returns:
- the name of the control
-
getInitialValue
- Specified by:
getInitialValue
in interfaceFormControl
- Returns:
- the initial value
-
setInitialValue
-
getValue
- Specified by:
getValue
in interfaceFormControl
- Returns:
- the control's current value or
null
if isMultiple returns true
-
setValue
Description copied from interface:FormControl
Sets the control's current value. This has no effect when isMultiple returns true.- Specified by:
setValue
in interfaceFormControl
-
getMultipleValues
- Specified by:
getMultipleValues
in interfaceFormControl
- Returns:
- the control's current values or
null
if isMultiple returns false
-
setMultipleValues
Description copied from interface:FormControl
Sets the control's current values (when isMultiple returns true). This has no effect when isMultiple returns false.- Specified by:
setMultipleValues
in interfaceFormControl
-
isHidden
public boolean isHidden() -
isEnabled
public boolean isEnabled()Description copied from interface:FormControl
Is this control enabled?- Specified by:
isEnabled
in interfaceFormControl
- Returns:
true
if this control is enabled
-
isSuccessful
public boolean isSuccessful()Description copied from interface:FormControl
Is this control successful?- Specified by:
isSuccessful
in interfaceFormControl
- Returns:
true
if this control is successful and its name-value pair should be submitted,false
otherwise.
-
isMultiple
public boolean isMultiple()- Specified by:
isMultiple
in interfaceFormControl
- Returns:
true
if this control accepts multiple values,false
otherwise
-
setSuccessful
public void setSuccessful(boolean successful) Description copied from interface:FormControl
Sets this control's successful state.- Specified by:
setSuccessful
in interfaceFormControl
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:FormControl
Enable/disable this control- Specified by:
setEnabled
in interfaceFormControl
-
reset
public void reset()Description copied from interface:FormControl
Reset the control to it's initial state- Specified by:
reset
in interfaceFormControl
-
collectText
-
getIntAttribute
-