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 java.net.*; 016 017import org.apache.juneau.*; 018import org.apache.juneau.annotation.*; 019import org.apache.juneau.internal.*; 020 021/** 022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#the-button-element"><button></a> 023 * element. 024 * 025 * <h5 class='section'>See Also:</h5><ul> 026 * <li class='link'><a class="doclink" href="../../../../../index.html#jd.Html5">Overview > juneau-dto > HTML5</a> 027 * </ul> 028 */ 029@Bean(typeName="button") 030@FluentSetters 031public class Button extends HtmlElementMixed { 032 033 /** 034 * Creates an empty {@link Button} element. 035 */ 036 public Button() {} 037 038 /** 039 * Creates a {@link Button} element with the specified {@link Button#type(String)} attribute. 040 * 041 * @param type The {@link Button#type(String)} attribute. 042 */ 043 public Button(String type) { 044 type(type); 045 } 046 047 /** 048 * Creates a {@link Button} element with the specified {@link Button#type(String)} attribute and 049 * {@link Button#children(Object[])} nodes. 050 * 051 * @param type The {@link Button#type(String)} attribute. 052 * @param children The {@link Button#children(Object[])} nodes. 053 */ 054 public Button(String type, Object...children) { 055 type(type).children(children); 056 } 057 058 /** 059 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute. 060 * 061 * <p> 062 * Automatically focus the form control when the page is loaded. 063 * 064 * @param autofocus 065 * The new value for this attribute. 066 * Typically a {@link Boolean} or {@link String}. 067 * @return This object. 068 */ 069 public final Button autofocus(Object autofocus) { 070 attr("autofocus", autofocus); 071 return this; 072 } 073 074 /** 075 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute. 076 * 077 * <p> 078 * Whether the form control is disabled. 079 * 080 * @param disabled 081 * The new value for this attribute. 082 * Typically a {@link Boolean} or {@link String}. 083 * @return This object. 084 */ 085 public final Button disabled(Object disabled) { 086 attr("disabled", deminimize(disabled, "disabled")); 087 return this; 088 } 089 090 /** 091 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute. 092 * 093 * <p> 094 * Associates the control with a form element. 095 * 096 * @param form The new value for this attribute. 097 * @return This object. 098 */ 099 public final Button form(String form) { 100 attr("form", form); 101 return this; 102 } 103 104 /** 105 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formaction">formaction</a> attribute. 106 * 107 * <p> 108 * URL to use for form submission. 109 * 110 * <p> 111 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 112 * Strings must be valid URIs. 113 * 114 * <p> 115 * URIs defined by {@link UriResolver} can be used for values. 116 * 117 * @param formaction The new value for this attribute. 118 * @return This object. 119 */ 120 public final Button formaction(String formaction) { 121 attrUri("formaction", formaction); 122 return this; 123 } 124 125 /** 126 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formenctype">formenctype</a> attribute. 127 * 128 * <p> 129 * Form data set encoding type to use for form submission. 130 * 131 * @param formenctype The new value for this attribute. 132 * @return This object. 133 */ 134 public final Button formenctype(String formenctype) { 135 attr("formenctype", formenctype); 136 return this; 137 } 138 139 /** 140 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formmethod">formmethod</a> attribute. 141 * 142 * <p> 143 * HTTP method to use for form submission. 144 * 145 * @param formmethod The new value for this attribute. 146 * @return This object. 147 */ 148 public final Button formmethod(String formmethod) { 149 attr("formmethod", formmethod); 150 return this; 151 } 152 153 /** 154 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formnovalidate">formnovalidate</a> 155 * attribute. 156 * 157 * <p> 158 * Bypass form control validation for form submission. 159 * 160 * @param formnovalidate The new value for this attribute. 161 * @return This object. 162 */ 163 public final Button formnovalidate(String formnovalidate) { 164 attr("formnovalidate", formnovalidate); 165 return this; 166 } 167 168 /** 169 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formtarget">formtarget</a> attribute. 170 * 171 * <p> 172 * Browsing context for form submission. 173 * 174 * @param formtarget The new value for this attribute. 175 * @return This object. 176 */ 177 public final Button formtarget(String formtarget) { 178 attr("formtarget", formtarget); 179 return this; 180 } 181 182 /** 183 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-menu">menu</a> attribute. 184 * 185 * <p> 186 * Specifies the element's designated pop-up menu. 187 * 188 * @param menu The new value for this attribute. 189 * @return This object. 190 */ 191 public final Button menu(String menu) { 192 attr("menu", menu); 193 return this; 194 } 195 196 /** 197 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute. 198 * 199 * <p> 200 * Name of form control to use for form submission and in the form.elements API. 201 * 202 * @param name The new value for this attribute. 203 * @return This object. 204 */ 205 public final Button name(String name) { 206 attr("name", name); 207 return this; 208 } 209 210 /** 211 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-button-type">type</a> attribute. 212 * 213 * <p> 214 * Type of button. 215 * 216 * @param type The new value for this attribute. 217 * @return This object. 218 */ 219 public final Button type(String type) { 220 attr("type", type); 221 return this; 222 } 223 224 /** 225 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-button-value">value</a> attribute. 226 * 227 * <p> 228 * Value to be used for form submission. 229 * 230 * @param value 231 * The new value for this attribute. 232 * Typically a {@link Number} or {@link String}. 233 * @return This object. 234 */ 235 public final Button value(Object value) { 236 attr("value", value); 237 return this; 238 } 239 240 241 //----------------------------------------------------------------------------------------------------------------- 242 // Overridden methods 243 //----------------------------------------------------------------------------------------------------------------- 244 245 // <FluentSetters> 246 247 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 248 public Button _class(String _class) { 249 super._class(_class); 250 return this; 251 } 252 253 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 254 public Button accesskey(String accesskey) { 255 super.accesskey(accesskey); 256 return this; 257 } 258 259 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 260 public Button contenteditable(Object contenteditable) { 261 super.contenteditable(contenteditable); 262 return this; 263 } 264 265 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 266 public Button dir(String dir) { 267 super.dir(dir); 268 return this; 269 } 270 271 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 272 public Button hidden(Object hidden) { 273 super.hidden(hidden); 274 return this; 275 } 276 277 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 278 public Button id(String id) { 279 super.id(id); 280 return this; 281 } 282 283 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 284 public Button lang(String lang) { 285 super.lang(lang); 286 return this; 287 } 288 289 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 290 public Button onabort(String onabort) { 291 super.onabort(onabort); 292 return this; 293 } 294 295 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 296 public Button onblur(String onblur) { 297 super.onblur(onblur); 298 return this; 299 } 300 301 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 302 public Button oncancel(String oncancel) { 303 super.oncancel(oncancel); 304 return this; 305 } 306 307 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 308 public Button oncanplay(String oncanplay) { 309 super.oncanplay(oncanplay); 310 return this; 311 } 312 313 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 314 public Button oncanplaythrough(String oncanplaythrough) { 315 super.oncanplaythrough(oncanplaythrough); 316 return this; 317 } 318 319 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 320 public Button onchange(String onchange) { 321 super.onchange(onchange); 322 return this; 323 } 324 325 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 326 public Button onclick(String onclick) { 327 super.onclick(onclick); 328 return this; 329 } 330 331 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 332 public Button oncuechange(String oncuechange) { 333 super.oncuechange(oncuechange); 334 return this; 335 } 336 337 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 338 public Button ondblclick(String ondblclick) { 339 super.ondblclick(ondblclick); 340 return this; 341 } 342 343 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 344 public Button ondurationchange(String ondurationchange) { 345 super.ondurationchange(ondurationchange); 346 return this; 347 } 348 349 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 350 public Button onemptied(String onemptied) { 351 super.onemptied(onemptied); 352 return this; 353 } 354 355 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 356 public Button onended(String onended) { 357 super.onended(onended); 358 return this; 359 } 360 361 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 362 public Button onerror(String onerror) { 363 super.onerror(onerror); 364 return this; 365 } 366 367 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 368 public Button onfocus(String onfocus) { 369 super.onfocus(onfocus); 370 return this; 371 } 372 373 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 374 public Button oninput(String oninput) { 375 super.oninput(oninput); 376 return this; 377 } 378 379 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 380 public Button oninvalid(String oninvalid) { 381 super.oninvalid(oninvalid); 382 return this; 383 } 384 385 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 386 public Button onkeydown(String onkeydown) { 387 super.onkeydown(onkeydown); 388 return this; 389 } 390 391 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 392 public Button onkeypress(String onkeypress) { 393 super.onkeypress(onkeypress); 394 return this; 395 } 396 397 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 398 public Button onkeyup(String onkeyup) { 399 super.onkeyup(onkeyup); 400 return this; 401 } 402 403 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 404 public Button onload(String onload) { 405 super.onload(onload); 406 return this; 407 } 408 409 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 410 public Button onloadeddata(String onloadeddata) { 411 super.onloadeddata(onloadeddata); 412 return this; 413 } 414 415 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 416 public Button onloadedmetadata(String onloadedmetadata) { 417 super.onloadedmetadata(onloadedmetadata); 418 return this; 419 } 420 421 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 422 public Button onloadstart(String onloadstart) { 423 super.onloadstart(onloadstart); 424 return this; 425 } 426 427 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 428 public Button onmousedown(String onmousedown) { 429 super.onmousedown(onmousedown); 430 return this; 431 } 432 433 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 434 public Button onmouseenter(String onmouseenter) { 435 super.onmouseenter(onmouseenter); 436 return this; 437 } 438 439 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 440 public Button onmouseleave(String onmouseleave) { 441 super.onmouseleave(onmouseleave); 442 return this; 443 } 444 445 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 446 public Button onmousemove(String onmousemove) { 447 super.onmousemove(onmousemove); 448 return this; 449 } 450 451 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 452 public Button onmouseout(String onmouseout) { 453 super.onmouseout(onmouseout); 454 return this; 455 } 456 457 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 458 public Button onmouseover(String onmouseover) { 459 super.onmouseover(onmouseover); 460 return this; 461 } 462 463 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 464 public Button onmouseup(String onmouseup) { 465 super.onmouseup(onmouseup); 466 return this; 467 } 468 469 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 470 public Button onmousewheel(String onmousewheel) { 471 super.onmousewheel(onmousewheel); 472 return this; 473 } 474 475 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 476 public Button onpause(String onpause) { 477 super.onpause(onpause); 478 return this; 479 } 480 481 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 482 public Button onplay(String onplay) { 483 super.onplay(onplay); 484 return this; 485 } 486 487 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 488 public Button onplaying(String onplaying) { 489 super.onplaying(onplaying); 490 return this; 491 } 492 493 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 494 public Button onprogress(String onprogress) { 495 super.onprogress(onprogress); 496 return this; 497 } 498 499 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 500 public Button onratechange(String onratechange) { 501 super.onratechange(onratechange); 502 return this; 503 } 504 505 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 506 public Button onreset(String onreset) { 507 super.onreset(onreset); 508 return this; 509 } 510 511 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 512 public Button onresize(String onresize) { 513 super.onresize(onresize); 514 return this; 515 } 516 517 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 518 public Button onscroll(String onscroll) { 519 super.onscroll(onscroll); 520 return this; 521 } 522 523 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 524 public Button onseeked(String onseeked) { 525 super.onseeked(onseeked); 526 return this; 527 } 528 529 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 530 public Button onseeking(String onseeking) { 531 super.onseeking(onseeking); 532 return this; 533 } 534 535 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 536 public Button onselect(String onselect) { 537 super.onselect(onselect); 538 return this; 539 } 540 541 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 542 public Button onshow(String onshow) { 543 super.onshow(onshow); 544 return this; 545 } 546 547 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 548 public Button onstalled(String onstalled) { 549 super.onstalled(onstalled); 550 return this; 551 } 552 553 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 554 public Button onsubmit(String onsubmit) { 555 super.onsubmit(onsubmit); 556 return this; 557 } 558 559 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 560 public Button onsuspend(String onsuspend) { 561 super.onsuspend(onsuspend); 562 return this; 563 } 564 565 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 566 public Button ontimeupdate(String ontimeupdate) { 567 super.ontimeupdate(ontimeupdate); 568 return this; 569 } 570 571 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 572 public Button ontoggle(String ontoggle) { 573 super.ontoggle(ontoggle); 574 return this; 575 } 576 577 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 578 public Button onvolumechange(String onvolumechange) { 579 super.onvolumechange(onvolumechange); 580 return this; 581 } 582 583 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 584 public Button onwaiting(String onwaiting) { 585 super.onwaiting(onwaiting); 586 return this; 587 } 588 589 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 590 public Button spellcheck(Object spellcheck) { 591 super.spellcheck(spellcheck); 592 return this; 593 } 594 595 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 596 public Button style(String style) { 597 super.style(style); 598 return this; 599 } 600 601 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 602 public Button tabindex(Object tabindex) { 603 super.tabindex(tabindex); 604 return this; 605 } 606 607 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 608 public Button title(String title) { 609 super.title(title); 610 return this; 611 } 612 613 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */ 614 public Button translate(Object translate) { 615 super.translate(translate); 616 return this; 617 } 618 619 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElementMixed */ 620 public Button child(Object child) { 621 super.child(child); 622 return this; 623 } 624 625 @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElementMixed */ 626 public Button children(Object...children) { 627 super.children(children); 628 return this; 629 } 630 631 // </FluentSetters> 632}