Package com.helger.html.hc.html.forms
Interface IHCSelect<IMPLTYPE extends IHCSelect<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:
AbstractHCSelect,HCSelect
public interface IHCSelect<IMPLTYPE extends IHCSelect<IMPLTYPE>> extends IHCControl<IMPLTYPE>
Interface for definition items- 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 Modifier and Type Method Description HCOptionaddOption(HCOption aOption)default HCOptionaddOption(String sText)default HCOptionaddOption(String sText, boolean bSelected)default HCOptionaddOption(String sValue, String sText)default HCOptionaddOption(String sValue, String sText, boolean bSelected)default HCOptionaddOption(String sValue, String sText, String sSelectedValue)HCOptionaddOptionAt(int nIndex, HCOption aOption)Add a new option at the specified index.default HCOptionaddOptionAt(int nIndex, String sValue, String sText)Add a new option at the specified index.IMPLTYPEaddOptionGroup(HCOptGroup aOptGroup)com.helger.commons.collection.impl.ICommonsList<HCOptGroup>getAllOptionGroups()com.helger.commons.collection.impl.ICommonsList<HCOption>getAllOptions()com.helger.commons.collection.impl.ICommonsSet<String>getAllPreselectedValues()com.helger.commons.collection.impl.ICommonsList<HCOption>getAllSelectedOptions()HCOptiongetFirstSelectedOption()default StringgetFirstSelectedOptionValue()StringgetForm()HCOptiongetOptionAtIndex(int nIndex)Get the option at the specified indexintgetOptionCount()HCOptGroupgetOptionGroupAtIndex(int nIndex)Get the option group at the specified indexintgetOptionGroupCount()intgetSelectedOptionCount()intgetSize()booleanhasOptionGroups()booleanhasOptions()booleanhasSelectedOption()Check if this select has at least one selected optionbooleanisAutoFocus()booleanisMultiple()booleanisPreselectedValue(String sValue)IMPLTYPEremoveAllOptionGroups()IMPLTYPEremoveAllOptions()IMPLTYPEremoveOptionAt(int nIndex)Remove the option at the specified index.IMPLTYPEremoveOptionGroupAt(int nIndex)Remove the option group at the specified index.IMPLTYPEsetAutoFocus(boolean bAutoFocus)Change the auto focused state of this element.IMPLTYPEsetForm(String sForm)IMPLTYPEsetMultiple(boolean bMultiple)IMPLTYPEsetSize(int nSize)-
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
-
isAutoFocus
boolean isAutoFocus()
- Specified by:
isAutoFocusin interfaceIHCHasFocus<IMPLTYPE extends IHCSelect<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 IHCSelect<IMPLTYPE>>- Parameters:
bAutoFocus-trueto auto focus this element,falseto not focus the element.- Returns:
- this
-
isMultiple
boolean isMultiple()
-
getSize
int getSize()
-
getAllPreselectedValues
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsSet<String> getAllPreselectedValues()
-
addOptionAt
@Nonnull HCOption addOptionAt(@Nonnegative int nIndex, @Nonnull HCOption aOption)
Add a new option at the specified index.- Parameters:
nIndex- The index to use. Should be ≥ 0.aOption- The option to be added. May not benull.- Returns:
- this for chaining
-
addOption
@Nonnull default HCOption addOption(@Nullable String sValue, @Nullable String sText, boolean bSelected)
-
addOption
@Nonnull default HCOption addOption(@Nullable String sValue, @Nullable String sText, @Nullable String sSelectedValue)
-
addOptionAt
@Nonnull default HCOption addOptionAt(@Nonnegative int nIndex, @Nullable String sValue, @Nullable String sText)
Add a new option at the specified index.- Parameters:
nIndex- The index to use. Should be ≥ 0.sValue- The value of the option to be added. May benull.sText- The text of the option to be added. May benull.- Returns:
- this for chaining
-
addOptionGroup
@Nonnull IMPLTYPE addOptionGroup(@Nullable HCOptGroup aOptGroup)
-
removeOptionAt
@Nonnull IMPLTYPE removeOptionAt(@Nonnegative int nIndex)
Remove the option at the specified index.- Parameters:
nIndex- The index to be removed. Should be ≥ 0.- Returns:
- this for chaining
-
removeOptionGroupAt
@Nonnull IMPLTYPE removeOptionGroupAt(@Nonnegative int nIndex)
Remove the option group at the specified index.- Parameters:
nIndex- The index to be removed. Should be ≥ 0.- Returns:
- this for chaining
-
getOptionCount
@Nonnegative int getOptionCount()
- Returns:
- The number of available options.
-
getOptionGroupCount
@Nonnegative int getOptionGroupCount()
- Returns:
- The number of available option groups.
-
getAllOptions
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<HCOption> getAllOptions()
- Returns:
- A non-
nulllist of all available options.
-
getAllOptionGroups
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<HCOptGroup> getAllOptionGroups()
- Returns:
- A non-
nulllist of all available option groups.
-
getOptionAtIndex
@Nullable HCOption getOptionAtIndex(@Nonnegative int nIndex)
Get the option at the specified index- Parameters:
nIndex- The index to retrieve. Should always be ≥ 0.- Returns:
nullif no option is available for the specified index.
-
getOptionGroupAtIndex
@Nullable HCOptGroup getOptionGroupAtIndex(@Nonnegative int nIndex)
Get the option group at the specified index- Parameters:
nIndex- The index to retrieve. Should always be ≥ 0.- Returns:
nullif no option group is available for the specified index.
-
hasOptions
boolean hasOptions()
- Returns:
trueif this select has at least one option.
-
hasOptionGroups
boolean hasOptionGroups()
- Returns:
trueif this select has at least one option group.
-
getAllSelectedOptions
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<HCOption> getAllSelectedOptions()
- Returns:
- A non-
nulllist of all selected options.
-
getFirstSelectedOption
@Nullable HCOption getFirstSelectedOption()
- Returns:
- The first selected option. May be
null.
-
getSelectedOptionCount
@Nonnegative int getSelectedOptionCount()
- Returns:
- The number of selected options. Always ≥ 0.
-
hasSelectedOption
boolean hasSelectedOption()
Check if this select has at least one selected option- Returns:
trueif at least one option is selected
-
-