View Javadoc

1   /*
2    * Copyright (c) 2002-2008 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package com.gargoylesoftware.htmlunit.html;
16  
17  import java.util.Map;
18  
19  import com.gargoylesoftware.htmlunit.SgmlPage;
20  
21  /**
22   * Wrapper for the HTML "th" tag.
23   *
24   * @version $Revision: 3026 $
25   * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
26   * @author David K. Taylor
27   * @author <a href="mailto:cse@dynabean.de">Christian Sell</a>
28   * @author Ahmed Ashour
29   */
30  public class HtmlTableHeaderCell extends HtmlTableCell {
31  
32      private static final long serialVersionUID = -8210579268968959585L;
33  
34      /** The HTML tag represented by this element. */
35      public static final String TAG_NAME = "th";
36  
37      /**
38       * Creates an instance.
39       *
40       * @param namespaceURI the URI that identifies an XML namespace
41       * @param qualifiedName the qualified name of the element type to instantiate
42       * @param page the page that this element is contained within
43       * @param attributes the initial attributes
44       */
45      HtmlTableHeaderCell(final String namespaceURI, final String qualifiedName, final SgmlPage page,
46              final Map<String, DomAttr> attributes) {
47          super(namespaceURI, qualifiedName, page, attributes);
48      }
49  
50      /**
51       * Returns the value of the attribute "abbr". Refer to the
52       * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
53       * documentation for details on the use of this attribute.
54       *
55       * @return the value of the attribute "abbr"
56       * or an empty string if that attribute isn't defined.
57       */
58      public final String getAbbrAttribute() {
59          return getAttributeValue("abbr");
60      }
61  
62      /**
63       * Returns the value of the attribute "axis". Refer to the
64       * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
65       * documentation for details on the use of this attribute.
66       *
67       * @return the value of the attribute "axis"
68       * or an empty string if that attribute isn't defined.
69       */
70      public final String getAxisAttribute() {
71          return getAttributeValue("axis");
72      }
73  
74      /**
75       * Returns the value of the attribute "headers". Refer to the
76       * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
77       * documentation for details on the use of this attribute.
78       *
79       * @return the value of the attribute "headers"
80       * or an empty string if that attribute isn't defined.
81       */
82      public final String getHeadersAttribute() {
83          return getAttributeValue("headers");
84      }
85  
86      /**
87       * Returns the value of the attribute "scope". Refer to the
88       * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
89       * documentation for details on the use of this attribute.
90       *
91       * @return the value of the attribute "scope"
92       * or an empty string if that attribute isn't defined.
93       */
94      public final String getScopeAttribute() {
95          return getAttributeValue("scope");
96      }
97  
98      /**
99       * Returns the value of the attribute "rowspan". Refer to the
100      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
101      * documentation for details on the use of this attribute.
102      *
103      * @return the value of the attribute "rowspan"
104      * or an empty string if that attribute isn't defined.
105      */
106     public final String getRowSpanAttribute() {
107         return getAttributeValue("rowspan");
108     }
109 
110     /**
111      * Returns the value of the attribute "colspan". Refer to the
112      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
113      * documentation for details on the use of this attribute.
114      *
115      * @return the value of the attribute "colspan"
116      * or an empty string if that attribute isn't defined.
117      */
118     public final String getColumnSpanAttribute() {
119         return getAttributeValue("colspan");
120     }
121 
122     /**
123      * Returns the value of the attribute "align". Refer to the
124      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
125      * documentation for details on the use of this attribute.
126      *
127      * @return the value of the attribute "align"
128      * or an empty string if that attribute isn't defined.
129      */
130     public final String getAlignAttribute() {
131         return getAttributeValue("align");
132     }
133 
134     /**
135      * Returns the value of the attribute "char". Refer to the
136      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
137      * documentation for details on the use of this attribute.
138      *
139      * @return the value of the attribute "char"
140      * or an empty string if that attribute isn't defined.
141      */
142     public final String getCharAttribute() {
143         return getAttributeValue("char");
144     }
145 
146     /**
147      * Returns the value of the attribute "charoff". Refer to the
148      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
149      * documentation for details on the use of this attribute.
150      *
151      * @return the value of the attribute "charoff"
152      * or an empty string if that attribute isn't defined.
153      */
154     public final String getCharoffAttribute() {
155         return getAttributeValue("charoff");
156     }
157 
158     /**
159      * Returns the value of the attribute "valign". Refer to the
160      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
161      * documentation for details on the use of this attribute.
162      *
163      * @return the value of the attribute "valign"
164      * or an empty string if that attribute isn't defined.
165      */
166     public final String getValignAttribute() {
167         return getAttributeValue("valign");
168     }
169 
170     /**
171      * Returns the value of the attribute "nowrap". Refer to the
172      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
173      * documentation for details on the use of this attribute.
174      *
175      * @return the value of the attribute "nowrap"
176      * or an empty string if that attribute isn't defined.
177      */
178     public final String getNoWrapAttribute() {
179         return getAttributeValue("nowrap");
180     }
181 
182     /**
183      * Returns the value of the attribute "bgcolor". Refer to the
184      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
185      * documentation for details on the use of this attribute.
186      *
187      * @return the value of the attribute "bgcolor"
188      * or an empty string if that attribute isn't defined.
189      */
190     public final String getBgcolorAttribute() {
191         return getAttributeValue("bgcolor");
192     }
193 
194     /**
195      * Returns the value of the attribute "width". Refer to the
196      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
197      * documentation for details on the use of this attribute.
198      *
199      * @return the value of the attribute "width"
200      * or an empty string if that attribute isn't defined.
201      */
202     public final String getWidthAttribute() {
203         return getAttributeValue("width");
204     }
205 
206     /**
207      * Returns the value of the attribute "height". Refer to the
208      * <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
209      * documentation for details on the use of this attribute.
210      *
211      * @return the value of the attribute "height"
212      * or an empty string if that attribute isn't defined.
213      */
214     public final String getHeightAttribute() {
215         return getAttributeValue("height");
216     }
217 }