cox.jmatt.java.MathTools.markup.html
Class TRTag

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.Tag
      extended by cox.jmatt.java.MathTools.markup.html.BaseHTag
          extended by cox.jmatt.java.MathTools.markup.html.TRTag

public class TRTag
extends BaseHTag

This class represents a single row ('<tr>' ... '</tr>') in a <table>. It makes provision for holding <td> elements and for creating rows of them.


Nested Class Summary
 
Nested classes/interfaces inherited from class cox.jmatt.java.MathTools.markup.html.BaseHTag
BaseHTag.TagKeys
 
Field Summary
 
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag
myTagName
 
Constructor Summary
TRTag()
          Constructor for an empty row, ready to fill.
 
Method Summary
 TRTag addCell(java.lang.String pContent)
          Add a cell directly to the row.
 TRTag addCell(TDTag pTag)
          Add an existing <td> to the row.
 TRTag addHeading(java.lang.String pContent)
          Add a heading cell to this row.
 TRTag copyOf()
          Copy this row verbatim.
static TRTag createRow(java.lang.Object[] pRow, java.lang.String pCellID, boolean pIsTH)
          Turn an Object[] array into a table row.
 TRTag newRow(java.lang.Object[] pRow, java.lang.String pCellID, boolean isTH)
          Instance version of createRow().
 
Methods inherited from class cox.jmatt.java.MathTools.markup.html.BaseHTag
_addTag, _content, _enableCopy, _setContent, addCDATA, addContent, getID, getRawContent, getTagKey, getTagName, isInBody, setClicked, setCSS, setName, setStyle
 
Methods inherited from class cox.jmatt.java.MathTools.markup.Tag
_addAttribute, _addAttributes, _addNAttribute, _asBoolean, _asDouble, _asInt, _attributes, _clampNAttribute, _clampNAttribute, _fixKey, _setEnableXMLTag, badPizza, closeTag, configureTag, configureTagFromGlobalPizza, makeTag, openTag, reset, setID, toString, validString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TRTag

public TRTag()
Constructor for an empty row, ready to fill.

Method Detail

createRow

public static TRTag createRow(java.lang.Object[] pRow,
                              java.lang.String pCellID,
                              boolean pIsTH)

Turn an Object[] array into a table row. If the array is null or empty null is returned. Non-null elements are toString()'ed to add them, null elements are added as a single space so the resulting <td> tag will be empty.

If 'cellIDprefix' is not null or blank it is used to set the ID of the cell. If used it is prepended to the cell number and set as the ID of the resulting <td> tag. If null or blank it is ignored.

Parameters:
pRow - The Object[] array to be converted to a row. If null or empty the return value is null.
pCellID - The cell ID prefix. If defined it is used to set the cell's 'id=' attribute.
pIsTH - 'true' for a header-cell row, false for a standard <td> row.

newRow

public TRTag newRow(java.lang.Object[] pRow,
                    java.lang.String pCellID,
                    boolean isTH)
Instance version of createRow().


copyOf

public TRTag copyOf()
Copy this row verbatim.


addCell

public TRTag addCell(java.lang.String pContent)
Add a cell directly to the row. Defaults are in effect, nothing done if the String is null or blank.


addCell

public TRTag addCell(TDTag pTag)
Add an existing <td> to the row. This works both for cells and header cells.


addHeading

public TRTag addHeading(java.lang.String pContent)
Add a heading cell to this row. If used once this should be used subsequently but this is not enforced!