All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.html.HTMLTableCell

java.lang.Object
   |
   +----com.ibm.as400.util.html.HTMLTableCell

public class HTMLTableCell
extends Object
implements HTMLTagElement, HTMLConstants, Serializable
The HTMLTableCell class represents data in an HTML table cell.

This example creates an HTML text HTMLTableCell object.

  // Create an HTMLText object.
  HTMLText ibmText = new HTMLText("IBM");
  ibmText.setBold(true);
  ibmText.setItalic(true);
  HTMLTableCell textCell = new HTMLTableCell(ibmText);
  textCell.setHorizontalAlignment(HTMLConstants.CENTER);
  System.out.println(textCell.getTag());
  
Here is the output of the tag:

  
<td align="center"><b><i>IBM</i></b></td>

This example creates an HTMLTableCell object with the element as an HTMLForm object containing a submit button.

  HTMLTableCell formCell = new HTMLTableCell();
  // create an HTMLForm object.
  SubmitFormInput submitButton = new SubmitFormInput("Submit", "Send");
  HTMLForm form = new HTMLForm("http://myCompany.com/myServlet");
  form.addElement(submitButton);
  // add the form to the table cell.
  formCell.setElement(form);
  System.out.println(formCell.getTag());
  
Here is the output of the tag:

  <td><form action="http://myCompany.com/myServlet" method="get">
  <input type="submit" value="Send" />
  </form></td>
  

HTMLTableCell objects generate the following events:

See Also:
HTMLTable, HTMLTableRow

Constructor Index

 o HTMLTableCell()
Constructs a default HTMLTableCell object.
 o HTMLTableCell(HTMLTagElement)
Constructs an HTMLTableCell.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener.
 o addVetoableChangeListener(VetoableChangeListener)
Adds the VetoableChangeListener.
 o getColumnSpan()
Returns the column span.
 o getElement()
Returns the table cell element.
 o getHeight()
Returns the height relative to the table in pixels or percent.
 o getHorizontalAlignment()
Returns the horizontal alignment.
 o getRowSpan()
Returns the row span.
 o getTag()
Returns the table cell tag.
 o getTag(HTMLTagElement)
Returns the table cell tag with the specified element.
 o getVerticalAlignment()
Returns the vertical alignment.
 o getWidth()
Returns the width relative to the table in pixels or percent.
 o isHeightInPercent()
Indicates if the height is in percent or pixels.
 o isWidthInPercent()
Indicates if the width is in percent or pixels.
 o isWrap()
Indicates if the cell data will use normal HTML linebreaking conventions.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the PropertyChangeListener from the internal list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes the VetoableChangeListener from the internal list.
 o setColumnSpan(int)
Sets the column span.
 o setElement(HTMLTagElement)
Sets the table cell element.
 o setElement(String)
Sets the table cell element.
 o setHeight(int)
Sets the height relative to the table.
 o setHeight(int, boolean)
Sets the height relative to the table in pixels or percent.
 o setHeightInPercent(boolean)
Sets the height unit in percent or pixels.
 o setHorizontalAlignment(String)
Sets the horizontal alignment.
 o setRowSpan(int)
Sets the row span.
 o setVerticalAlignment(String)
Sets the vertical alignment.
 o setWidth(int)
Sets the width relative to the table.
 o setWidth(int, boolean)
Sets the width relative to the table in percent or pixels.
 o setWidthInPercent(boolean)
Sets the width unit in percent or pixels.
 o setWrap(boolean)
Sets if the cell data will use normal HTML linebreaking conventions.
 o toString()
Returns the HTML table cell tag.

Constructors

 o HTMLTableCell
 public HTMLTableCell()
Constructs a default HTMLTableCell object.

 o HTMLTableCell
 public HTMLTableCell(HTMLTagElement element)
Constructs an HTMLTableCell.

Parameters:
element - The table cell element.

Methods

 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method is called each time the value of any bound property is changed.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener
 o 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
 o getColumnSpan
 public int getColumnSpan()
Returns the column span. The default value is one.

Returns:
The column span.
 o getElement
 public HTMLTagElement getElement()
Returns the table cell element.

Returns:
The cell element.
 o getHeight
 public int getHeight()
Returns the height relative to the table in pixels or percent.

Returns:
The height.
 o getHorizontalAlignment
 public String getHorizontalAlignment()
Returns the horizontal alignment. The default value is LEFT.

Returns:
The horizontal alignment. One of the following constants defined in HTMLConstants: CENTER, LEFT, or RIGHT.
See Also:
HTMLConstants
 o getRowSpan
 public int getRowSpan()
Returns the row span. The default value is one.

Returns:
The row span.
 o getTag
 public String getTag()
Returns the table cell tag.

Returns:
The cell tag.
 o getTag
 public String getTag(HTMLTagElement element)
Returns the table cell tag with the specified element. It does not change the cell object's element attribute.

Parameters:
element - The table cell element.
Returns:
The cell tag.
 o getVerticalAlignment
 public String getVerticalAlignment()
Returns the vertical alignment.

Returns:
The vertical alignment. One of the following constants defined in HTMLConstants: BASELINE, BOTTOM, MIDDLE, or TOP.
See Also:
HTMLConstants
 o getWidth
 public int getWidth()
Returns the width relative to the table in pixels or percent.

Returns:
The width.
 o isHeightInPercent
 public boolean isHeightInPercent()
Indicates if the height is in percent or pixels. The default value is false.

Returns:
true if percent; pixels otherwise.
 o isWidthInPercent
 public boolean isWidthInPercent()
Indicates if the width is in percent or pixels. The default value is false.

Returns:
true if percent; pixels otherwise.
 o isWrap
 public boolean isWrap()
Indicates if the cell data will use normal HTML linebreaking conventions. The default value is true.

Returns:
true if normal HTML linebreaking is used; false otherwise.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener
 o 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
 o setColumnSpan
 public void setColumnSpan(int span) throws PropertyVetoException
Sets the column span. The default value is one.

Parameters:
span - The column span.
Throws: PropertyVetoException
If the change is vetoed.
 o setElement
 public void setElement(String element) throws PropertyVetoException
Sets the table cell element.

Parameters:
element - The cell element.
Throws: PropertyVetoException
If the change is vetoed.
 o setElement
 public void setElement(HTMLTagElement element) throws PropertyVetoException
Sets the table cell element.

Parameters:
element - The cell element.
Throws: PropertyVetoException
If the change is vetoed.
 o setHeight
 public void setHeight(int height) throws PropertyVetoException
Sets the height relative to the table. The default unit is pixels. A table row can only have one height. If multiple cell heights are defined for different cells in the row, the outcome is browser dependent.

Parameters:
height - The height.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
setHeightInPercent
 o setHeight
 public void setHeight(int height,
                       boolean heightInPercent) throws PropertyVetoException
Sets the height relative to the table in pixels or percent. A table row can only have one height. If multiple cell heights are defined for different cells in the row, the outcome is browser dependent.

Parameters:
height - The height.
heightInPercent - true if unit is percent; false if pixels.
Throws: PropertyVetoException
If the change is vetoed.
 o setHeightInPercent
 public void setHeightInPercent(boolean heightInPercent) throws PropertyVetoException
Sets the height unit in percent or pixels. The default is false.

Parameters:
heightInPercent - true if unit is percent; false if pixels.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
setHeight
 o setHorizontalAlignment
 public void setHorizontalAlignment(String alignment) throws PropertyVetoException
Sets the horizontal alignment. The default value is LEFT.

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
 o setRowSpan
 public void setRowSpan(int span) throws PropertyVetoException
Sets the row span. The default value is one.

Parameters:
span - The row span.
Throws: PropertyVetoException
If the change is vetoed.
 o setVerticalAlignment
 public void setVerticalAlignment(String alignment) throws PropertyVetoException
Sets the vertical alignment.

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
 o setWidth
 public void setWidth(int width) throws PropertyVetoException
Sets the width relative to the table. The default width unit is pixels. A table column can only have one width and the width used is usually the widest. If multiple cell widths are defined for different cells in the column, the outcome is browser dependent.

Parameters:
width - The width.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
setWidthInPercent
 o setWidth
 public void setWidth(int width,
                      boolean widthInPercent) throws PropertyVetoException
Sets the width relative to the table in percent or pixels. A table column can only have one width and the width used is usually the widest. If multiple cell widths are defined for different cells in the column, the outcome is browser dependent.

Parameters:
width - The width.
widthInPercent - true if unit is percent; false if pixels.
Throws: PropertyVetoException
If the change is vetoed.
 o setWidthInPercent
 public void setWidthInPercent(boolean widthInPercent) throws PropertyVetoException
Sets the width unit in percent or pixels. The default is false.

Parameters:
widthInPercent - true if unit is percent; false if pixels.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
setWidth
 o setWrap
 public void setWrap(boolean wrap) throws PropertyVetoException
Sets if the cell data will use normal HTML linebreaking conventions. The default value is true.

Parameters:
wrap - true if normal HTML linebreaking is used; false otherwise.
Throws: PropertyVetoException
If the change is vetoed.
 o toString
 public String toString()
Returns the HTML table cell tag.

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index