Package org.htmlunit.html.impl
Interface SelectableTextInput
- All Known Implementing Classes:
HtmlDateInput
,HtmlEmailInput
,HtmlNumberInput
,HtmlPasswordInput
,HtmlSearchInput
,HtmlSelectableTextInput
,HtmlTelInput
,HtmlTextArea
,HtmlTextInput
,HtmlTimeInput
,HtmlUrlInput
public interface SelectableTextInput
Internal interface which defines an input element which contains selectable text. This interface just keeps
the various implementations in sync as to selection functionality, and provides a definition of the functionality
required by the
SelectableTextSelectionDelegate
so that it can do its job.
This interface is not public because it is an internal contract.-
Method Summary
Modifier and TypeMethodDescriptionvoid
focus()
Focuses this element.getPage()
Returns the page which contains this element.Returns the selected text in this element, ornull
if there is no selected text in this element.int
Returns the end position of the selected text in this element.int
Returns the start position of the selected text in this element.getText()
Returns all of the text in this element.void
select()
Focuses this element and selects all of its text.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
Sets the text in this element.
-
Method Details
-
getPage
Page getPage()Returns the page which contains this element.- Returns:
- the page which contains this element
-
focus
void focus()Focuses this element. -
select
void select()Focuses this element and selects all of its text. -
getText
String getText()Returns all of the text in this element.- Returns:
- all of the text in this element
-
setText
Sets the text in this element.- Parameters:
text
- the text to put in this element
-
getSelectedText
String getSelectedText()Returns the selected text in this element, ornull
if there is no selected text in this element.- Returns:
- the selected text in this element, or
null
if there is no selected text in this element
-
getSelectionStart
int getSelectionStart()Returns the start position of the selected text in this element.- Returns:
- the start position of the selected text in this element
-
setSelectionStart
void setSelectionStart(int selectionStart) Sets the start position of the selected text in this element.- Parameters:
selectionStart
- the start position of the selected text in this element
-
getSelectionEnd
int getSelectionEnd()Returns the end position of the selected text in this element.- Returns:
- the end position of the selected text in this element
-
setSelectionEnd
void setSelectionEnd(int selectionEnd) Sets the end position of the selected text in this element.- Parameters:
selectionEnd
- the end position of the selected text in this element
-