public class HTMLTableRow extends HTMLTagAttributes implements HTMLConstants, java.io.Serializable
This example creates an HTMLTableRow object and sets the attributes.
Here is the output of the tag: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());
<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:
HTMLTable
,
HTMLTableCell
,
Serialized FormABSBOTTOM, 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 and Description |
---|
HTMLTableRow()
Constructs a default HTMLTableRow object.
|
HTMLTableRow(HTMLTableCell[] cells)
Constructs an HTMLTableRow object with the specified cells.
|
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(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 |
getFOTag()
Returns the XSL-FO table row tag.
|
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.
|
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(java.beans.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(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 |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used.
|
void |
setVerticalAlignment(java.lang.String alignment)
Sets the global vertical alignment for the row.
|
java.lang.String |
toString()
Returns the HTML table row tag.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLTableRow()
public HTMLTableRow(HTMLTableCell[] cells)
cells
- The HTMLTableCell array.public void addColumn(HTMLTableCell cell)
cell
- The HTMLTableCell containing the column data.public void addColumnListener(ElementListener listener)
listener
- The ElementListener.removeColumnListener(com.ibm.as400.util.html.ElementListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public HTMLTableCell getColumn(int columnIndex)
columnIndex
- - The column index.public int getColumnCount()
public int getColumnIndex(HTMLTableCell cell)
cell
- An HTMLTableCell object that contains the cell data.public int getColumnIndex(HTMLTableCell cell, int index)
cell
- An HTMLTableCell object that contains the cell data.index
- The column index to start searching from.public java.lang.String getDirection()
public java.lang.String getHorizontalAlignment()
HTMLConstants
public java.lang.String getLanguage()
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getVerticalAlignment()
HTMLConstants
public boolean isUseFO()
public void removeAllColumns()
public void removeColumn(HTMLTableCell cell)
cell
- The HTMLTableCell object to be removed.public void removeColumn(int columnIndex)
columnIndex
- The column index.public void removeColumnListener(ElementListener listener)
listener
- The ElementListener.addColumnListener(com.ibm.as400.util.html.ElementListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setColumn(HTMLTableCell cell, int columnIndex)
cell
- The HTMLTableCell object to be added.columnIndex
- The column index.public void setDirection(java.lang.String dir) throws java.beans.PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.java.beans.PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setHorizontalAlignment(java.lang.String alignment) throws java.beans.PropertyVetoException
alignment
- The horizontal alignment. One of the following constants
defined in HTMLConstants: CENTER, LEFT, or RIGHT.java.beans.PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setLanguage(java.lang.String lang) throws java.beans.PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.java.beans.PropertyVetoException
- If a change is vetoed.public void setBorderWidth(int borderWidth)
borderWidth
- The border width.public void setCellPadding(int cellPadding)
cellPadding
- The cell padding.public void setUseFO(boolean useFO)
useFO
- - true if output generated is an XSL formatting object, false if the output generated is HTML.public void setVerticalAlignment(java.lang.String alignment) throws java.beans.PropertyVetoException
alignment
- The vertical alignment. One of the following constants
defined in HTMLConstants: BASELINE, BOTTOM, MIDDLE, or TOP.java.beans.PropertyVetoException
- If the change is vetoed.HTMLConstants
public java.lang.String toString()
toString
in class java.lang.Object