Package org.netbeans.jemmy.drivers.text
Class TextAPIDriver
java.lang.Object
org.netbeans.jemmy.drivers.LightSupportiveDriver
org.netbeans.jemmy.drivers.text.TextAPIDriver
- All Implemented Interfaces:
LightDriver
,TextDriver
- Direct Known Subclasses:
AWTTextAPIDriver
,SwingTextAPIDriver
Superclass for all TextDrivers using API calls.
- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeCaretPosition
(ComponentOperator oper, int position) Moves caret.void
changeText
(ComponentOperator oper, String text) Replace component text.void
clearText
(ComponentOperator oper) Clears component text.void
enterText
(ComponentOperator oper, String text) Type text and push enter.abstract int
Returns current caret position.abstract int
Returns a caret position of selection end.abstract int
Returns a caret position of selection start.abstract String
getText
(ComponentOperator oper) Returns operator's text.void
selectText
(ComponentOperator oper, int startPosition, int finalPosition) Selects text.void
typeText
(ComponentOperator oper, String text, int caretPosition) Types new text.Methods inherited from class org.netbeans.jemmy.drivers.LightSupportiveDriver
checkSupported, getSupported
-
Constructor Details
-
TextAPIDriver
Constructs a ChoiceDriver.- Parameters:
supported
- an array of supported class names
-
-
Method Details
-
changeCaretPosition
Description copied from interface:TextDriver
Moves caret.- Specified by:
changeCaretPosition
in interfaceTextDriver
- Parameters:
oper
- Text component operator.position
- Position to move caret to.
-
selectText
Description copied from interface:TextDriver
Selects text.- Specified by:
selectText
in interfaceTextDriver
- Parameters:
oper
- Text component operator.startPosition
- a posistion of selction startfinalPosition
- a posistion of selction end
-
clearText
Description copied from interface:TextDriver
Clears component text.- Specified by:
clearText
in interfaceTextDriver
- Parameters:
oper
- Text component operator.
-
typeText
Description copied from interface:TextDriver
Types new text.- Specified by:
typeText
in interfaceTextDriver
- Parameters:
oper
- Text component operator.text
- New text to type.caretPosition
- Type text at that position.
-
changeText
Description copied from interface:TextDriver
Replace component text.- Specified by:
changeText
in interfaceTextDriver
- Parameters:
oper
- Text component operator.text
- New text to type.
-
enterText
Description copied from interface:TextDriver
Type text and push enter.- Specified by:
enterText
in interfaceTextDriver
- Parameters:
oper
- Text component operator.text
- New text to type.
-
getText
Returns operator's text.- Parameters:
oper
- an operator.- Returns:
- string representing component text.
-
getCaretPosition
Returns current caret position.- Parameters:
oper
- an operator.- Returns:
- int represnting current operator's caret position.
-
getSelectionStart
Returns a caret position of selection start.- Parameters:
oper
- an operator.- Returns:
- int represnting index of operator's selection start.
-
getSelectionEnd
Returns a caret position of selection end.- Parameters:
oper
- an operator.- Returns:
- int represnting index of operator's selection end.
-