Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CheckBox |
|
| 0.0;0 |
1 | package net.sf.jolene.dom; | |
2 | ||
3 | /** | |
4 | * A checkbox in a html document. | |
5 | * | |
6 | * @author Dan Howard | |
7 | * @since Oct 14, 2005 6:18:36 AM | |
8 | */ | |
9 | 3 | public final class CheckBox extends HTMLElement { |
10 | /** | |
11 | * Default constructor. | |
12 | */ | |
13 | 18 | public CheckBox() { |
14 | 18 | setAttribute("type", "checkbox"); |
15 | 18 | } |
16 | ||
17 | /** | |
18 | * Construct a checkbox with the specified name. | |
19 | * | |
20 | * @param name name of the checkbox. | |
21 | */ | |
22 | 2 | public CheckBox(String name) { |
23 | 2 | setName(name); |
24 | 2 | setAttribute("type", "checkbox"); |
25 | 2 | } |
26 | ||
27 | /** | |
28 | * Returns a clone of the checkbox object. | |
29 | * | |
30 | * @return CheckBox object. | |
31 | */ | |
32 | @Override | |
33 | public CheckBox clone() { | |
34 | 3 | return (CheckBox) super.clone(); |
35 | } | |
36 | ||
37 | /** | |
38 | * Sets the name of the checkbox. | |
39 | * | |
40 | * @param name name of the checkbox. | |
41 | */ | |
42 | @Override | |
43 | public void setName(String name) { | |
44 | 20 | super.setName(name); |
45 | 20 | setAttribute("name", name); |
46 | 20 | } |
47 | ||
48 | /** | |
49 | * Sets the value of the checbox. See setChecked to indicate it has been checked. | |
50 | * | |
51 | * @param value value of the checkbox. | |
52 | * @see net.sf.jolene.dom.HTMLElement#setChecked(boolean) | |
53 | */ | |
54 | @Override | |
55 | public void setValue(String value) { | |
56 | 15 | super.setValue(value); |
57 | 15 | setAttribute("value", value); |
58 | 15 | } |
59 | } |