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