|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.html.impl.SelectionDelegate
public class SelectionDelegate
Contains standard selection-related functionality used by various input elements.
From the HTML5 spec:
Mostly for historical reasons, in addition to the browsing context's selection, each textarea and input element has an independent selection. These are the text field selections.
Constructor Summary | |
---|---|
SelectionDelegate(SelectableTextInput element)
Creates a new instance for the specified element. |
Method Summary | |
---|---|
String |
getSelectedText()
Returns the selected text in the owner element, or null if there is no selected text. |
int |
getSelectionEnd()
Returns the end position of the selected text in the owner element. |
int |
getSelectionStart()
Returns the start position of the selected text in the owner element. |
void |
select()
Focuses the owner element and selects all of its text. |
void |
setSelectionEnd(int selectionEnd)
Sets the end position of the selected text in the owner element. |
void |
setSelectionStart(int selectionStart)
Sets the start position of the selected text in the owner element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectionDelegate(SelectableTextInput element)
element
- the owner elementMethod Detail |
---|
public void select()
public String getSelectedText()
public int getSelectionStart()
public void setSelectionStart(int selectionStart)
selectionStart
- the start position of the selected text in the owner elementpublic int getSelectionEnd()
public void setSelectionEnd(int selectionEnd)
selectionEnd
- the end position of the selected text in the owner element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |