01: package abbot.tester;
02:
03: import java.awt.Component;
04: import java.awt.Button;
05: import java.awt.event.ActionEvent;
06:
07: /** Provides Button activation support, since otherwise AWT buttons cannot be
08: * activated in AWT mode.
09: */
10: public class ButtonTester extends ComponentTester {
11: /** Programmatically clicks the Button if in AWT mode. */
12: public void click(Component comp, int x, int y, int mask, int count) {
13: if (getEventMode() == EM_AWT) {
14: postEvent(comp, new ActionEvent(comp,
15: ActionEvent.ACTION_PERFORMED, ((Button) comp)
16: .getLabel()));
17: } else {
18: super.click(comp, x, y, mask, count);
19: }
20: }
21: }
|