Class TextKeyboardDriver
java.lang.Object
org.netbeans.jemmy.drivers.LightSupportiveDriver
org.netbeans.jemmy.drivers.text.TextKeyboardDriver
- All Implemented Interfaces:
LightDriver, TextDriver
- Direct Known Subclasses:
AWTTextKeyboardDriver, SwingTextKeyboardDriver
Superclass for all TextDrivers using keyboard.
- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeCaretPosition(ComponentOperator oper, int position) Moves caret.protected voidchangeCaretPosition(ComponentOperator oper, int position, int preModifiers) Changes current caret position to specifyed.voidchangeText(ComponentOperator oper, String text) Replace component text.voidclearText(ComponentOperator oper) Clears component text.voidenterText(ComponentOperator oper, String text) Type text and push enter.abstract TimeoutReturns a timeout to sleep between text typing and caret operations.abstract intReturns current caret position.abstract org.netbeans.jemmy.drivers.text.NavigationKey[]getKeys(ComponentOperator oper) Returns an array of navigation keys.abstract intReturns a caret position of selection end.abstract intReturns a caret position of selection start.abstract StringgetText(ComponentOperator oper) Returns operator's text.voidselectText(ComponentOperator oper, int startPosition, int finalPosition) Selects text.voidtypeText(ComponentOperator oper, String text, int caretPosition) Types new text.Methods inherited from class LightSupportiveDriver
checkSupported, getSupported
-
Constructor Details
-
TextKeyboardDriver
Constructs a TextKeyboardDriver.- Parameters:
supported- an array of supported class names
-
-
Method Details
-
changeCaretPosition
Description copied from interface:TextDriverMoves caret.- Specified by:
changeCaretPositionin interfaceTextDriver- Parameters:
oper- Text component operator.position- Position to move caret to.
-
selectText
Description copied from interface:TextDriverSelects text.- Specified by:
selectTextin interfaceTextDriver- Parameters:
oper- Text component operator.startPosition- a posistion of selction startfinalPosition- a posistion of selction end
-
clearText
Description copied from interface:TextDriverClears component text.- Specified by:
clearTextin interfaceTextDriver- Parameters:
oper- Text component operator.
-
typeText
Description copied from interface:TextDriverTypes new text.- Specified by:
typeTextin interfaceTextDriver- Parameters:
oper- Text component operator.text- New text to type.caretPosition- Type text at that position.
-
changeText
Description copied from interface:TextDriverReplace component text.- Specified by:
changeTextin interfaceTextDriver- Parameters:
oper- Text component operator.text- New text to type.
-
enterText
Description copied from interface:TextDriverType text and push enter.- Specified by:
enterTextin 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.
-
getKeys
Returns an array of navigation keys.- Parameters:
oper- an operator.- Returns:
- an array on NavigationKey instances.
-
getBetweenTimeout
Returns a timeout to sleep between text typing and caret operations.- Parameters:
oper- an operator.- Returns:
- a Timeout instance.
-
changeCaretPosition
Changes current caret position to specifyed.- Parameters:
oper- an operator.position- new caret positionpreModifiers- a modifiers (combination ofInputEvent.*_MASKfields) pushed before caret moving (like shift during text selection).
-