Package org.testfx.robot.impl
Class WriteRobotImpl
- java.lang.Object
-
- org.testfx.robot.impl.WriteRobotImpl
-
- All Implemented Interfaces:
WriteRobot
public class WriteRobotImpl extends java.lang.Object implements WriteRobot
-
-
Field Summary
Fields Modifier and Type Field Description private BaseRobotbaseRobotprivate static intSLEEP_AFTER_CHARACTER_IN_MILLISprivate SleepRobotsleepRobotprivate WindowFinderwindowFinder
-
Constructor Summary
Constructors Constructor Description WriteRobotImpl(BaseRobot baseRobot, SleepRobot sleepRobot, WindowFinder windowFinder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private javafx.scene.input.KeyCodedetermineKeyCode(char character)private javafx.stage.WindowfetchTargetWindow()private voidtypeCharacterInScene(char character, javafx.scene.Scene scene)voidwrite(char character)Writes a given text character.voidwrite(java.lang.String text)Writes the given text characters one after the other.voidwrite(java.lang.String text, int sleepMillis)Writes the given text characters one after the other, sleeping forsleepMillismilliseconds after each typed character.
-
-
-
Field Detail
-
SLEEP_AFTER_CHARACTER_IN_MILLIS
private static final int SLEEP_AFTER_CHARACTER_IN_MILLIS
-
baseRobot
private final BaseRobot baseRobot
-
sleepRobot
private final SleepRobot sleepRobot
-
windowFinder
private final WindowFinder windowFinder
-
-
Constructor Detail
-
WriteRobotImpl
public WriteRobotImpl(BaseRobot baseRobot, SleepRobot sleepRobot, WindowFinder windowFinder)
-
-
Method Detail
-
write
public void write(char character)
Description copied from interface:WriteRobotWrites a given text character.- Specified by:
writein interfaceWriteRobot- Parameters:
character- the text character to write
-
write
public void write(java.lang.String text)
Description copied from interface:WriteRobotWrites the given text characters one after the other.- Specified by:
writein interfaceWriteRobot- Parameters:
text- the text characters to write
-
write
public void write(java.lang.String text, int sleepMillis)Description copied from interface:WriteRobotWrites the given text characters one after the other, sleeping forsleepMillismilliseconds after each typed character.- Specified by:
writein interfaceWriteRobot- Parameters:
text- the text characters to writesleepMillis- the milliseconds to sleep for after each character
-
fetchTargetWindow
private javafx.stage.Window fetchTargetWindow()
-
typeCharacterInScene
private void typeCharacterInScene(char character, javafx.scene.Scene scene)
-
determineKeyCode
private javafx.scene.input.KeyCode determineKeyCode(char character)
-
-