Interface InputElement
- All Superinterfaces:
 DomQueryable,Element,EventTarget,Node
An element that can take in a player's input
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault placeholder value returned bygetPlaceholder() - 
Method Summary
Modifier and TypeMethodDescriptionbooleanInput elements cannot have child nodes.@NotNull StringGet the element's placeholder, or a fallback value, if not set.Get theAttributes.PROMPTattribute value.@NotNull InputElement.InputTypegetType()Get the input type from theAttributes.TYPEattribute.@Nullable StringgetValue()Get the inputted valuebooleanTest if the element is disabled.voidsetDisabled(boolean disabled) Set theAttributes.ENABLEDattributevoidsetPlaceholder(@Nullable String placeholder) Set the value of theAttributes.PLACEHOLDERattribute.voidSet theAttributes.PROMPTattribute value.voidsetType(@Nullable InputElement.InputType type) Set the input typevoidSet the inputted value.voidSet the inputted value.Methods inherited from interface com.juliewoolie.dom.DomQueryable
getElementsByClassName, getElementsByTagName, querySelector, querySelectorAllMethods inherited from interface com.juliewoolie.dom.Element
appendChild, appendElement, appendText, clearChildren, firstChild, forEachDescendant, getAttribute, getAttributeEntries, getAttributeNames, getChild, getChildCount, getChildren, getClassList, getClassName, getCurrentStyle, getId, getStyle, getTagName, getTextContent, getTitleNode, getTooltip, getTooltipBehaviour, getTooltipDelay, hasAttribute, hasChild, hasChildren, indexOf, insertAfter, insertBefore, isDescendant, lastChild, matches, prependChild, removeAttribute, removeChild, removeChild, removeMatchingChildren, replaceChild, replaceChild, setAttribute, setClassName, setId, setTextContent, setTitleNode, setTooltipBehaviour, setTooltipDelayMethods inherited from interface com.juliewoolie.dom.event.EventTarget
addEventListener, dispatchEvent, getOnAddAttribute, getOnAddOption, getOnAppendChild, getOnAttributeChange, getOnClick, getOnClosing, getOnInput, getOnLoaded, getOnMouseEnter, getOnMouseExit, getOnMouseMove, getOnOptionChange, getOnRemoveAttribute, getOnRemoveChild, getOnRemoveOption, getOnRightClick, getOnSetAttribute, getOnSetOption, getOnSpawned, onAddAttribute, onAddOption, onAppendChild, onAttributeChange, onClick, onClosing, onInput, onLoaded, onMouseEnter, onMouseExit, onMouseMove, onOptionChange, onRemoveAttribute, onRemoveChild, onRemoveOption, onRightClick, onSetAttribute, onSetOption, onSpawned, removeEventListenerMethods inherited from interface com.juliewoolie.dom.Node
enterVisitor, exitVisitor, getDepth, getOwningDocument, getParent, getRenderingBounds, getSiblingIndex, hasFlag, nextSibling, previousSibling 
- 
Field Details
- 
DEFAULT_PLACEHOLDER
Default placeholder value returned bygetPlaceholder()- See Also:
 
 
 - 
 - 
Method Details
- 
canHaveChildren
@Contract("-> false") boolean canHaveChildren()Input elements cannot have child nodes.- Specified by:
 canHaveChildrenin interfaceElement- Returns:
 false
 - 
isDisabled
boolean isDisabled()Test if the element is disabled.This element can be disabled by setting the
Attributes.ENABLEDattribute tofalse.- Returns:
 true, if the element is disabled,falseotherwise
 - 
setDisabled
void setDisabled(boolean disabled) Set theAttributes.ENABLEDattribute- Parameters:
 disabled-trueto disable the element,falseotherwise.
 - 
getPrompt
String getPrompt()Get theAttributes.PROMPTattribute value.The prompt is displayed to players when asking for input
- Returns:
 - Prompt
 
 - 
setPrompt
Set theAttributes.PROMPTattribute value.The prompt is displayed to players when asking for input
- Parameters:
 prompt- Prompt
 - 
getType
Get the input type from theAttributes.TYPEattribute.If the attribute isn't set or its value does not map to an enum value, then
InputElement.InputType.TEXTis returned.- Returns:
 - Input type
 
 - 
setType
Set the input type- Parameters:
 type- Input type, ornull.
 - 
getValue
Get the inputted value- Returns:
 - Inputted value, may be an empty string or 
null 
 - 
setValue
Set the inputted value.Triggers a
EventTypes.INPUTevent.- Parameters:
 value- New element value
 - 
setValue
Set the inputted value.Triggers a
EventTypes.INPUTevent.- Parameters:
 value- New element valueplayer- Player that changed the element
 - 
getPlaceholder
Get the element's placeholder, or a fallback value, if not set.Placeholders are set with the
Attributes.PLACEHOLDERattribute. If the attribute is not explicitly set, then this method returnsDEFAULT_PLACEHOLDER.- Returns:
 - Placeholder
 
 - 
setPlaceholder
Set the value of theAttributes.PLACEHOLDERattribute.- Parameters:
 placeholder- New placeholder
 
 -