< prev index next >
core/JemmyAWTInput/src/org/jemmy/input/KeyboardImpl.java
Print this page
*** 44,57 ****
CharBindingMap<KeyboardButton, KeyboardModifier> map;
Environment env;
Wrap<?> target;
RobotDriver robotDriver;
private boolean detached;
! /**
! * Constructs a KeyRobotDriver object.
! * @param target
! */
public KeyboardImpl(Wrap<?> target) {
//TODO: super(target.getEnvironment().getTimeout(RobotDriver.ROBOT_DELAY_TIMEOUT_NAME));
robotDriver = new RobotDriver(target.getEnvironment());
this.env = target.getEnvironment();
this.map = target.getEnvironment().getBindingMap();
--- 44,54 ----
CharBindingMap<KeyboardButton, KeyboardModifier> map;
Environment env;
Wrap<?> target;
RobotDriver robotDriver;
private boolean detached;
!
public KeyboardImpl(Wrap<?> target) {
//TODO: super(target.getEnvironment().getTimeout(RobotDriver.ROBOT_DELAY_TIMEOUT_NAME));
robotDriver = new RobotDriver(target.getEnvironment());
this.env = target.getEnvironment();
this.map = target.getEnvironment().getBindingMap();
*** 70,93 ****
} else {
target.getEnvironment().getExecutor().execute(target.getEnvironment(), false, action);
}
}
- /**
- *
- * @return Environment
- */
public Environment getEnvironment() {
return env;
}
- /**
- *
- * @param kbdButton
- * @param modifiers
- * @param pushTime
- */
public void pushKey(final KeyboardButton kbdButton, final Modifier modifiers[], final Timeout pushTime) {
runAction(new Action() {
public void run(Object... parameters) {
if(target.is(Focusable.class)) target.as(Focusable.class).focuser().focus();
pressKey(kbdButton, modifiers);
--- 67,80 ----
*** 99,113 ****
return "push " + kbdButton + " key with " + modifiers + " modifiers";
}
});
}
- /**
- *
- * @param keyChar
- * @param pushTime
- */
@Override
public void typeChar(char keyChar, Timeout pushTime) {
pushKey(pushTime, map.getCharKey(keyChar), map.getCharModifiers(keyChar));
}
--- 86,95 ----
*** 149,199 ****
return "press " + kbdButton + " key with " + modifiers + " modifiers";
}
});
}
- /**
- *
- * @param kbdButton
- */
@Override
public void pressKey(KeyboardButton kbdButton) {
pressKey(kbdButton, new Modifier[]{});
}
! /**
! *
! * @param kbdButton
! */
@Override
public void releaseKey(KeyboardButton kbdButton) {
releaseKey(kbdButton, new Modifier[]{});
}
! /**
! *
! * @param kbdButton
! * @param modifiers
! */
@Override
public void pushKey(KeyboardButton kbdButton, Modifier... modifiers) {
pushKey(kbdButton, modifiers, getEnvironment().getTimeout(PUSH.getName()));
}
- /**
- *
- * @param kbdButton
- */
@Override
public void pushKey(KeyboardButton kbdButton) {
pushKey(kbdButton, new Modifier[]{});
}
- /**
- *
- * @param keyChar
- */
@Override
public void typeChar(char keyChar) {
typeChar(keyChar, getEnvironment().getTimeout(PUSH.getName()));
}
--- 131,162 ----
return "press " + kbdButton + " key with " + modifiers + " modifiers";
}
});
}
@Override
public void pressKey(KeyboardButton kbdButton) {
pressKey(kbdButton, new Modifier[]{});
}
!
@Override
public void releaseKey(KeyboardButton kbdButton) {
releaseKey(kbdButton, new Modifier[]{});
}
!
@Override
public void pushKey(KeyboardButton kbdButton, Modifier... modifiers) {
pushKey(kbdButton, modifiers, getEnvironment().getTimeout(PUSH.getName()));
}
@Override
public void pushKey(KeyboardButton kbdButton) {
pushKey(kbdButton, new Modifier[]{});
}
@Override
public void typeChar(char keyChar) {
typeChar(keyChar, getEnvironment().getTimeout(PUSH.getName()));
}
< prev index next >