01: package org.uispec4j;
02:
03: import junit.framework.Assert;
04: import org.uispec4j.assertion.Assertion;
05:
06: import javax.swing.*;
07: import java.awt.*;
08:
09: /**
10: * Wrapper for JRadioButton components.
11: */
12: public class RadioButton extends AbstractButton {
13: public static final String TYPE_NAME = "radioButton";
14: public static final Class[] SWING_CLASSES = { JRadioButton.class };
15:
16: private JRadioButton jRadioButton;
17:
18: public RadioButton(JRadioButton radioButton) {
19: super (radioButton);
20: this .jRadioButton = radioButton;
21: }
22:
23: public Component getAwtComponent() {
24: return jRadioButton;
25: }
26:
27: public String getDescriptionTypeName() {
28: return TYPE_NAME;
29: }
30:
31: public Assertion isSelected() {
32: return new Assertion() {
33: public void check() {
34: Assert.assertTrue(jRadioButton.isSelected());
35: }
36: };
37: }
38: }
|