com.ibm.as400.util.html
Class HTMLTableRow

java.lang.Object
  |
  +--com.ibm.as400.util.html.HTMLTagAttributes
        |
        +--com.ibm.as400.util.html.HTMLTableRow
All Implemented Interfaces:
HTMLConstants, HTMLTagElement, java.io.Serializable

public class HTMLTableRow
extends HTMLTagAttributes
implements HTMLConstants, java.io.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>
  

HTMLTableRow objects generate the following events:

See Also:
HTMLTable, HTMLTableCell, Serialized Form

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
HTMLTableRow()
          Constructs a default HTMLTableRow object.
HTMLTableRow(HTMLTableCell[] cells)
          Constructs an HTMLTableRow object with the specified cells.
 
Method Summary
 void addColumn(HTMLTableCell cell)
          Adds the column to the row.
 void addColumnListener(ElementListener listener)
          Adds an ElementListener for the columns.
 void addVetoableChangeListener(java.beans.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.
 java.lang.String getDirection()
          Returns the direction of the text interpretation.
 java.lang.String getHorizontalAlignment()
          Returns the global horizontal alignment for the row.
 java.lang.String getLanguage()
          Returns the language of the caption.
 java.lang.String getTag()
          Returns the table row tag.
 java.lang.String getVerticalAlignment()
          Returns the global vertical alignment for the row.
 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(java.beans.VetoableChangeListener listener)
          Removes the VetoableChangeListener from the internal list.
 void setColumn(HTMLTableCell cell, int columnIndex)
          Sets the column element at the specified column.
 void setDirection(java.lang.String dir)
          Sets the direction of the text interpretation.
 void setHorizontalAlignment(java.lang.String alignment)
          Sets the global horizontal alignment for the row.
 void setLanguage(java.lang.String lang)
          Sets the language of the caption.
 void setVerticalAlignment(java.lang.String alignment)
          Sets the global vertical alignment for the row.
 java.lang.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(java.beans.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 java.lang.String getDirection()
Returns the direction of the text interpretation.
Returns:
The direction of the text.

getHorizontalAlignment

public java.lang.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 java.lang.String getLanguage()
Returns the language of the caption.
Returns:
The language of the caption.

getTag

public java.lang.String getTag()
Returns the table row tag.
Returns:
The tag.

getVerticalAlignment

public java.lang.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

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(java.beans.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(java.lang.String dir)
                  throws java.beans.PropertyVetoException
Sets the direction of the text interpretation.
Parameters:
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
Throws:
java.beans.PropertyVetoException - If a change is vetoed.
See Also:
HTMLConstants

setHorizontalAlignment

public void setHorizontalAlignment(java.lang.String alignment)
                            throws java.beans.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:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
HTMLConstants

setLanguage

public void setLanguage(java.lang.String lang)
                 throws java.beans.PropertyVetoException
Sets the language of the caption.
Parameters:
lang - The language. Example language tags include: en and en-US.
Throws:
java.beans.PropertyVetoException - If a change is vetoed.

setVerticalAlignment

public void setVerticalAlignment(java.lang.String alignment)
                          throws java.beans.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:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
HTMLConstants

toString

public java.lang.String toString()
Returns the HTML table row tag.
Overrides:
toString in class java.lang.Object
Returns:
The row tag.