1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.html;
16
17 import org.htmlunit.html.DomElement;
18 import org.htmlunit.html.HtmlButton;
19 import org.htmlunit.javascript.configuration.JsxClass;
20 import org.htmlunit.javascript.configuration.JsxConstructor;
21 import org.htmlunit.javascript.configuration.JsxFunction;
22 import org.htmlunit.javascript.configuration.JsxGetter;
23 import org.htmlunit.javascript.configuration.JsxSetter;
24 import org.htmlunit.javascript.host.dom.NodeList;
25
26
27
28
29
30
31
32
33
34
35 @JsxClass(domClass = HtmlButton.class)
36 public class HTMLButtonElement extends HTMLElement {
37
38
39 private NodeList labels_;
40
41
42
43
44 @Override
45 @JsxConstructor
46 public void jsConstructor() {
47 super.jsConstructor();
48 }
49
50
51
52
53
54
55
56 @JsxSetter
57 public void setType(final String newType) {
58 getDomNodeOrDie().setAttribute(DomElement.TYPE_ATTRIBUTE, newType);
59 }
60
61
62
63
64
65 @JsxGetter
66 public String getType() {
67 return ((HtmlButton) getDomNodeOrDie()).getType();
68 }
69
70
71
72
73
74 @JsxGetter
75 public NodeList getLabels() {
76 if (labels_ == null) {
77 labels_ = new LabelsNodeList(getDomNodeOrDie());
78 }
79 return labels_;
80 }
81
82
83
84
85 @JsxGetter
86 @Override
87 public String getName() {
88 return super.getName();
89 }
90
91
92
93
94 @JsxSetter
95 @Override
96 public void setName(final String newName) {
97 super.setName(newName);
98 }
99
100
101
102
103 @Override
104 @JsxGetter
105 public boolean isDisabled() {
106 return super.isDisabled();
107 }
108
109
110
111
112 @Override
113 @JsxSetter
114 public void setDisabled(final boolean disabled) {
115 super.setDisabled(disabled);
116 }
117
118
119
120
121 @JsxGetter
122 @Override
123 public HTMLFormElement getForm() {
124 return super.getForm();
125 }
126
127
128
129
130 @JsxGetter
131 @Override
132 public Object getValue() {
133 return super.getValue();
134 }
135
136
137
138
139 @JsxSetter
140 @Override
141 public void setValue(final Object newValue) {
142 super.setValue(newValue);
143 }
144
145
146
147
148
149 @JsxFunction
150 public boolean checkValidity() {
151 return getDomNodeOrDie().isValid();
152 }
153
154
155
156
157 @JsxGetter
158 public ValidityState getValidity() {
159 final ValidityState validityState = new ValidityState();
160 validityState.setPrototype(getPrototype(validityState.getClass()));
161 validityState.setParentScope(getParentScope());
162 validityState.setDomNode(getDomNodeOrDie());
163 return validityState;
164 }
165
166
167
168
169 @JsxGetter
170 public boolean getWillValidate() {
171 return ((HtmlButton) getDomNodeOrDie()).willValidate();
172 }
173
174
175
176
177
178 @JsxFunction
179 public void setCustomValidity(final String message) {
180 ((HtmlButton) getDomNodeOrDie()).setCustomValidity(message);
181 }
182
183
184
185
186
187 @JsxGetter
188 public boolean isFormNoValidate() {
189 return ((HtmlButton) getDomNodeOrDie()).isFormNoValidate();
190 }
191
192
193
194
195
196 @JsxSetter
197 public void setFormNoValidate(final boolean value) {
198 ((HtmlButton) getDomNodeOrDie()).setFormNoValidate(value);
199 }
200 }