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