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.*; 020 021/** 022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#the-col-element"><col></a> 023 * element. 024 * 025 * <p> 026 * The col element represents one or more columns in a column group represented by its parent colgroup 027 * element. It is used to define the structural columns of a table and can specify attributes that apply 028 * to all cells in those columns. The col element is a void element that does not contain any content 029 * and is typically used within a colgroup element to define column properties such as width, alignment, 030 * and styling. 031 * 032 * <h5 class='section'>Examples:</h5> 033 * <p class='bcode w800'> 034 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 035 * 036 * <jc>// Simple column</jc> 037 * Col <jv>simple</jv> = <jsm>col</jsm>(); 038 * 039 * <jc>// Column spanning multiple columns</jc> 040 * Col <jv>spanning</jv> = <jsm>col</jsm>().span(3); 041 * 042 * <jc>// Column with styling</jc> 043 * Col <jv>styled</jv> = <jsm>col</jsm>() 044 * ._class(<js>"highlight-column"</js>) 045 * .style(<js>"background-color: #f0f0f0;"</js>); 046 * 047 * <jc>// Column with width</jc> 048 * Col <jv>withWidth</jv> = <jsm>col</jsm>() 049 * .style(<js>"width: 200px;"</js>); 050 * 051 * <jc>// Column with alignment</jc> 052 * Col <jv>aligned</jv> = <jsm>col</jsm>() 053 * .style(<js>"text-align: center;"</js>); 054 * 055 * <jc>// Column with ID</jc> 056 * Col <jv>withId</jv> = <jsm>col</jsm>() 057 * .id(<js>"name-column"</js>) 058 * .span(2); 059 * 060 * <jc>// Column with multiple attributes</jc> 061 * Col <jv>complex</jv> = <jsm>col</jsm>() 062 * .span(2) 063 * ._class(<js>"data-column"</js>) 064 * .style(<js>"width: 150px; text-align: right;"</js>) 065 * .title(<js>"Numeric data column"</js>); 066 * </p> 067 * 068 * <p> 069 * The following convenience methods are provided for constructing instances of this bean: 070 * <ul class='javatree'> 071 * <li class='jc'>{@link HtmlBuilder} 072 * <ul class='javatree'> 073 * <li class='jm'>{@link HtmlBuilder#col() col()} 074 * </ul> 075 * </ul> 076 * </p> 077 * 078 * <h5 class='section'>See Also:</h5><ul> 079 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 080 * </ul> 081 */ 082@Bean(typeName = "col") 083public class Col extends HtmlElementVoid { 084 085 /** 086 * Creates an empty {@link Col} element. 087 */ 088 public Col() {} 089 090 /** 091 * Creates a {@link Col} element with the specified {@link Col#span(Object)} attribute. 092 * 093 * @param span The {@link Col#span(Object)} attribute. 094 */ 095 public Col(Number span) { 096 span(span); 097 } 098 099 @Override /* Overridden from HtmlElement */ 100 public Col _class(String value) { // NOSONAR - Intentional naming. 101 super._class(value); 102 return this; 103 } 104 105 @Override /* Overridden from HtmlElement */ 106 public Col accesskey(String value) { 107 super.accesskey(value); 108 return this; 109 } 110 111 @Override /* Overridden from HtmlElement */ 112 public Col attr(String key, Object val) { 113 super.attr(key, val); 114 return this; 115 } 116 117 @Override /* Overridden from HtmlElement */ 118 public Col attrUri(String key, Object val) { 119 super.attrUri(key, val); 120 return this; 121 } 122 123 @Override /* Overridden from HtmlElement */ 124 public Col contenteditable(Object value) { 125 super.contenteditable(value); 126 return this; 127 } 128 129 @Override /* Overridden from HtmlElement */ 130 public Col dir(String value) { 131 super.dir(value); 132 return this; 133 } 134 135 @Override /* Overridden from HtmlElement */ 136 public Col hidden(Object value) { 137 super.hidden(value); 138 return this; 139 } 140 141 @Override /* Overridden from HtmlElement */ 142 public Col id(String value) { 143 super.id(value); 144 return this; 145 } 146 147 @Override /* Overridden from HtmlElement */ 148 public Col lang(String value) { 149 super.lang(value); 150 return this; 151 } 152 153 @Override /* Overridden from HtmlElement */ 154 public Col onabort(String value) { 155 super.onabort(value); 156 return this; 157 } 158 159 @Override /* Overridden from HtmlElement */ 160 public Col onblur(String value) { 161 super.onblur(value); 162 return this; 163 } 164 165 @Override /* Overridden from HtmlElement */ 166 public Col oncancel(String value) { 167 super.oncancel(value); 168 return this; 169 } 170 171 @Override /* Overridden from HtmlElement */ 172 public Col oncanplay(String value) { 173 super.oncanplay(value); 174 return this; 175 } 176 177 @Override /* Overridden from HtmlElement */ 178 public Col oncanplaythrough(String value) { 179 super.oncanplaythrough(value); 180 return this; 181 } 182 183 @Override /* Overridden from HtmlElement */ 184 public Col onchange(String value) { 185 super.onchange(value); 186 return this; 187 } 188 189 @Override /* Overridden from HtmlElement */ 190 public Col onclick(String value) { 191 super.onclick(value); 192 return this; 193 } 194 195 @Override /* Overridden from HtmlElement */ 196 public Col oncuechange(String value) { 197 super.oncuechange(value); 198 return this; 199 } 200 201 @Override /* Overridden from HtmlElement */ 202 public Col ondblclick(String value) { 203 super.ondblclick(value); 204 return this; 205 } 206 207 @Override /* Overridden from HtmlElement */ 208 public Col ondurationchange(String value) { 209 super.ondurationchange(value); 210 return this; 211 } 212 213 @Override /* Overridden from HtmlElement */ 214 public Col onemptied(String value) { 215 super.onemptied(value); 216 return this; 217 } 218 219 @Override /* Overridden from HtmlElement */ 220 public Col onended(String value) { 221 super.onended(value); 222 return this; 223 } 224 225 @Override /* Overridden from HtmlElement */ 226 public Col onerror(String value) { 227 super.onerror(value); 228 return this; 229 } 230 231 @Override /* Overridden from HtmlElement */ 232 public Col onfocus(String value) { 233 super.onfocus(value); 234 return this; 235 } 236 237 @Override /* Overridden from HtmlElement */ 238 public Col oninput(String value) { 239 super.oninput(value); 240 return this; 241 } 242 243 @Override /* Overridden from HtmlElement */ 244 public Col oninvalid(String value) { 245 super.oninvalid(value); 246 return this; 247 } 248 249 @Override /* Overridden from HtmlElement */ 250 public Col onkeydown(String value) { 251 super.onkeydown(value); 252 return this; 253 } 254 255 @Override /* Overridden from HtmlElement */ 256 public Col onkeypress(String value) { 257 super.onkeypress(value); 258 return this; 259 } 260 261 @Override /* Overridden from HtmlElement */ 262 public Col onkeyup(String value) { 263 super.onkeyup(value); 264 return this; 265 } 266 267 @Override /* Overridden from HtmlElement */ 268 public Col onload(String value) { 269 super.onload(value); 270 return this; 271 } 272 273 @Override /* Overridden from HtmlElement */ 274 public Col onloadeddata(String value) { 275 super.onloadeddata(value); 276 return this; 277 } 278 279 @Override /* Overridden from HtmlElement */ 280 public Col onloadedmetadata(String value) { 281 super.onloadedmetadata(value); 282 return this; 283 } 284 285 @Override /* Overridden from HtmlElement */ 286 public Col onloadstart(String value) { 287 super.onloadstart(value); 288 return this; 289 } 290 291 @Override /* Overridden from HtmlElement */ 292 public Col onmousedown(String value) { 293 super.onmousedown(value); 294 return this; 295 } 296 297 @Override /* Overridden from HtmlElement */ 298 public Col onmouseenter(String value) { 299 super.onmouseenter(value); 300 return this; 301 } 302 303 @Override /* Overridden from HtmlElement */ 304 public Col onmouseleave(String value) { 305 super.onmouseleave(value); 306 return this; 307 } 308 309 @Override /* Overridden from HtmlElement */ 310 public Col onmousemove(String value) { 311 super.onmousemove(value); 312 return this; 313 } 314 315 @Override /* Overridden from HtmlElement */ 316 public Col onmouseout(String value) { 317 super.onmouseout(value); 318 return this; 319 } 320 321 @Override /* Overridden from HtmlElement */ 322 public Col onmouseover(String value) { 323 super.onmouseover(value); 324 return this; 325 } 326 327 @Override /* Overridden from HtmlElement */ 328 public Col onmouseup(String value) { 329 super.onmouseup(value); 330 return this; 331 } 332 333 @Override /* Overridden from HtmlElement */ 334 public Col onmousewheel(String value) { 335 super.onmousewheel(value); 336 return this; 337 } 338 339 @Override /* Overridden from HtmlElement */ 340 public Col onpause(String value) { 341 super.onpause(value); 342 return this; 343 } 344 345 @Override /* Overridden from HtmlElement */ 346 public Col onplay(String value) { 347 super.onplay(value); 348 return this; 349 } 350 351 @Override /* Overridden from HtmlElement */ 352 public Col onplaying(String value) { 353 super.onplaying(value); 354 return this; 355 } 356 357 @Override /* Overridden from HtmlElement */ 358 public Col onprogress(String value) { 359 super.onprogress(value); 360 return this; 361 } 362 363 @Override /* Overridden from HtmlElement */ 364 public Col onratechange(String value) { 365 super.onratechange(value); 366 return this; 367 } 368 369 @Override /* Overridden from HtmlElement */ 370 public Col onreset(String value) { 371 super.onreset(value); 372 return this; 373 } 374 375 @Override /* Overridden from HtmlElement */ 376 public Col onresize(String value) { 377 super.onresize(value); 378 return this; 379 } 380 381 @Override /* Overridden from HtmlElement */ 382 public Col onscroll(String value) { 383 super.onscroll(value); 384 return this; 385 } 386 387 @Override /* Overridden from HtmlElement */ 388 public Col onseeked(String value) { 389 super.onseeked(value); 390 return this; 391 } 392 393 @Override /* Overridden from HtmlElement */ 394 public Col onseeking(String value) { 395 super.onseeking(value); 396 return this; 397 } 398 399 @Override /* Overridden from HtmlElement */ 400 public Col onselect(String value) { 401 super.onselect(value); 402 return this; 403 } 404 405 @Override /* Overridden from HtmlElement */ 406 public Col onshow(String value) { 407 super.onshow(value); 408 return this; 409 } 410 411 @Override /* Overridden from HtmlElement */ 412 public Col onstalled(String value) { 413 super.onstalled(value); 414 return this; 415 } 416 417 @Override /* Overridden from HtmlElement */ 418 public Col onsubmit(String value) { 419 super.onsubmit(value); 420 return this; 421 } 422 423 @Override /* Overridden from HtmlElement */ 424 public Col onsuspend(String value) { 425 super.onsuspend(value); 426 return this; 427 } 428 429 @Override /* Overridden from HtmlElement */ 430 public Col ontimeupdate(String value) { 431 super.ontimeupdate(value); 432 return this; 433 } 434 435 @Override /* Overridden from HtmlElement */ 436 public Col ontoggle(String value) { 437 super.ontoggle(value); 438 return this; 439 } 440 441 @Override /* Overridden from HtmlElement */ 442 public Col onvolumechange(String value) { 443 super.onvolumechange(value); 444 return this; 445 } 446 447 @Override /* Overridden from HtmlElement */ 448 public Col onwaiting(String value) { 449 super.onwaiting(value); 450 return this; 451 } 452 453 /** 454 * <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-col-span">span</a> attribute. 455 * 456 * <p> 457 * Number of columns spanned by the element. 458 * 459 * @param value 460 * The new value for this attribute. 461 * Typically a {@link Number} or {@link String}. 462 * @return This object. 463 */ 464 public Col span(Object value) { 465 attr("span", value); 466 return this; 467 } 468 469 @Override /* Overridden from HtmlElement */ 470 public Col spellcheck(Object value) { 471 super.spellcheck(value); 472 return this; 473 } 474 475 @Override /* Overridden from HtmlElement */ 476 public Col style(String value) { 477 super.style(value); 478 return this; 479 } 480 481 @Override /* Overridden from HtmlElement */ 482 public Col tabindex(Object value) { 483 super.tabindex(value); 484 return this; 485 } 486 487 @Override /* Overridden from HtmlElement */ 488 public Col title(String value) { 489 super.title(value); 490 return this; 491 } 492 493 @Override /* Overridden from HtmlElement */ 494 public Col translate(Object value) { 495 super.translate(value); 496 return this; 497 } 498}