Package com.helger.html.hc.html.forms
Interface IHCInput<IMPLTYPE extends IHCInput<IMPLTYPE>>
-
- Type Parameters:
IMPLTYPE- Implementation type
- All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,IHCControl<IMPLTYPE>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasFocus<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCHasName<IMPLTYPE>,IHCHasState<IMPLTYPE>,IHCNode,Serializable
- All Known Implementing Classes:
AbstractHCCheckBox,AbstractHCInput,AbstractHCRadioButton,HCCheckBox,HCEdit,HCEditFile,HCEditPassword,HCHiddenField,HCInput,HCRadioButton
public interface IHCInput<IMPLTYPE extends IHCInput<IMPLTYPE>> extends IHCControl<IMPLTYPE>
Base interface for controls base on <input> area.- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StringgetAccept()StringgetAlt()StringgetAutoComplete()StringgetDirName()StringgetForm()IHasJSCodegetFormActionJS()com.helger.commons.url.ISimpleURLgetFormActionURL()com.helger.commons.mime.IMimeTypegetFormEncType()EHCFormMethodgetFormMethod()HC_TargetgetFormTarget()intgetHeight()StringgetList()intgetMaxLength()StringgetMaxValue()intgetMinLength()StringgetMinValue()StringgetPattern()StringgetPlaceholder()intgetSize()com.helger.commons.url.ISimpleURLgetSrc()StringgetStep()EHCInputTypegetType()StringgetValue()intgetWidth()default booleanhasPlaceholder()default booleanisAutoCompleteOff()Deprecated, for removal: This API element is subject to removal in a future version.default booleanisAutoCompleteOn()Deprecated, for removal: This API element is subject to removal in a future version.default booleanisAutoCompleteUndefined()Deprecated, for removal: This API element is subject to removal in a future version.booleanisAutoFocus()booleanisChecked()booleanisFormNoValidate()booleanisMultiple()IMPLTYPEsetAccept(com.helger.commons.mime.IMimeType aAccept)IMPLTYPEsetAccept(String sAccept)IMPLTYPEsetAlt(String sAlt)default IMPLTYPEsetAutoComplete(boolean bAutoComplete)Deprecated, for removal: This API element is subject to removal in a future version.default IMPLTYPEsetAutoComplete(com.helger.commons.state.ETriState eAutoComplete)Deprecated, for removal: This API element is subject to removal in a future version.default IMPLTYPEsetAutoComplete(EHCAutoComplete eAutoComplete)IMPLTYPEsetAutoComplete(String sAutoComplete)IMPLTYPEsetAutoFocus(boolean bAutoFocus)Change the auto focused state of this element.IMPLTYPEsetChecked(boolean bChecked)Set the checked state according to the passed valueIMPLTYPEsetDirName(String sDirName)IMPLTYPEsetForm(String sForm)IMPLTYPEsetFormAction(com.helger.commons.url.ISimpleURL aAction)IMPLTYPEsetFormAction(IHasJSCodeWithSettings aAction)IMPLTYPEsetFormEncType(com.helger.commons.mime.IMimeType aFormEncType)default IMPLTYPEsetFormEncTypeFileUpload()Make this form a file-upload form.default IMPLTYPEsetFormEncTypeTextPlain()Set the enctype to text/plainIMPLTYPEsetFormMethod(EHCFormMethod eFormMethod)IMPLTYPEsetFormNoValidate(boolean bFormNoValidate)IMPLTYPEsetFormTarget(HC_Target aFormTarget)default IMPLTYPEsetFormTargetBlank()IMPLTYPEsetHeight(int nHeight)IMPLTYPEsetList(String sList)IMPLTYPEsetMaxLength(int nMaxLength)Set the maximum number of characters to be entered.IMPLTYPEsetMaxValue(String sMaxValue)IMPLTYPEsetMinLength(int nMinLength)Set the minimum number of characters to be entered.IMPLTYPEsetMinValue(String sMinValue)IMPLTYPEsetMultiple(boolean bMultiple)IMPLTYPEsetPattern(String sPattern)IMPLTYPEsetPlaceholder(String sPlaceholder)Set the new value for the HTMLplaceholderattribute.IMPLTYPEsetSize(int nSize)Sets the visible size of the edit.IMPLTYPEsetSrc(com.helger.commons.url.ISimpleURL aSrc)IMPLTYPEsetStep(String sStep)IMPLTYPEsetType(EHCInputType eType)default IMPLTYPEsetValue(int nValue)Sets the passed field valuedefault IMPLTYPEsetValue(long nValue)Sets the passed field valueIMPLTYPEsetValue(String sValue)Sets the passed field valueIMPLTYPEsetWidth(int nWidth)-
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.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
Method Detail
-
getType
@Nullable EHCInputType getType()
- Returns:
- The type used for this
inputelement. May benull.
-
setType
@Nonnull IMPLTYPE setType(@Nonnull EHCInputType eType)
-
isAutoCompleteOn
@Deprecated(since="9.1.1", forRemoval=true) default boolean isAutoCompleteOn()
Deprecated, for removal: This API element is subject to removal in a future version.
-
isAutoCompleteOff
@Deprecated(since="9.1.1", forRemoval=true) default boolean isAutoCompleteOff()
Deprecated, for removal: This API element is subject to removal in a future version.
-
isAutoCompleteUndefined
@Deprecated(since="9.1.1", forRemoval=true) default boolean isAutoCompleteUndefined()
Deprecated, for removal: This API element is subject to removal in a future version.
-
setAutoComplete
@Nonnull @Deprecated(since="9.1.1", forRemoval=true) default IMPLTYPE setAutoComplete(boolean bAutoComplete)
Deprecated, for removal: This API element is subject to removal in a future version.
-
setAutoComplete
@Nonnull @Deprecated(since="9.1.1", forRemoval=true) default IMPLTYPE setAutoComplete(@Nonnull com.helger.commons.state.ETriState eAutoComplete)
Deprecated, for removal: This API element is subject to removal in a future version.
-
setAutoComplete
@Nonnull default IMPLTYPE setAutoComplete(@Nullable EHCAutoComplete eAutoComplete)
-
isAutoFocus
boolean isAutoFocus()
- Specified by:
isAutoFocusin interfaceIHCHasFocus<IMPLTYPE extends IHCInput<IMPLTYPE>>- Returns:
trueif this element is focused,falseotherwise. By default an element is not focused.
-
setAutoFocus
@Nonnull IMPLTYPE setAutoFocus(boolean bAutoFocus)
Description copied from interface:IHCHasFocusChange the auto focused state of this element.- Specified by:
setAutoFocusin interfaceIHCHasFocus<IMPLTYPE extends IHCInput<IMPLTYPE>>- Parameters:
bAutoFocus-trueto auto focus this element,falseto not focus the element.- Returns:
- this
-
isChecked
boolean isChecked()
- Returns:
- Whether or not the check-box is currently checked
-
setChecked
@Nonnull IMPLTYPE setChecked(boolean bChecked)
Set the checked state according to the passed value- Parameters:
bChecked- new checked state- Returns:
- This object for chaining
-
getFormActionURL
@Nullable com.helger.commons.url.ISimpleURL getFormActionURL()
-
getFormActionJS
@Nullable IHasJSCode getFormActionJS()
-
setFormAction
@Nonnull IMPLTYPE setFormAction(@Nullable IHasJSCodeWithSettings aAction)
-
getFormEncType
@Nullable com.helger.commons.mime.IMimeType getFormEncType()
-
setFormEncTypeFileUpload
@Nonnull default IMPLTYPE setFormEncTypeFileUpload()
Make this form a file-upload form.- Returns:
- this
-
setFormEncTypeTextPlain
@Nonnull default IMPLTYPE setFormEncTypeTextPlain()
Set the enctype to text/plain- Returns:
- this
-
setFormEncType
@Nonnull IMPLTYPE setFormEncType(@Nullable com.helger.commons.mime.IMimeType aFormEncType)
-
getFormMethod
@Nullable EHCFormMethod getFormMethod()
-
setFormMethod
@Nonnull IMPLTYPE setFormMethod(@Nullable EHCFormMethod eFormMethod)
-
isFormNoValidate
boolean isFormNoValidate()
-
getHeight
int getHeight()
-
getMaxLength
int getMaxLength()
- Returns:
- The currently set max length or -1.
-
setMaxLength
@Nonnull IMPLTYPE setMaxLength(int nMaxLength)
Set the maximum number of characters to be entered.- Parameters:
nMaxLength- The max length. Should be > 0.- Returns:
- this
-
getMinLength
int getMinLength()
- Returns:
- The currently set min length or -1.
-
setMinLength
@Nonnull IMPLTYPE setMinLength(int nMinLength)
Set the minimum number of characters to be entered.- Parameters:
nMinLength- The min length. Should be > 0.- Returns:
- this
-
isMultiple
boolean isMultiple()
-
getPlaceholder
@Nullable String getPlaceholder()
- Returns:
- The current value of the HTML
placeholderattribute. May benull.
-
hasPlaceholder
default boolean hasPlaceholder()
- Returns:
trueif a placeholder is present,falseotherwise.
-
setPlaceholder
@Nonnull IMPLTYPE setPlaceholder(@Nullable String sPlaceholder)
Set the new value for the HTMLplaceholderattribute.- Parameters:
sPlaceholder- The new value. May benull.- Returns:
- this
-
getSize
int getSize()
- Returns:
- The currently set max length.
-
setSize
@Nonnull IMPLTYPE setSize(int nSize)
Sets the visible size of the edit. Should not be necessary in most cases, as styling via CSS is the preferred way. If you want to limit the number of available characters usesetMaxLength(int)instead.- Parameters:
nSize- The width of the edit in characters.- Returns:
- this
-
getSrc
@Nullable com.helger.commons.url.ISimpleURL getSrc()
-
setValue
@Nonnull default IMPLTYPE setValue(int nValue)
Sets the passed field value- Parameters:
nValue- Value to use.- Returns:
- This object for chaining
-
setValue
@Nonnull default IMPLTYPE setValue(long nValue)
Sets the passed field value- Parameters:
nValue- Value to use.- Returns:
- This object for chaining
-
setValue
@Nonnull IMPLTYPE setValue(@Nullable String sValue)
Sets the passed field value- Parameters:
sValue- Value to use.- Returns:
- This object for chaining
-
getWidth
int getWidth()
-
-