org.eclipse.swtbot.swt.finder.keyboard
Class AbstractKeyboardStrategy

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.keyboard.AbstractKeyboardStrategy
All Implemented Interfaces:
KeyboardStrategy

public abstract class AbstractKeyboardStrategy
extends Object
implements KeyboardStrategy

Implementors must have a default no-args constructor.

Version:
$Id$
Author:
Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>

Field Summary
protected  org.apache.log4j.Logger log
           
 
Constructor Summary
protected AbstractKeyboardStrategy()
           
 
Method Summary
 void init(Widget widget, SelfDescribing description)
           
protected abstract  void pressKey(KeyStroke key)
          Presses the specified key.
 void pressKeys(KeyStroke... keys)
          Presses the specified keys.
protected abstract  void releaseKey(KeyStroke key)
          Releases the specified key.
 void releaseKeys(KeyStroke... keys)
          Presses the specified keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.log4j.Logger log
Constructor Detail

AbstractKeyboardStrategy

protected AbstractKeyboardStrategy()
Method Detail

init

public void init(Widget widget,
                 SelfDescribing description)
Specified by:
init in interface KeyboardStrategy
Parameters:
widget - the widget on which this keyboard may type. Note that it is not necessary that the strategy actually types on this widget.
description - the description of the widget.

pressKey

protected abstract void pressKey(KeyStroke key)
Presses the specified key.

Parameters:
key - the keystroke to press down

releaseKey

protected abstract void releaseKey(KeyStroke key)
Releases the specified key.

Parameters:
key - the keystroke to release.

pressKeys

public void pressKeys(KeyStroke... keys)
Description copied from interface: KeyboardStrategy
Presses the specified keys.

Specified by:
pressKeys in interface KeyboardStrategy
Parameters:
keys - the keystrokes to press down

releaseKeys

public void releaseKeys(KeyStroke... keys)
Description copied from interface: KeyboardStrategy
Presses the specified keys.

Specified by:
releaseKeys in interface KeyboardStrategy
Parameters:
keys - the keystrokes to press down