001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.html5;
014
015import org.apache.juneau.annotation.*;
016import org.apache.juneau.internal.*;
017
018/**
019 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#the-option-element">&lt;option&gt;</a>
020 * element.
021 *
022 * <h5 class='section'>See Also:</h5><ul>
023 *    <li class='link'><a class="doclink" href="../../../../../index.html#jd.Html5">Overview &gt; juneau-dto &gt; HTML5</a>
024 * </ul>
025 */
026@Bean(typeName="option")
027@FluentSetters
028public class Option extends HtmlElementText {
029
030   /**
031    * Creates an empty {@link Option} element.
032    */
033   public Option() {}
034
035   /**
036    * Creates an {@link Option} element with the specified {@link Option#text(Object)} attribute.
037    *
038    * @param text The {@link Option#text(Object)} attribute.
039    */
040   public Option(Object text) {
041      text(text);
042   }
043
044   /**
045    * Creates an {@link Option} element with the specified {@link Option#value(Object)} attribute and
046    * {@link Option#text(Object)} node.
047    *
048    * @param value The {@link Option#value(Object)} attribute.
049    * @param text The {@link Option#text(Object)} node.
050    */
051   public Option(Object value, Object text) {
052      value(value).text(text);
053   }
054
055   /**
056    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-disabled">disabled</a> attribute.
057    *
058    * <p>
059    * Whether the form control is disabled.
060    *
061    * @param disabled
062    *    The new value for this attribute.
063    *    Typically a {@link Boolean} or {@link String}.
064    * @return This object.
065    */
066   public final Option disabled(Object disabled) {
067      attr("disabled", deminimize(disabled, "disabled"));
068      return this;
069   }
070
071   /**
072    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-label">label</a> attribute.
073    *
074    * <p>
075    * User-visible label.
076    *
077    * @param label The new value for this attribute.
078    * @return This object.
079    */
080   public final Option label(String label) {
081      attr("label", label);
082      return this;
083   }
084
085   /**
086    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-selected">selected</a> attribute.
087    *
088    * <p>
089    * Whether the option is selected by default.
090    *
091    * @param selected
092    *    The new value for this attribute.
093    *    Typically a {@link Boolean} or {@link String}.
094    * @return This object.
095    */
096   public final Option selected(Object selected) {
097      attr("selected", deminimize(selected, "selected"));
098      return this;
099   }
100
101   /**
102    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-value">value</a> attribute.
103    *
104    * <p>
105    * Value to be used for form submission.
106    *
107    * @param value
108    *    The new value for this attribute.
109    *    Typically a {@link Number} or {@link String}.
110    * @return This object.
111    */
112   public final Option value(Object value) {
113      attr("value", value);
114      return this;
115   }
116
117
118   //-----------------------------------------------------------------------------------------------------------------
119   // Overridden methods
120   //-----------------------------------------------------------------------------------------------------------------
121
122   // <FluentSetters>
123
124   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
125   public Option _class(String _class) {
126      super._class(_class);
127      return this;
128   }
129
130   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
131   public Option accesskey(String accesskey) {
132      super.accesskey(accesskey);
133      return this;
134   }
135
136   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
137   public Option contenteditable(Object contenteditable) {
138      super.contenteditable(contenteditable);
139      return this;
140   }
141
142   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
143   public Option dir(String dir) {
144      super.dir(dir);
145      return this;
146   }
147
148   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
149   public Option hidden(Object hidden) {
150      super.hidden(hidden);
151      return this;
152   }
153
154   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
155   public Option id(String id) {
156      super.id(id);
157      return this;
158   }
159
160   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
161   public Option lang(String lang) {
162      super.lang(lang);
163      return this;
164   }
165
166   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
167   public Option onabort(String onabort) {
168      super.onabort(onabort);
169      return this;
170   }
171
172   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
173   public Option onblur(String onblur) {
174      super.onblur(onblur);
175      return this;
176   }
177
178   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
179   public Option oncancel(String oncancel) {
180      super.oncancel(oncancel);
181      return this;
182   }
183
184   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
185   public Option oncanplay(String oncanplay) {
186      super.oncanplay(oncanplay);
187      return this;
188   }
189
190   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
191   public Option oncanplaythrough(String oncanplaythrough) {
192      super.oncanplaythrough(oncanplaythrough);
193      return this;
194   }
195
196   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
197   public Option onchange(String onchange) {
198      super.onchange(onchange);
199      return this;
200   }
201
202   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
203   public Option onclick(String onclick) {
204      super.onclick(onclick);
205      return this;
206   }
207
208   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
209   public Option oncuechange(String oncuechange) {
210      super.oncuechange(oncuechange);
211      return this;
212   }
213
214   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
215   public Option ondblclick(String ondblclick) {
216      super.ondblclick(ondblclick);
217      return this;
218   }
219
220   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
221   public Option ondurationchange(String ondurationchange) {
222      super.ondurationchange(ondurationchange);
223      return this;
224   }
225
226   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
227   public Option onemptied(String onemptied) {
228      super.onemptied(onemptied);
229      return this;
230   }
231
232   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
233   public Option onended(String onended) {
234      super.onended(onended);
235      return this;
236   }
237
238   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
239   public Option onerror(String onerror) {
240      super.onerror(onerror);
241      return this;
242   }
243
244   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
245   public Option onfocus(String onfocus) {
246      super.onfocus(onfocus);
247      return this;
248   }
249
250   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
251   public Option oninput(String oninput) {
252      super.oninput(oninput);
253      return this;
254   }
255
256   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
257   public Option oninvalid(String oninvalid) {
258      super.oninvalid(oninvalid);
259      return this;
260   }
261
262   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
263   public Option onkeydown(String onkeydown) {
264      super.onkeydown(onkeydown);
265      return this;
266   }
267
268   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
269   public Option onkeypress(String onkeypress) {
270      super.onkeypress(onkeypress);
271      return this;
272   }
273
274   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
275   public Option onkeyup(String onkeyup) {
276      super.onkeyup(onkeyup);
277      return this;
278   }
279
280   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
281   public Option onload(String onload) {
282      super.onload(onload);
283      return this;
284   }
285
286   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
287   public Option onloadeddata(String onloadeddata) {
288      super.onloadeddata(onloadeddata);
289      return this;
290   }
291
292   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
293   public Option onloadedmetadata(String onloadedmetadata) {
294      super.onloadedmetadata(onloadedmetadata);
295      return this;
296   }
297
298   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
299   public Option onloadstart(String onloadstart) {
300      super.onloadstart(onloadstart);
301      return this;
302   }
303
304   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
305   public Option onmousedown(String onmousedown) {
306      super.onmousedown(onmousedown);
307      return this;
308   }
309
310   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
311   public Option onmouseenter(String onmouseenter) {
312      super.onmouseenter(onmouseenter);
313      return this;
314   }
315
316   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
317   public Option onmouseleave(String onmouseleave) {
318      super.onmouseleave(onmouseleave);
319      return this;
320   }
321
322   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
323   public Option onmousemove(String onmousemove) {
324      super.onmousemove(onmousemove);
325      return this;
326   }
327
328   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
329   public Option onmouseout(String onmouseout) {
330      super.onmouseout(onmouseout);
331      return this;
332   }
333
334   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
335   public Option onmouseover(String onmouseover) {
336      super.onmouseover(onmouseover);
337      return this;
338   }
339
340   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
341   public Option onmouseup(String onmouseup) {
342      super.onmouseup(onmouseup);
343      return this;
344   }
345
346   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
347   public Option onmousewheel(String onmousewheel) {
348      super.onmousewheel(onmousewheel);
349      return this;
350   }
351
352   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
353   public Option onpause(String onpause) {
354      super.onpause(onpause);
355      return this;
356   }
357
358   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
359   public Option onplay(String onplay) {
360      super.onplay(onplay);
361      return this;
362   }
363
364   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
365   public Option onplaying(String onplaying) {
366      super.onplaying(onplaying);
367      return this;
368   }
369
370   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
371   public Option onprogress(String onprogress) {
372      super.onprogress(onprogress);
373      return this;
374   }
375
376   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
377   public Option onratechange(String onratechange) {
378      super.onratechange(onratechange);
379      return this;
380   }
381
382   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
383   public Option onreset(String onreset) {
384      super.onreset(onreset);
385      return this;
386   }
387
388   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
389   public Option onresize(String onresize) {
390      super.onresize(onresize);
391      return this;
392   }
393
394   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
395   public Option onscroll(String onscroll) {
396      super.onscroll(onscroll);
397      return this;
398   }
399
400   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
401   public Option onseeked(String onseeked) {
402      super.onseeked(onseeked);
403      return this;
404   }
405
406   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
407   public Option onseeking(String onseeking) {
408      super.onseeking(onseeking);
409      return this;
410   }
411
412   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
413   public Option onselect(String onselect) {
414      super.onselect(onselect);
415      return this;
416   }
417
418   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
419   public Option onshow(String onshow) {
420      super.onshow(onshow);
421      return this;
422   }
423
424   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
425   public Option onstalled(String onstalled) {
426      super.onstalled(onstalled);
427      return this;
428   }
429
430   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
431   public Option onsubmit(String onsubmit) {
432      super.onsubmit(onsubmit);
433      return this;
434   }
435
436   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
437   public Option onsuspend(String onsuspend) {
438      super.onsuspend(onsuspend);
439      return this;
440   }
441
442   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
443   public Option ontimeupdate(String ontimeupdate) {
444      super.ontimeupdate(ontimeupdate);
445      return this;
446   }
447
448   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
449   public Option ontoggle(String ontoggle) {
450      super.ontoggle(ontoggle);
451      return this;
452   }
453
454   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
455   public Option onvolumechange(String onvolumechange) {
456      super.onvolumechange(onvolumechange);
457      return this;
458   }
459
460   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
461   public Option onwaiting(String onwaiting) {
462      super.onwaiting(onwaiting);
463      return this;
464   }
465
466   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
467   public Option spellcheck(Object spellcheck) {
468      super.spellcheck(spellcheck);
469      return this;
470   }
471
472   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
473   public Option style(String style) {
474      super.style(style);
475      return this;
476   }
477
478   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
479   public Option tabindex(Object tabindex) {
480      super.tabindex(tabindex);
481      return this;
482   }
483
484   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
485   public Option title(String title) {
486      super.title(title);
487      return this;
488   }
489
490   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
491   public Option translate(Object translate) {
492      super.translate(translate);
493      return this;
494   }
495
496   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElementText */
497   public Option text(Object text) {
498      super.text(text);
499      return this;
500   }
501
502   // </FluentSetters>
503}