Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KeyboardStrategy |
|
| 1.0;1 |
1 | /******************************************************************************* | |
2 | * Copyright (c) 2009 SWTBot Committers and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Ketan Padegaonkar - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.swtbot.swt.finder.keyboard; | |
12 | ||
13 | import org.eclipse.jface.bindings.keys.KeyStroke; | |
14 | import org.eclipse.swt.widgets.Widget; | |
15 | import org.hamcrest.SelfDescribing; | |
16 | ||
17 | /** | |
18 | * A strategy that can type keys on the keyboard. Implementors are adviced to use {@link AbstractKeyboardStrategy} and | |
19 | * must have a default no-args constructor. | |
20 | * | |
21 | * @see AbstractKeyboardStrategy | |
22 | * @author Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com> | |
23 | * @version $Id$ | |
24 | */ | |
25 | public interface KeyboardStrategy { | |
26 | ||
27 | /** | |
28 | * @param widget the widget on which this keyboard may type. Note that it is not necessary that the strategy | |
29 | * actually types on this widget. | |
30 | * @param description the description of the widget. | |
31 | */ | |
32 | void init(Widget widget, SelfDescribing description); | |
33 | ||
34 | /** | |
35 | * Presses the specified keys. | |
36 | * | |
37 | * @param keys the keystrokes to press down | |
38 | */ | |
39 | void pressKeys(KeyStroke... keys); | |
40 | ||
41 | /** | |
42 | * Presses the specified keys. | |
43 | * | |
44 | * @param keys the keystrokes to press down | |
45 | */ | |
46 | void releaseKeys(KeyStroke... keys); | |
47 | } |