Package com.helger.html.hc.html.forms
Class HCOption
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.AbstractHCElementWithInternalChildren<HCOption,HCTextNode>
-
- com.helger.html.hc.html.forms.HCOption
-
- 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<HCOption>,IHCElement<HCOption>,IHCElementWithInternalChildren<HCOption,HCTextNode>,IHCHasCSSClasses<HCOption>,IHCHasCSSStyles<HCOption>,IHCHasState<HCOption>,IHCHasChildrenMutable<HCOption,HCTextNode>,IHCHasID<HCOption>,IHCNode,Serializable
public class HCOption extends AbstractHCElementWithInternalChildren<HCOption,HCTextNode> implements IHCHasState<HCOption>
Represents a single option within a select box.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_DISABLEDBy default the option is not disabledstatic booleanDEFAULT_SELECTEDBy default the option is not selected-
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 HCOption()
-
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 objectStringgetLabel()StringgetValue()booleanisDisabled()booleanisSelected()booleanisSelectionDefined()HCOptionsetDisabled(boolean bDisabled)Set the disabled state of this element.HCOptionsetLabel(String sLabel)HCOptionsetSelected(boolean bSelected)HCOptionsetValue(String sValue)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, onConsistencyCheck, onFinalizeNodeState, 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.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
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.IHCHasChildrenMutable
addAndReturnChild, addAndReturnChildAt, addChildren, addChildren, addChildren, addChildrenAt, addChildrenAt, setChild
-
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
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, registerExternalResources
-
-
-
-
Field Detail
-
DEFAULT_DISABLED
public static final boolean DEFAULT_DISABLED
By default the option is not disabled- See Also:
- Constant Field Values
-
DEFAULT_SELECTED
public static final boolean DEFAULT_SELECTED
By default the option is not selected- See Also:
- Constant Field Values
-
-
Method Detail
-
isDisabled
public final boolean isDisabled()
- Specified by:
isDisabledin interfaceIHCHasState<HCOption>- Returns:
trueif the element is disabled,falseotherwise.
-
setDisabled
@Nonnull public final HCOption setDisabled(boolean bDisabled)
Description copied from interface:IHCHasStateSet the disabled state of this element.- Specified by:
setDisabledin interfaceIHCHasState<HCOption>- Parameters:
bDisabled-trueto disable,falseto enable- Returns:
- this
-
isSelected
public final boolean isSelected()
-
isSelectionDefined
public final boolean isSelectionDefined()
- Returns:
trueif this option was specially marked selected or not selected.
-
fillMicroElement
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 classAbstractHCElementWithInternalChildren<HCOption,HCTextNode>- 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<HCOption,HCTextNode>
-
-