01: package test.check.command;
02:
03: import java.awt.Component;
04:
05: import javax.swing.AbstractButton;
06: import javax.swing.JButton;
07:
08: /**
09: * A configure command that selects the specified component.
10: *
11: * @author Kirill Grouchnikov
12: */
13: public class SelectCommand implements ConfigurationCommand<Component> {
14: /*
15: * (non-Javadoc)
16: *
17: * @see test.check.ConfigurationCommand#invoke(java.lang.Object)
18: */
19: public void configure(Component ab) {
20: if (ab instanceof JButton)
21: return;
22: if (ab instanceof AbstractButton)
23: ((AbstractButton) ab).setSelected(true);
24: }
25: }
|