Package com.helger.html.hc.html.forms
Class AbstractHCControl<IMPLTYPE extends AbstractHCControl<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>
-
- 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>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasState<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCHasName<IMPLTYPE>,IHCNode,Serializable
- Direct Known Subclasses:
AbstractHCInput,AbstractHCSelect,AbstractHCTextArea
@NotThreadSafe public abstract class AbstractHCControl<IMPLTYPE extends AbstractHCControl<IMPLTYPE>> extends AbstractHCElement<IMPLTYPE> implements IHCControl<IMPLTYPE>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ICSSClassProviderCSS_CLASS_READ_ONLYstatic booleanDEFAULT_AUTO_FOCUSBy default auto focus is disabledstatic booleanDEFAULT_DISABLEDstatic booleanDEFAULT_READ_ONLYstatic booleanDEFAULT_REQUIREDBy default required is disabled-
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 AbstractHCControl(EHTMLElement aElement)
-
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 objectStringgetName()booleanisAutoFocus()booleanisDisabled()booleanisReadOnly()booleanisRequired()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.IMPLTYPEsetAutoFocus(boolean bAutoFocus)Change the auto focused state of this element.IMPLTYPEsetDisabled(boolean bDisabled)Set the disabled state of this element.IMPLTYPEsetName(String sName)Set the name of the element.IMPLTYPEsetReadOnly(boolean bReadOnly)IMPLTYPEsetRequired(boolean bRequired)StringtoString()-
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, getPlainText, 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.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.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
Field Detail
-
DEFAULT_DISABLED
public static final boolean DEFAULT_DISABLED
- See Also:
- Constant Field Values
-
DEFAULT_READ_ONLY
public static final boolean DEFAULT_READ_ONLY
- See Also:
- Constant Field Values
-
DEFAULT_REQUIRED
public static final boolean DEFAULT_REQUIRED
By default required is disabled- See Also:
- Constant Field Values
-
DEFAULT_AUTO_FOCUS
public static final boolean DEFAULT_AUTO_FOCUS
By default auto focus is disabled- See Also:
- Constant Field Values
-
CSS_CLASS_READ_ONLY
public static final ICSSClassProvider CSS_CLASS_READ_ONLY
-
-
Constructor Detail
-
AbstractHCControl
public AbstractHCControl(@Nonnull @Nonempty EHTMLElement aElement)
-
-
Method Detail
-
isDisabled
public final boolean isDisabled()
- Specified by:
isDisabledin interfaceIHCHasState<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>- Returns:
trueif the element is disabled,falseotherwise.
-
setDisabled
@Nonnull public final IMPLTYPE setDisabled(boolean bDisabled)
Description copied from interface:IHCHasStateSet the disabled state of this element.- Specified by:
setDisabledin interfaceIHCHasState<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>- Parameters:
bDisabled-trueto disable,falseto enable- Returns:
- this
-
getName
public final String getName()
- Specified by:
getNamein interfaceIHCHasName<IMPLTYPE extends AbstractHCControl<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 AbstractHCControl<IMPLTYPE>>- Parameters:
sName- The new name. May benull.- Returns:
- this
-
isReadOnly
public final boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceIHCControl<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>
-
setReadOnly
@Nonnull public final IMPLTYPE setReadOnly(boolean bReadOnly)
- Specified by:
setReadOnlyin interfaceIHCControl<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>
-
isRequired
public final boolean isRequired()
- Specified by:
isRequiredin interfaceIHCControl<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>
-
setRequired
@Nonnull public final IMPLTYPE setRequired(boolean bRequired)
- Specified by:
setRequiredin interfaceIHCControl<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>
-
isAutoFocus
public final boolean isAutoFocus()
- Specified by:
isAutoFocusin interfaceIHCHasFocus<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>- Returns:
trueif this element is focused,falseotherwise. By default an element is not focused.
-
setAutoFocus
@Nonnull public final IMPLTYPE setAutoFocus(boolean bAutoFocus)
Description copied from interface:IHCHasFocusChange the auto focused state of this element.- Specified by:
setAutoFocusin interfaceIHCHasFocus<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>- Parameters:
bAutoFocus-trueto auto focus this element,falseto not focus the element.- Returns:
- this
-
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 AbstractHCControl<IMPLTYPE>>- Parameters:
aConversionSettings- HC conversion settingsaTargetNode- The target node where additional nodes should be added
-
fillMicroElement
@OverridingMethodsMustInvokeSuper protected void fillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)
Description copied from class:AbstractHCElementSet all attributes and child elements of this object- Overrides:
fillMicroElementin classAbstractHCElement<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>- Parameters:
aElement- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElement<IMPLTYPE extends AbstractHCControl<IMPLTYPE>>
-
-