com.ibm.as400.util.html
Class HTMLTableRow

java.lang.Object
  extended by com.ibm.as400.util.html.HTMLTagAttributes
      extended by com.ibm.as400.util.html.HTMLTableRow
All Implemented Interfaces:
HTMLConstants, HTMLTagElement, Serializable

public class HTMLTableRow
extends HTMLTagAttributes
implements HTMLConstants, Serializable

The HTMLTableRow class represents an HTML row tag.

This example creates an HTMLTableRow object and sets the attributes.

  HTMLTableRow row = new HTMLTableRow();
  row.setHorizontalAlignment(HTMLTableRow.CENTER);
  row.setVerticalAlignment(HTMLTableRow.MIDDLE);
  // Add the columns to the row (Assume that the HTMLTableCell objects are already created).
  row.addColumn(column1);
  row.addColumn(column2);
  row.addColumn(column3);
  row.addColumn(column4);
  System.out.println(row.getTag());
  
Here is the output of the tag:
  <tr align="center" valign="middle">
  <td>data1</td>
  <td>data2</td>
  <td>data3</td>
  <td>data4</td>
  </tr>
  

Using XSL Formatting Objects, the output generated is:

<fo:table-row text-align="center"> <fo:table-cell border-style='solid' border-width='1px' padding='1px'><fo:block-container> <fo:block>data1</fo:block> </fo:block-container> </fo:table-cell> <fo:table-cell border-style='solid' border-width='1px' padding='1px'><fo:block-container> <fo:block>data2</fo:block> </fo:block-container> </fo:table-cell> <fo:table-cell border-style='solid' border-width='1px' padding='1px'><fo:block-container> <fo:block>data3</fo:block> </fo:block-container> </fo:table-cell> <fo:table-cell border-style='solid' border-width='1px' padding='1px'><fo:block-container> <fo:block>data4</fo:block> </fo:block-container> </fo:table-cell> </fo:table-row>

HTMLTableRow objects generate the following events:

See Also:
HTMLTable, HTMLTableCell, Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from interface com.ibm.as400.util.html.HTMLConstants
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CAPITALS, CENTER, CIRCLE, DISC, JUSTIFY, LARGE_ROMAN, LEFT, LOWER_CASE, LTR, MIDDLE, NUMBERS, RIGHT, RTL, SMALL_ROMAN, SQUARE, TARGET_BLANK, TARGET_PARENT, TARGET_SELF, TARGET_TOP, TEXTTOP, TOP
 
Constructor Summary
Constructor and Description
HTMLTableRow()
          Constructs a default HTMLTableRow object.
HTMLTableRow(HTMLTableCell[] cells)
          Constructs an HTMLTableRow object with the specified cells.
 
Method Summary
Modifier and Type Method and Description
 void addColumn(HTMLTableCell cell)
          Adds the column to the row.
 void addColumnListener(ElementListener listener)
          Adds an ElementListener for the columns.
 void addVetoableChangeListener(VetoableChangeListener listener)
          Adds the VetoableChangeListener.
 HTMLTableCell getColumn(int columnIndex)
          Returns the column at the specified columnIndex.
 int getColumnCount()
          Returns the number of columns in the row.
 int getColumnIndex(HTMLTableCell cell)
          Returns the column index of the specified cell.
 int getColumnIndex(HTMLTableCell cell, int index)
          Returns the column index of the specified cell.
 String getDirection()
          Returns the direction of the text interpretation.
 String getFOTag()
          Returns the XSL-FO table row tag.
 String getHorizontalAlignment()
          Returns the global horizontal alignment for the row.
 String getLanguage()
          Returns the language of the caption.
 String getTag()
          Returns the table row tag.
 String getVerticalAlignment()
          Returns the global vertical alignment for the row.
 boolean isUseFO()
          Returns if Formatting Object tags are outputted.
 void removeAllColumns()
          Removes all the columns from the row.
 void removeColumn(HTMLTableCell cell)
          Removes the column element from the row.
 void removeColumn(int columnIndex)
          Removes the column at the specified columnIndex.
 void removeColumnListener(ElementListener listener)
          Removes this column ElementListener from the internal list.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Removes the VetoableChangeListener from the internal list.
 void setBorderWidth(int borderWidth)
          Sets the border width in pixels.
 void setCellPadding(int cellPadding)
          Sets the global table cell padding.
 void setColumn(HTMLTableCell cell, int columnIndex)
          Sets the column element at the specified column.
 void setDirection(String dir)
          Sets the direction of the text interpretation.
 void setHorizontalAlignment(String alignment)
          Sets the global horizontal alignment for the row.
 void setLanguage(String lang)
          Sets the language of the caption.
 void setUseFO(boolean useFO)
          Sets if Formatting Object tags should be used.
 void setVerticalAlignment(String alignment)
          Sets the global vertical alignment for the row.
 String toString()
          Returns the HTML table row tag.
 
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLTableRow

public HTMLTableRow()
Constructs a default HTMLTableRow object.


HTMLTableRow

public HTMLTableRow(HTMLTableCell[] cells)
Constructs an HTMLTableRow object with the specified cells.

Parameters:
cells - The HTMLTableCell array.
Method Detail

addColumn

public void addColumn(HTMLTableCell cell)
Adds the column to the row.

Parameters:
cell - The HTMLTableCell containing the column data.

addColumnListener

public void addColumnListener(ElementListener listener)
Adds an ElementListener for the columns. The ElementListener object is added to an internal list of ColumnListeners; it can be removed with removeColumnListener.

Parameters:
listener - The ElementListener.
See Also:
removeColumnListener(com.ibm.as400.util.html.ElementListener)

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange method is called each time the value of any constrained property is changed.

Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

getColumn

public HTMLTableCell getColumn(int columnIndex)
Returns the column at the specified columnIndex.

Parameters:
columnIndex - - The column index.
Returns:
An HTMLTableCell object with the column data.

getColumnCount

public int getColumnCount()
Returns the number of columns in the row.

Returns:
The number of columns.

getColumnIndex

public int getColumnIndex(HTMLTableCell cell)
Returns the column index of the specified cell.

Parameters:
cell - An HTMLTableCell object that contains the cell data.
Returns:
The column index of the cell. Returns -1 if the column is not found.

getColumnIndex

public int getColumnIndex(HTMLTableCell cell,
                          int index)
Returns the column index of the specified cell.

Parameters:
cell - An HTMLTableCell object that contains the cell data.
index - The column index to start searching from.
Returns:
The column index of the cell. Returns -1 if the column is not found.

getDirection

public String getDirection()
Returns the direction of the text interpretation.

Returns:
The direction of the text.

getHorizontalAlignment

public String getHorizontalAlignment()
Returns the global horizontal alignment for the row.

Returns:
The horizontal alignment. One of the following constants defined in HTMLConstants: CENTER, LEFT, or RIGHT.
See Also:
HTMLConstants

getLanguage

public String getLanguage()
Returns the language of the caption.

Returns:
The language of the caption.

getTag

public String getTag()
Returns the table row tag.

Specified by:
getTag in interface HTMLTagElement
Returns:
The tag.

getFOTag

public String getFOTag()
Returns the XSL-FO table row tag. The valign, halign, and language attributes are not supported in XSL-FO.

Specified by:
getFOTag in interface HTMLTagElement
Returns:
The xsl-fo tag.

getVerticalAlignment

public String getVerticalAlignment()
Returns the global vertical alignment for the row.

Returns:
The vertical alignment. One of the following constants defined in HTMLConstants: BASELINE, BOTTOM, MIDDLE, or TOP.
See Also:
HTMLConstants

isUseFO

public boolean isUseFO()
Returns if Formatting Object tags are outputted. The default value is false.

Returns:
true if the output generated is an XSL formatting object, false if the output generated is HTML.

removeAllColumns

public void removeAllColumns()
Removes all the columns from the row.


removeColumn

public void removeColumn(HTMLTableCell cell)
Removes the column element from the row.

Parameters:
cell - The HTMLTableCell object to be removed.

removeColumn

public void removeColumn(int columnIndex)
Removes the column at the specified columnIndex.

Parameters:
columnIndex - The column index.

removeColumnListener

public void removeColumnListener(ElementListener listener)
Removes this column ElementListener from the internal list. If the ElementListener is not on the list, nothing is done.

Parameters:
listener - The ElementListener.
See Also:
addColumnListener(com.ibm.as400.util.html.ElementListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. If the VetoableChangeListener is not on the list, nothing is done.

Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setColumn

public void setColumn(HTMLTableCell cell,
                      int columnIndex)
Sets the column element at the specified column.

Parameters:
cell - The HTMLTableCell object to be added.
columnIndex - The column index.

setDirection

public void setDirection(String dir)
                  throws PropertyVetoException
Sets the direction of the text interpretation.

Parameters:
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
Throws:
PropertyVetoException - If a change is vetoed.
See Also:
HTMLConstants

setHorizontalAlignment

public void setHorizontalAlignment(String alignment)
                            throws PropertyVetoException
Sets the global horizontal alignment for the row.

Parameters:
alignment - The horizontal alignment. One of the following constants defined in HTMLConstants: CENTER, LEFT, or RIGHT.
Throws:
PropertyVetoException - If the change is vetoed.
See Also:
HTMLConstants

setLanguage

public void setLanguage(String lang)
                 throws PropertyVetoException
Sets the language of the caption.

Parameters:
lang - The language. Example language tags include: en and en-US.
Throws:
PropertyVetoException - If a change is vetoed.

setBorderWidth

public void setBorderWidth(int borderWidth)
Sets the border width in pixels. A value of zero indicates no border. The default value is one.

Parameters:
borderWidth - The border width.

setCellPadding

public void setCellPadding(int cellPadding)
Sets the global table cell padding. The cell padding is the spacing between data in a table cell and the border of the cell. The default value is 1.

Parameters:
cellPadding - The cell padding.

setUseFO

public void setUseFO(boolean useFO)
Sets if Formatting Object tags should be used. The default value is false.

Parameters:
useFO - - true if output generated is an XSL formatting object, false if the output generated is HTML.

setVerticalAlignment

public void setVerticalAlignment(String alignment)
                          throws PropertyVetoException
Sets the global vertical alignment for the row.

Parameters:
alignment - The vertical alignment. One of the following constants defined in HTMLConstants: BASELINE, BOTTOM, MIDDLE, or TOP.
Throws:
PropertyVetoException - If the change is vetoed.
See Also:
HTMLConstants

toString

public String toString()
Returns the HTML table row tag.

Overrides:
toString in class Object
Returns:
The row tag.