com.ge.research.html
Class TableRowTag

java.lang.Object
  extended bycom.ge.research.html.HTMLTag
      extended bycom.ge.research.html.TableElement
          extended bycom.ge.research.html.TableRowTag

public class TableRowTag
extends TableElement

Encapsulates all the attributes of an HTML "TR" element, its accessors, validations, and default values.

Version:
$Revision: 1.1 $ $Date: 2006/08/11 00:17:33 $
Author:
garbiras
Created on:
Sep 9, 2002

Field Summary
 
Fields inherited from class com.ge.research.html.HTMLTag
HORIZONTAL_LINE, LINEBREAK, reconstructTag, tag, WHITESPACE
 
Constructor Summary
TableRowTag()
          Default constructor.
 
Method Summary
 void addCell(TableDimensionTag td)
          Adds a cell to the list of cells within the row.
 TableDimensionTag getCell(int index)
          Returns the table row cell at the specified index within the list.
 java.util.List getCells()
          Returns the List of cells for this row.
 java.lang.String getCellString(int index)
          Returns the string representation of the table row cell at the specified index within the list.
 int getNumCells()
          Returns the current count of the number of cells in this row.
 boolean removeCell(int index)
          Removes the table row cell at the specified index within the list.
 void removeCells()
          Removes all cells from the list of cells within the row.
protected  void resetTagSpecificInformation()
          Resets the tag attributes and content of the HTML Tag to their default values.
 void setCells(java.util.List list)
          Sets the list of table row cells within the row.
protected  void writeTagSpecificData()
          Adds each table cell tag within the row to the tag
 
Methods inherited from class com.ge.research.html.TableElement
getAlign, getBackground, getBgColor, getBorder, getBorderColor, getBorderColorDark, getBorderColorLight, getCellPadding, getCellSpacing, getColspan, getFrame, getHeight, getNowrap, getRowspan, getRules, getVAlign, getWidth, setAlign, setBackground, setBgColor, setBorder, setBorderColor, setBorderColorDark, setBorderColorLight, setCellPadding, setCellSpacing, setColspan, setFrame, setHeight, setNowrap, setRowspan, setRules, setVAlign, setWidth, writeTagSpecificAttributes
 
Methods inherited from class com.ge.research.html.HTMLTag
addAttribute, addAttribute, getId, getOnClick, getOnContextMenu, getOnDblClick, getOnDrag, getOnDragEnd, getOnDragStart, getOnFocus, getOnFocusOut, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnMoveEnd, getOnMoveStart, getStyle, getStyleClass, getTitle, removeAttribute, reset, setId, setOnClick, setOnContextMenu, setOnDblClick, setOnDrag, setOnDragEnd, setOnDragStart, setOnFocus, setOnFocusOut, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnMoveEnd, setOnMoveStart, setStyle, setStyleClass, setTitle, toString, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableRowTag

public TableRowTag()
Default constructor. Calls super(TagPropertyConstants.TABLE_ROW_TAG)

See Also:
TagPropertyConstants.TABLE_ROW_TAG
Method Detail

addCell

public void addCell(TableDimensionTag td)
Adds a cell to the list of cells within the row. Increments the current count of cells within the row. Sets the value of the HTMLTag.reconstructTag to true

Parameters:
td - the cell to add to the row
See Also:
HTMLTag.reconstructTag

getCell

public TableDimensionTag getCell(int index)
                          throws java.lang.IndexOutOfBoundsException
Returns the table row cell at the specified index within the list.

Parameters:
index - the index of the list of cells to extract
Returns:
The cell at the specified index
Throws:
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumCells()

getCells

public java.util.List getCells()
Returns the List of cells for this row. Each element of the List is of type TableDimensionTag

Returns:
The List of cells, of type TableDimensionTag, within the row

getCellString

public java.lang.String getCellString(int index)
Returns the string representation of the table row cell at the specified index within the list.

Parameters:
index - the index of the list of cells to extract
Returns:
The string representation of the cell object at the specified index
Throws:
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumCells()
See Also:
getCell(int)

getNumCells

public int getNumCells()
Returns the current count of the number of cells in this row. The count is incremented and decremented after each "add" and "remove" method executes, so that the count is always accurate and does not have to be computed each time it is requested.

Returns:
The number of cells currently within the row

removeCell

public boolean removeCell(int index)
                   throws java.lang.IndexOutOfBoundsException
Removes the table row cell at the specified index within the list. Decrements the current count of cells within the row. Sets the value of the HTMLTag.reconstructTag to true

Parameters:
index - the index of the list of cells to remove
Returns:
true if the cell was successfully removed; otherwise an exception is thrown
Throws:
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumCells()
See Also:
HTMLTag.reconstructTag

removeCells

public void removeCells()
Removes all cells from the list of cells within the row. Updates the current cell count to zero. Sets the value of the HTMLTag.reconstructTag to true

See Also:
HTMLTag.reconstructTag

setCells

public void setCells(java.util.List list)
              throws java.lang.ClassCastException
Sets the list of table row cells within the row. If list is not null or empty, checks to make sure that all elements of list are of type TableDimensionTag. If so, it first removes all previously existing cells, updating the current cell count to zero. Then it adds the contents of the list argument to the list of table row cells, in the same order as they appear in list. If during this operation an element of list is found to not be of type TableDimensionTag, then the table cell list is purged and an exception is thrown.

Parameters:
list - the new list of table row cells for this table row
Throws:
java.lang.ClassCastException - If any elements of list are not of type TableDimensionTag. If this is found to be the case prior to attempting to add the list contents to this tag, then the original list of table row cells is left unchanged. If however this is found during updating the table row cell list, then the entire list is purged.
See Also:
removeCells(), addCell(com.ge.research.html.TableDimensionTag)

resetTagSpecificInformation

protected void resetTagSpecificInformation()
Description copied from class: HTMLTag
Resets the tag attributes and content of the HTML Tag to their default values. Called by HTMLTag.reset(). This method is not implemented in HTMLTag. Subclasses that contain tag content information should implement this method to set their information to their default values.

Overrides:
resetTagSpecificInformation in class TableElement

writeTagSpecificData

protected void writeTagSpecificData()
Adds each table cell tag within the row to the tag

Overrides:
writeTagSpecificData in class HTMLTag
See Also:
HTMLTag.toString()