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.*; 016 017/** 018 * DTO for an HTML {@doc HTML5.tabular-data#the-th-element <th>} 019 * element. 020 * 021 * <ul class='seealso'> 022 * <li class='link'>{@doc juneau-dto.HTML5} 023 * </ul> 024 */ 025@Bean(typeName="th") 026public class Th extends HtmlElementMixed { 027 028 /** 029 * {@doc HTML5.tabular-data#attr-th-abbr abbr} attribute. 030 * 031 * <p> 032 * Alternative label to use for the header cell when referencing the cell in other contexts. 033 * 034 * @param abbr The new value for this attribute. 035 * @return This object (for method chaining). 036 */ 037 public final Th abbr(String abbr) { 038 attr("abbr", abbr); 039 return this; 040 } 041 042 /** 043 * {@doc HTML5.tabular-data#attr-tdth-colspan colspan} attribute. 044 * 045 * <p> 046 * Number of columns that the cell is to span. 047 * 048 * @param colspan 049 * The new value for this attribute. 050 * Typically a {@link Number} or {@link String}. 051 * @return This object (for method chaining). 052 */ 053 public final Th colspan(Object colspan) { 054 attr("colspan", colspan); 055 return this; 056 } 057 058 /** 059 * {@doc HTML5.tabular-data#attr-tdth-headers headers} attribute. 060 * 061 * <p> 062 * The headers for this cell. 063 * 064 * @param headers The new value for this attribute. 065 * @return This object (for method chaining). 066 */ 067 public final Th headers(String headers) { 068 attr("headers", headers); 069 return this; 070 } 071 072 /** 073 * {@doc HTML5.tabular-data#attr-tdth-rowspan rowspan} attribute. 074 * 075 * <p> 076 * Number of rows that the cell is to span. 077 * 078 * @param rowspan 079 * The new value for this attribute. 080 * Typically a {@link Number} or {@link String}. 081 * @return This object (for method chaining). 082 */ 083 public final Th rowspan(Object rowspan) { 084 attr("rowspan", rowspan); 085 return this; 086 } 087 088 /** 089 * {@doc HTML5.tabular-data#attr-th-scope scope} attribute. 090 * 091 * <p> 092 * Specifies which cells the header cell applies to. 093 * 094 * @param scope The new value for this attribute. 095 * @return This object (for method chaining). 096 */ 097 public final Th scope(String scope) { 098 attr("scope", scope); 099 return this; 100 } 101 102 /** 103 * {@doc HTML5.tabular-data#attr-th-sorted sorted} attribute. 104 * 105 * <p> 106 * Column sort direction and ordinality. 107 * 108 * @param sorted The new value for this attribute. 109 * @return This object (for method chaining). 110 */ 111 public final Th sorted(String sorted) { 112 attr("sorted", sorted); 113 return this; 114 } 115 116 117 //----------------------------------------------------------------------------------------------------------------- 118 // Overridden methods 119 //----------------------------------------------------------------------------------------------------------------- 120 121 @Override /* HtmlElement */ 122 public final Th _class(String _class) { 123 super._class(_class); 124 return this; 125 } 126 127 @Override /* HtmlElement */ 128 public final Th id(String id) { 129 super.id(id); 130 return this; 131 } 132 133 @Override /* HtmlElement */ 134 public final Th style(String style) { 135 super.style(style); 136 return this; 137 } 138 139 @Override /* HtmlElementMixed */ 140 public Th children(Object...children) { 141 super.children(children); 142 return this; 143 } 144 145 @Override /* HtmlElementMixed */ 146 public Th child(Object child) { 147 super.child(child); 148 return this; 149 } 150}