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