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
public abstract class TextAPIDriver extends LightSupportiveDriver implements TextDriver
Superclass for all TextDrivers using API calls.- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
-
Constructor Summary
Constructors Constructor Description TextAPIDriver(java.lang.String[] supported)Constructs a ChoiceDriver.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidchangeCaretPosition(ComponentOperator oper, int position)Moves caret.voidchangeText(ComponentOperator oper, java.lang.String text)Replace component text.voidclearText(ComponentOperator oper)Clears component text.voidenterText(ComponentOperator oper, java.lang.String text)Type text and push enter.abstract intgetCaretPosition(ComponentOperator oper)Returns current caret position.abstract intgetSelectionEnd(ComponentOperator oper)Returns a caret position of selection end.abstract intgetSelectionStart(ComponentOperator oper)Returns a caret position of selection start.abstract java.lang.StringgetText(ComponentOperator oper)Returns operator's text.voidselectText(ComponentOperator oper, int startPosition, int finalPosition)Selects text.voidtypeText(ComponentOperator oper, java.lang.String text, int caretPosition)Types new text.-
Methods inherited from class org.netbeans.jemmy.drivers.LightSupportiveDriver
checkSupported, getSupported
-
-
-
-
Method Detail
-
changeCaretPosition
public void changeCaretPosition(ComponentOperator oper, int position)
Description copied from interface:TextDriverMoves caret.- Specified by:
changeCaretPositionin interfaceTextDriver- Parameters:
oper- Text component operator.position- Position to move caret to.
-
selectText
public void selectText(ComponentOperator oper, int startPosition, int finalPosition)
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
public void clearText(ComponentOperator oper)
Description copied from interface:TextDriverClears component text.- Specified by:
clearTextin interfaceTextDriver- Parameters:
oper- Text component operator.
-
typeText
public void typeText(ComponentOperator oper, java.lang.String text, int caretPosition)
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
public void changeText(ComponentOperator oper, java.lang.String text)
Description copied from interface:TextDriverReplace component text.- Specified by:
changeTextin interfaceTextDriver- Parameters:
oper- Text component operator.text- New text to type.
-
enterText
public void enterText(ComponentOperator oper, java.lang.String text)
Description copied from interface:TextDriverType text and push enter.- Specified by:
enterTextin interfaceTextDriver- Parameters:
oper- Text component operator.text- New text to type.
-
getText
public abstract java.lang.String getText(ComponentOperator oper)
Returns operator's text.- Parameters:
oper- an operator.- Returns:
- string representing component text.
-
getCaretPosition
public abstract int getCaretPosition(ComponentOperator oper)
Returns current caret position.- Parameters:
oper- an operator.- Returns:
- int represnting current operator's caret position.
-
getSelectionStart
public abstract int getSelectionStart(ComponentOperator oper)
Returns a caret position of selection start.- Parameters:
oper- an operator.- Returns:
- int represnting index of operator's selection start.
-
getSelectionEnd
public abstract int getSelectionEnd(ComponentOperator oper)
Returns a caret position of selection end.- Parameters:
oper- an operator.- Returns:
- int represnting index of operator's selection end.
-
-