com.gargoylesoftware.htmlunit.html
Class HtmlTable

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomNamespaceNode
          extended by com.gargoylesoftware.htmlunit.html.DomElement
              extended by com.gargoylesoftware.htmlunit.html.HtmlElement
                  extended by com.gargoylesoftware.htmlunit.html.StyledElement
                      extended by com.gargoylesoftware.htmlunit.html.ClickableElement
                          extended by com.gargoylesoftware.htmlunit.html.HtmlTable
All Implemented Interfaces:
Serializable, Cloneable

public class HtmlTable
extends ClickableElement

Wrapper for the HTML element "table".

Version:
$Revision: 2132 $
Author:
Mike Bowler, David K. Taylor, Christian Sell, Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
HtmlElement.ChildElementsIterator, HtmlElement.MapEntryWrappingIterator
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
static String TAG_NAME
          the HTML tag represented by this element
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY, TAB_INDEX_OUT_OF_BOUNDS
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
HtmlTable(HtmlPage page, Map attributes)
          Deprecated. You should not directly construct HtmlTable.
 
Method Summary
 String getAlignAttribute()
          Return the value of the attribute "align".
 String getBgcolorAttribute()
          Return the value of the attribute "bgcolor".
 List getBodies()
          Return a list of tables bodies defined in this table.
 String getBorderAttribute()
          Return the value of the attribute "border".
 String getCaptionText()
          Return the table caption text or an empty string if a caption wasn't specified
 HtmlTableCell getCellAt(int rowIndex, int columnIndex)
          Return the first cell that matches the specified row and column, searching left to right, top to bottom.
 String getCellPaddingAttribute()
          Return the value of the attribute "cellpadding".
 String getCellSpacingAttribute()
          Return the value of the attribute "cellspacing".
 HtmlTableFooter getFooter()
          Return the table footer or null if a footer wasn't specified
 String getFrameAttribute()
          Return the value of the attribute "frame".
 HtmlTableHeader getHeader()
          Return the table header or null if a header wasn't specified
 HtmlTableRow getRow(int index)
           
 HtmlTableRow getRowById(String id)
          Find and return the row with the specified id.
 int getRowCount()
          compute the number of rows in this table.
 List getRows()
           
 String getRulesAttribute()
          Return the value of the attribute "rules".
 String getSummaryAttribute()
          Return the value of the attribute "summary".
 String getWidthAttribute()
          Return the value of the attribute "width".
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.ClickableElement
click, click, click, dblClick, dblClick, doClickAction, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute, isStateUpdateFirst
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.StyledElement
getClassAttribute, getIdAttribute, getStyleAttribute, getTitleAttribute, isRenderedVisible
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
addHtmlAttributeChangeListener, appendChildIfNoneExists, assertNotEmpty, blur, cloneDomNode, cloneNode, fireEvent, fireEvent, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, focus, getAttribute, getAttributeEntriesIterator, getAttributeNS, getAttributeValue, getChildElementsIterator, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getEventHandler, getHtmlElementById, getHtmlElementsByAttribute, getHtmlElementsByTagName, getHtmlElementsByTagNames, getId, getNodeName, getNodeType, getOneHtmlElementByAttribute, getTabIndex, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasHtmlElementWithId, isAttributeDefined, isEmptyXmlTagExpanded, isSubmittableByEnter, keyDown, keyDown, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, notImplemented, preventDefault, printOpeningTagContentAsXml, printXml, removeAttribute, removeAttributeNS, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, rightClick, rightClick, setAttribute, setAttributeNS, setAttributeValue, setAttributeValue, setEventHandler, setEventHandler, setId, toString, type, type, type, type
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asText, asXml, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, isAncestorOf, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removePropertyChangeListener, replace, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_NAME

public static final String TAG_NAME
the HTML tag represented by this element

See Also:
Constant Field Values
Constructor Detail

HtmlTable

public HtmlTable(HtmlPage page,
                 Map attributes)
Deprecated. You should not directly construct HtmlTable.

Create an instance

Parameters:
page - The page that contains this element
attributes - the initial attributes
Method Detail

getCellAt

public final HtmlTableCell getCellAt(int rowIndex,
                                     int columnIndex)
Return the first cell that matches the specified row and column, searching left to right, top to bottom.

Parameters:
rowIndex - The row index
columnIndex - The column index
Returns:
The HtmlTableCell at that location or null if there are no cells at that location

getRows

public List getRows()
Returns:
an immutable list containing all the HtmlTableRow objects
See Also:
getRowIterator()

getRow

public HtmlTableRow getRow(int index)
                    throws IndexOutOfBoundsException
Parameters:
index - the 0-based index of the row
Returns:
the HtmlTableRow at the given index
Throws:
IndexOutOfBoundsException - if there is no row at the given index
See Also:
getRowIterator()

getRowCount

public final int getRowCount()
compute the number of rows in this table. Note that the count is computed dynamically by iterating over all rows

Returns:
The number of rows in this table

getRowById

public final HtmlTableRow getRowById(String id)
                              throws ElementNotFoundException
Find and return the row with the specified id.

Parameters:
id - The id of the row
Returns:
The row with the specified id.
Throws:
ElementNotFoundException - If the row cannot be found.

getCaptionText

public String getCaptionText()
Return the table caption text or an empty string if a caption wasn't specified

Returns:
The caption text

getHeader

public HtmlTableHeader getHeader()
Return the table header or null if a header wasn't specified

Returns:
The table header

getFooter

public HtmlTableFooter getFooter()
Return the table footer or null if a footer wasn't specified

Returns:
The table footer

getBodies

public List getBodies()
Return a list of tables bodies defined in this table. If no bodies were defined then an empty list will be returned.

Returns:
A list of HtmlTableBody objects.

getSummaryAttribute

public final String getSummaryAttribute()
Return the value of the attribute "summary". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "summary" or an empty string if that attribute isn't defined.

getWidthAttribute

public final String getWidthAttribute()
Return the value of the attribute "width". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "width" or an empty string if that attribute isn't defined.

getBorderAttribute

public final String getBorderAttribute()
Return the value of the attribute "border". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "border" or an empty string if that attribute isn't defined.

getFrameAttribute

public final String getFrameAttribute()
Return the value of the attribute "frame". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "frame" or an empty string if that attribute isn't defined.

getRulesAttribute

public final String getRulesAttribute()
Return the value of the attribute "rules". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "rules" or an empty string if that attribute isn't defined.

getCellSpacingAttribute

public final String getCellSpacingAttribute()
Return the value of the attribute "cellspacing". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "cellspacing" or an empty string if that attribute isn't defined.

getCellPaddingAttribute

public final String getCellPaddingAttribute()
Return the value of the attribute "cellpadding". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "cellpadding" or an empty string if that attribute isn't defined.

getAlignAttribute

public final String getAlignAttribute()
Return the value of the attribute "align". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "align" or an empty string if that attribute isn't defined.

getBgcolorAttribute

public final String getBgcolorAttribute()
Return the value of the attribute "bgcolor". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "bgcolor" or an empty string if that attribute isn't defined.


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.