public class HtmlTextInput extends HtmlInput implements SelectableTextInput
HtmlElement.DisplayStyle
DomElement.ChildElementsIterator
DomNode.ChildIterator, DomNode.DescendantElementsIterator<T extends DomNode>
TAB_INDEX_OUT_OF_BOUNDS
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY
AS_TEXT_BLANK, AS_TEXT_BLOCK_SEPARATOR, AS_TEXT_NEW_LINE, AS_TEXT_TAB, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
protected void |
doType(char c,
boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Performs the effective type action, called after the keyPress event and before the keyUp event.
|
protected void |
doType(int keyCode,
boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Performs the effective type action, called after the keyPress event and before the keyUp event.
|
String |
getSelectedText()
Returns the selected text in this element, or
null if there is no selected text in this element. |
int |
getSelectionEnd()
Returns the end position of the selected text in this element.
|
int |
getSelectionStart()
Returns the start position of the selected text in this element.
|
String |
getText()
Returns all of the text in this element.
|
protected boolean |
isSubmittableByEnter()
Returns
true if clicking Enter (ASCII 10, or '\n') should submit the enclosed form (if any). |
void |
select()
Focuses this element and selects all of its text.
|
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String attributeValue)
Sets the value of the specified attribute.
|
void |
setDefaultValue(String defaultValue)
Sets the default value to use when this element gets reset, if applicable.
|
void |
setSelectionEnd(int selectionEnd)
Sets the end position of the selected text in this element.
|
void |
setSelectionStart(int selectionStart)
Sets the start position of the selected text in this element.
|
void |
setText(String text)
Sets the text in this element.
|
protected void |
typeDone(String newValue)
Called from
DoTypeProcessor . |
click, focus, getAccept, getAcceptAttribute, getAccessKeyAttribute, getAlignAttribute, getAltAttribute, getAutocomplete, getCheckedAttribute, getDefaultStyleDisplay, getDefaultValue, getDisabledAttribute, getMaxLength, getMaxLengthAttribute, getNameAttribute, getNewNames, getOnBlurAttribute, getOnChangeAttribute, getOnFocusAttribute, getOnSelectAttribute, getOriginalName, getPlaceholder, getReadOnlyAttribute, getSize, getSizeAttribute, getSrcAttribute, getSubmitKeyValuePairs, getTabIndexAttribute, getTypeAttribute, getUseMapAttribute, getValueAttribute, isChecked, isDefaultChecked, isDisabled, isReadOnly, isRequired, markAsCreatedByJavascript, propagateClickStateUpdateToParent, removeFocus, reset, setAccept, setAutocomplete, setChecked, setDefaultChecked, setDefaultValue, setMaxLength, setMinLength, setPlaceholder, setReadOnly, setRequired, setSize, setValueAttribute, wasCreatedByJavascript
acceptChar, addHtmlAttributeChangeListener, appendChildIfNoneExists, checkChildHierarchy, detach, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, getCanonicalXPath, getElementsByAttribute, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getHtmlElementsByTagName, getHtmlElementsByTagNames, getLangAttribute, getNodeName, getOnClickAttribute, getOnDblClickAttribute, getOneHtmlElementByAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getSrcAttributeNormalized, getTabIndex, getTextDirectionAttribute, getXmlLangAttribute, hasEventHandlers, isAttributeCaseSensitive, isDisplayed, removeAttribute, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, setAttributeNode, setEventHandler, setEventHandler, setId, type, type, type, type, type, type, type
blur, click, click, click, cloneNode, dblClick, dblClick, doClickFireChangeEvent, doClickFireClickEvent, doClickStateUpdate, fireEvent, fireEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributesMap, getChildElementCount, getChildElements, getElementsByTagName, getElementsByTagNameNS, getEventTargetElement, getFirstElementChild, getId, getLastElementChild, getNextElementSibling, getNodeType, getPreviousElementSibling, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, hasAttributes, isEmptyXmlTagExpanded, isStateUpdateFirst, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, namespaces, preventDefault, printOpeningTagContentAsXml, printXml, removeAttributeNode, removeAttributeNS, rightClick, rightClick, setAttribute, setAttributeNodeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, toString
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, processImportNode, setPrefix
addCharacterDataChangeListener, addDomChangeListener, appendChild, asText, asXml, compareDocumentPosition, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getBaseURI, getByXPath, getByXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getPage, getParentNode, getPreviousSibling, getReadyState, getScriptableObject, getScriptObject, getStartColumnNumber, getStartLineNumber, getTextContent, getUserData, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isBlock, isDefaultNamespace, isDirectlyAttachedToPage, isEqualNode, isSameNode, isSupported, isTrimmedText, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, querySelector, querySelectorAll, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptableObject, setTextContent, setUserData
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
focus, getPage
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
protected void doType(char c, boolean shiftKey, boolean ctrlKey, boolean altKey)
doType
in class HtmlElement
c
- the character you with to simulate typingshiftKey
- true
if SHIFT is pressed during the typingctrlKey
- true
if CTRL is pressed during the typingaltKey
- true
if ALT is pressed during the typingprotected void doType(int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)
KeyboardEvent.DOM_VK_PAGE_DOWN
.doType
in class HtmlElement
keyCode
- the key code wish to simulate typingshiftKey
- true
if SHIFT is pressed during the typingctrlKey
- true
if CTRL is pressed during the typingaltKey
- true
if ALT is pressed during the typingprotected void typeDone(String newValue)
DoTypeProcessor
.typeDone
in class HtmlElement
newValue
- the new valueprotected boolean isSubmittableByEnter()
true
if clicking Enter (ASCII 10, or '\n') should submit the enclosed form (if any).
The default implementation returns false
.isSubmittableByEnter
in class HtmlElement
true
if clicking Enter should submit the enclosed form (if any)public void select()
select
in interface SelectableTextInput
public String getSelectedText()
null
if there is no selected text in this element.getSelectedText
in interface SelectableTextInput
null
if there is no selected text in this elementpublic String getText()
getText
in interface SelectableTextInput
public void setText(String text)
setText
in interface SelectableTextInput
text
- the text to put in this elementpublic int getSelectionStart()
getSelectionStart
in interface SelectableTextInput
public void setSelectionStart(int selectionStart)
setSelectionStart
in interface SelectableTextInput
selectionStart
- the start position of the selected text in this elementpublic int getSelectionEnd()
getSelectionEnd
in interface SelectableTextInput
public void setSelectionEnd(int selectionEnd)
setSelectionEnd
in interface SelectableTextInput
selectionEnd
- the end position of the selected text in this elementpublic void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
setAttributeNS
in interface Element
setAttributeNS
in class HtmlInput
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name of the attributeattributeValue
- the value of the attributeprotected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void setDefaultValue(String defaultValue)
setDefaultValue
in interface SubmittableElement
setDefaultValue
in class HtmlInput
defaultValue
- the default value to use when this element gets reset, if applicableSubmittableElement.setDefaultValue(String)
,
HtmlFileInput.setDefaultValue(String)
Copyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.