Package com.helger.html.hc.html.forms
Class AbstractHCCheckBox<IMPLTYPE extends AbstractHCCheckBox<IMPLTYPE>>
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.forms.AbstractHCControl<IMPLTYPE>
-
- com.helger.html.hc.html.forms.AbstractHCInput<IMPLTYPE>
-
- com.helger.html.hc.html.forms.AbstractHCCheckBox<IMPLTYPE>
-
- Type Parameters:
IMPLTYPE- Implementation type
- All Implemented Interfaces:
com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,IHCControl<IMPLTYPE>,IHCHasFocus<IMPLTYPE>,IHCInput<IMPLTYPE>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasState<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCHasName<IMPLTYPE>,IHCNode,Serializable
- Direct Known Subclasses:
HCCheckBox
public abstract class AbstractHCCheckBox<IMPLTYPE extends AbstractHCCheckBox<IMPLTYPE>> extends AbstractHCInput<IMPLTYPE>
Represents an HTML <input> element with type "checkbox"- Author:
- Philip Helger, Boris Gregorcic
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_EMIT_HIDDEN_FIELDEmit a hidden field that indicates that the check-box was in the request.static StringDEFAULT_VALUEThe default value of the "value" attribute in HTMLstatic StringHIDDEN_FIELD_PREFIX-
Fields inherited from class com.helger.html.hc.html.forms.AbstractHCInput
DEFAULT_AUTO_COMPLETE, DEFAULT_CHECKED, DEFAULT_FORMNOVALIDATE, DEFAULT_MULTIPLE
-
Fields inherited from class com.helger.html.hc.html.forms.AbstractHCControl
CSS_CLASS_READ_ONLY, DEFAULT_AUTO_FOCUS, DEFAULT_DISABLED, DEFAULT_READ_ONLY, DEFAULT_REQUIRED
-
Fields inherited from class com.helger.html.hc.html.AbstractHCElement
DEFAULT_HIDDEN, DEFAULT_SPELLCHECK, DEFAULT_TRANSLATE, DEFAULT_UNFOCUSABLE
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractHCCheckBox()ConstructorAbstractHCCheckBox(IHCRequestFieldBoolean aRF)ConstructorAbstractHCCheckBox(IHCRequestFieldBooleanMultiValue aRF)ConstructorprotectedAbstractHCCheckBox(String sName, boolean bChecked, String sValue)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetHiddenFieldName()Get the hidden field name for this checkbox.booleanisEmitHiddenField()protected voidonFinalizeNodeState(IHCConversionSettingsToNode aConversionSettings, IHCHasChildrenMutable<?,? super IHCNode> aTargetNode)Finalize the node by applying any internal state that was not yet converted to a HC element.IMPLTYPEsetEmitHiddenField(boolean bEmitHiddenField)Sets whether or not hidden fields will be emitted according to the passed valueStringtoString()-
Methods inherited from class com.helger.html.hc.html.forms.AbstractHCInput
fillMicroElement, getAccept, getAlt, getAutoComplete, getDirName, getForm, getFormActionJS, getFormActionURL, getFormEncType, getFormMethod, getFormTarget, getHeight, getList, getMaxLength, getMaxValue, getMinLength, getMinValue, getPattern, getPlaceholder, getPlainText, getSize, getSrc, getStep, getType, getValue, getWidth, isChecked, isFormNoValidate, isMultiple, setAccept, setAccept, setAlt, setAutoComplete, setChecked, setDirName, setForm, setFormAction, setFormAction, setFormEncType, setFormMethod, setFormNoValidate, setFormTarget, setHeight, setList, setMaxLength, setMaxValue, setMinLength, setMinValue, setMultiple, setPattern, setPlaceholder, setSize, setSrc, setStep, setType, setValue, setWidth
-
Methods inherited from class com.helger.html.hc.html.forms.AbstractHCControl
getName, isAutoFocus, isDisabled, isReadOnly, isRequired, setAutoFocus, setDisabled, setName, setReadOnly, setRequired
-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, finishMicroElement, getAccessKey, getAllClasses, getAllClassesAsString, getAllClassNames, getAllStyles, getAllStylesAsString, getAllStyleValues, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getID, getLanguage, getRole, getStyleValue, getTabIndex, getTagName, getTitle, getTranslate, hasAnyClass, hasAnyStyle, hasStyle, internalConvertToMicroNode, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, isValidID, onConsistencyCheck, prependEventHandler, removeAllClasses, removeAllEventHandler, removeAllStyles, removeClass, removeStyle, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setID, setID, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setUnfocusable
-
Methods inherited from class com.helger.html.hc.impl.AbstractHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildAtIndex, getChildCount, getChildren, getFirstChild, getLastChild, getNodeState, hasChildren, internalSetNodeState, onCustomizeNode, onRegisterExternalResources, registerExternalResources
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.html.forms.IHCControl
isReadOnly, isRequired, setReadOnly, setRequired
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
addEventHandler, containsEventHandler, customAttrs, getAccessKey, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getLanguage, getRole, getTabIndex, getTagName, getTitle, getTranslate, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, prependEventHandler, removeAllEventHandler, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setTranslate, setUnfocusable, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClass, addClasses, addClasses, addClasses, containsClass, getAllClasses, getAllClassesAsString, getAllClassNames, hasAnyClass, removeAllClasses, removeClass
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyle, addStyles, addStyles, addStyles, containsStyle, getAllStyles, getAllStylesAsString, getAllStyleValues, getStyleValue, hasAnyStyle, hasStyle, removeAllStyles, removeStyle
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, getID, hasID, hasNoID, setID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCHasName
getName, setName
-
Methods inherited from interface com.helger.html.hc.html.IHCHasState
isDisabled, setDisabled
-
Methods inherited from interface com.helger.html.hc.html.forms.IHCInput
hasPlaceholder, isAutoCompleteOff, isAutoCompleteOn, isAutoCompleteUndefined, isAutoFocus, setAutoComplete, setAutoComplete, setAutoComplete, setAutoFocus, setFormEncTypeFileUpload, setFormEncTypeTextPlain, setFormTargetBlank, setValue, setValue
-
Methods inherited from interface com.helger.html.hc.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, registerExternalResources
-
-
-
-
Field Detail
-
DEFAULT_VALUE
public static final String DEFAULT_VALUE
The default value of the "value" attribute in HTML
-
DEFAULT_EMIT_HIDDEN_FIELD
public static final boolean DEFAULT_EMIT_HIDDEN_FIELD
Emit a hidden field that indicates that the check-box was in the request.- See Also:
- Constant Field Values
-
HIDDEN_FIELD_PREFIX
public static final String HIDDEN_FIELD_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractHCCheckBox
public AbstractHCCheckBox()
Constructor
-
AbstractHCCheckBox
protected AbstractHCCheckBox(@Nullable String sName, boolean bChecked, @Nullable String sValue)
Constructor- Parameters:
sName- The name of this check-box (used as field name)bChecked- Whether or not it should be initially checkedsValue- The value to be set for this check-box
-
AbstractHCCheckBox
public AbstractHCCheckBox(@Nonnull IHCRequestFieldBoolean aRF)
Constructor- Parameters:
aRF- The request field
-
AbstractHCCheckBox
public AbstractHCCheckBox(@Nonnull IHCRequestFieldBooleanMultiValue aRF)
Constructor- Parameters:
aRF- The request field
-
-
Method Detail
-
isEmitHiddenField
public final boolean isEmitHiddenField()
- Returns:
- Whether or not hidden fields will be emitted
-
setEmitHiddenField
@Nonnull public final IMPLTYPE setEmitHiddenField(boolean bEmitHiddenField)
Sets whether or not hidden fields will be emitted according to the passed value- Parameters:
bEmitHiddenField-trueto emit the hidden field,falseto avoid.- Returns:
- This object for chaining
-
getHiddenFieldName
@Nullable public final String getHiddenFieldName()
Get the hidden field name for this checkbox.- Returns:
nullif no field name (AbstractHCControl.getName()) is present or a non-nulland non-empty string.
-
onFinalizeNodeState
protected void onFinalizeNodeState(@Nonnull IHCConversionSettingsToNode aConversionSettings, @Nonnull IHCHasChildrenMutable<?,? super IHCNode> aTargetNode)
Description copied from class:AbstractHCNodeFinalize the node by applying any internal state that was not yet converted to a HC element. This method is called at maximum once per IHCNode. It is safe to still add classes, style or children to this node in this method.- Overrides:
onFinalizeNodeStatein classAbstractHCControl<IMPLTYPE extends AbstractHCCheckBox<IMPLTYPE>>- Parameters:
aConversionSettings- HC conversion settingsaTargetNode- The target node where additional nodes should be added
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCInput<IMPLTYPE extends AbstractHCCheckBox<IMPLTYPE>>
-
-