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