Package com.helger.html.hc.html.forms
Class AbstractHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.AbstractHCElementWithInternalChildren<IMPLTYPE,IHCNode>
-
- com.helger.html.hc.html.AbstractHCElementWithChildren<IMPLTYPE>
-
- com.helger.html.hc.html.forms.AbstractHCForm<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>,IHCForm<IMPLTYPE>,IHCElement<IMPLTYPE>,IHCElementWithChildren<IMPLTYPE>,IHCElementWithInternalChildren<IMPLTYPE,IHCNode>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasChildrenMutable<IMPLTYPE,IHCNode>,IHCHasID<IMPLTYPE>,IHCHasName<IMPLTYPE>,IHCNode,IHCNodeWithChildren<IMPLTYPE>,Serializable
- Direct Known Subclasses:
HCForm
public abstract class AbstractHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>> extends AbstractHCElementWithChildren<IMPLTYPE> implements IHCForm<IMPLTYPE>
Represents an HTML <form> element- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ICSSClassProviderCSS_CLASS_INVISIBLE_BUTTONstatic com.helger.commons.state.ETriStateDEFAULT_AUTO_COMPLETEBy default no auto complete setting is activestatic EHCFormMethodDEFAULT_METHODDefault form submission method is POSTstatic booleanDEFAULT_NOVALIDATEDefault valuestatic booleanDEFAULT_SUBMIT_PRESSING_ENTERBy default form are not submitted by pressing Enter key-
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 Constructor Description AbstractHCForm()AbstractHCForm(com.helger.commons.url.ISimpleURL aAction)AbstractHCForm(IHasJSCodeWithSettings aAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Set all attributes and child elements of this objectStringgetAcceptCharset()IHasJSCodegetActionJS()com.helger.commons.url.ISimpleURLgetActionURL()com.helger.commons.mime.IMimeTypegetEncType()EHCFormMethodgetMethod()StringgetName()intgetSubmitButtonTabIndex()HC_TargetgetTarget()booleanisAutoCompleteOff()booleanisAutoCompleteOn()booleanisAutoCompleteUndefined()booleanisNoValidate()booleanisSubmitPressingEnter()protected voidonConsistencyCheck(IHCConversionSettingsToNode aConversionSettings)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.IMPLTYPEsetAcceptCharset(String sAcceptCharset)IMPLTYPEsetAction(com.helger.commons.url.ISimpleURL aAction)IMPLTYPEsetAction(IHasJSCodeWithSettings aAction)IMPLTYPEsetAutoComplete(com.helger.commons.state.ETriState eAutoComplete)IMPLTYPEsetEncType(com.helger.commons.mime.IMimeType aEncType)IMPLTYPEsetMethod(EHCFormMethod eMethod)IMPLTYPEsetName(String sName)Set the name of the element.IMPLTYPEsetNoValidate(boolean bNoValidate)IMPLTYPEsetSubmitPressingEnter(boolean bSubmitPressingEnter, int nSubmitButtonTabIndex)IMPLTYPEsetTarget(HC_Target aTarget)StringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElementWithInternalChildren
addChild, addChildAt, afterAddChild, afterRemoveChild, beforeAddChild, canConvertToMicroNode, children, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getAllChildrenAsNodeList, getChildAtIndex, getChildCount, getChildren, getChildrenFormEmitting, getFirstChild, getLastChild, getPlainText, hasChildren, removeAllChildren, removeChild, removeChildAt, sortAllChildren
-
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, 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
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, 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.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.IHCElementWithInternalChildren
recursiveContainsChildWithTagName
-
Methods inherited from interface com.helger.html.hc.html.forms.IHCForm
setAutoComplete, setEncTypeFileUpload, setEncTypeTextPlain, setSubmitPressingEnter
-
Methods inherited from interface com.helger.html.hc.IHCHasChildrenMutable
addAndReturnChild, addAndReturnChildAt, addChild, addChildAt, addChildren, addChildren, addChildren, addChildrenAt, addChildrenAt, getAllChildrenAsNodeList, removeAllChildren, removeChild, removeChildAt, setChild, sortAllChildren
-
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.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
Methods inherited from interface com.helger.html.hc.IHCNodeWithChildren
addChild, addChildAt, addChildren, addChildren, setChild
-
-
-
-
Field Detail
-
DEFAULT_AUTO_COMPLETE
public static final com.helger.commons.state.ETriState DEFAULT_AUTO_COMPLETE
By default no auto complete setting is active
-
DEFAULT_METHOD
public static final EHCFormMethod DEFAULT_METHOD
Default form submission method is POST
-
DEFAULT_NOVALIDATE
public static final boolean DEFAULT_NOVALIDATE
Default value- See Also:
- Constant Field Values
-
DEFAULT_SUBMIT_PRESSING_ENTER
public static final boolean DEFAULT_SUBMIT_PRESSING_ENTER
By default form are not submitted by pressing Enter key- See Also:
- Constant Field Values
-
CSS_CLASS_INVISIBLE_BUTTON
public static final ICSSClassProvider CSS_CLASS_INVISIBLE_BUTTON
-
-
Constructor Detail
-
AbstractHCForm
public AbstractHCForm()
-
AbstractHCForm
public AbstractHCForm(@Nullable com.helger.commons.url.ISimpleURL aAction)
-
AbstractHCForm
public AbstractHCForm(@Nullable IHasJSCodeWithSettings aAction)
-
-
Method Detail
-
getAcceptCharset
@Nullable public final String getAcceptCharset()
- Specified by:
getAcceptCharsetin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setAcceptCharset
@Nonnull public final IMPLTYPE setAcceptCharset(@Nullable String sAcceptCharset)
- Specified by:
setAcceptCharsetin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getActionURL
@Nullable public final com.helger.commons.url.ISimpleURL getActionURL()
- Specified by:
getActionURLin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getActionJS
@Nullable public final IHasJSCode getActionJS()
- Specified by:
getActionJSin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setAction
@Nonnull public final IMPLTYPE setAction(@Nullable com.helger.commons.url.ISimpleURL aAction)
- Specified by:
setActionin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setAction
@Nonnull public final IMPLTYPE setAction(@Nullable IHasJSCodeWithSettings aAction)
- Specified by:
setActionin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
isAutoCompleteOn
public final boolean isAutoCompleteOn()
- Specified by:
isAutoCompleteOnin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
isAutoCompleteOff
public final boolean isAutoCompleteOff()
- Specified by:
isAutoCompleteOffin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
isAutoCompleteUndefined
public final boolean isAutoCompleteUndefined()
- Specified by:
isAutoCompleteUndefinedin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setAutoComplete
@Nonnull public final IMPLTYPE setAutoComplete(@Nonnull com.helger.commons.state.ETriState eAutoComplete)
- Specified by:
setAutoCompletein interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getEncType
@Nullable public final com.helger.commons.mime.IMimeType getEncType()
- Specified by:
getEncTypein interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setEncType
@Nonnull public final IMPLTYPE setEncType(@Nullable com.helger.commons.mime.IMimeType aEncType)
- Specified by:
setEncTypein interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getMethod
@Nullable public final EHCFormMethod getMethod()
- Specified by:
getMethodin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setMethod
@Nonnull public final IMPLTYPE setMethod(@Nullable EHCFormMethod eMethod)
- Specified by:
setMethodin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getName
@Nullable public final String getName()
- Specified by:
getNamein interfaceIHCHasName<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>- Returns:
- The name of the element. May be
null.
-
setName
@Nonnull public final IMPLTYPE setName(@Nullable String sName)
Description copied from interface:IHCHasNameSet the name of the element.- Specified by:
setNamein interfaceIHCHasName<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>- Parameters:
sName- The new name. May benull.- Returns:
- this
-
isNoValidate
public final boolean isNoValidate()
- Specified by:
isNoValidatein interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setNoValidate
@Nonnull public final IMPLTYPE setNoValidate(boolean bNoValidate)
- Specified by:
setNoValidatein interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getTarget
@Nullable public final HC_Target getTarget()
- Specified by:
getTargetin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setTarget
@Nonnull public final IMPLTYPE setTarget(@Nullable HC_Target aTarget)
- Specified by:
setTargetin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
isSubmitPressingEnter
public final boolean isSubmitPressingEnter()
- Specified by:
isSubmitPressingEnterin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
getSubmitButtonTabIndex
public final int getSubmitButtonTabIndex()
- Specified by:
getSubmitButtonTabIndexin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
setSubmitPressingEnter
@Nonnull public final IMPLTYPE setSubmitPressingEnter(boolean bSubmitPressingEnter, int nSubmitButtonTabIndex)
- Specified by:
setSubmitPressingEnterin interfaceIHCForm<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>
-
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 classAbstractHCElement<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>- Parameters:
aConversionSettings- HC conversion settingsaTargetNode- The target node where additional nodes should be added
-
onConsistencyCheck
protected void onConsistencyCheck(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Overrides:
onConsistencyCheckin classAbstractHCElement<IMPLTYPE extends AbstractHCForm<IMPLTYPE>>- Parameters:
aConversionSettings- HC conversion settings
-
fillMicroElement
protected void fillMicroElement(@Nonnull com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)
Description copied from class:AbstractHCElementSet all attributes and child elements of this object- Overrides:
fillMicroElementin classAbstractHCElementWithInternalChildren<IMPLTYPE extends AbstractHCForm<IMPLTYPE>,IHCNode>- Parameters:
aElement- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElementWithInternalChildren<IMPLTYPE extends AbstractHCForm<IMPLTYPE>,IHCNode>
-
-