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:
- PropertyChangeEvent
- VetoableChangeEvent
- See Also:
- HTMLTable, HTMLTableRow
-
HTMLTableCell()
- Constructs a default HTMLTableCell object.
-
HTMLTableCell(HTMLTagElement)
- Constructs an HTMLTableCell.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a PropertyChangeListener.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the VetoableChangeListener.
-
getColumnSpan()
- Returns the column span.
-
getElement()
- Returns the table cell element.
-
getHeight()
- Returns the height relative to the table in pixels or percent.
-
getHorizontalAlignment()
- Returns the horizontal alignment.
-
getRowSpan()
- Returns the row span.
-
getTag()
- Returns the table cell tag.
-
getTag(HTMLTagElement)
- Returns the table cell tag with the specified element.
-
getVerticalAlignment()
- Returns the vertical alignment.
-
getWidth()
- Returns the width relative to the table in pixels or percent.
-
isHeightInPercent()
- Indicates if the height is in percent or pixels.
-
isWidthInPercent()
- Indicates if the width is in percent or pixels.
-
isWrap()
- Indicates if the cell data will use normal HTML linebreaking conventions.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the PropertyChangeListener from the internal list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the VetoableChangeListener from the internal list.
-
setColumnSpan(int)
- Sets the column span.
-
setElement(HTMLTagElement)
- Sets the table cell element.
-
setElement(String)
- Sets the table cell element.
-
setHeight(int)
- Sets the height relative to the table.
-
setHeight(int, boolean)
- Sets the height relative to the table in pixels or percent.
-
setHeightInPercent(boolean)
- Sets the height unit in percent or pixels.
-
setHorizontalAlignment(String)
- Sets the horizontal alignment.
-
setRowSpan(int)
- Sets the row span.
-
setVerticalAlignment(String)
- Sets the vertical alignment.
-
setWidth(int)
- Sets the width relative to the table.
-
setWidth(int, boolean)
- Sets the width relative to the table in percent or pixels.
-
setWidthInPercent(boolean)
- Sets the width unit in percent or pixels.
-
setWrap(boolean)
- Sets if the cell data will use normal HTML linebreaking conventions.
-
toString()
- Returns the HTML table cell tag.
HTMLTableCell
public HTMLTableCell()
- Constructs a default HTMLTableCell object.
HTMLTableCell
public HTMLTableCell(HTMLTagElement element)
- Constructs an HTMLTableCell.
- Parameters:
- element - The table cell element.
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
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
getColumnSpan
public int getColumnSpan()
- Returns the column span. The default value is one.
- Returns:
- The column span.
getElement
public HTMLTagElement getElement()
- Returns the table cell element.
- Returns:
- The cell element.
getHeight
public int getHeight()
- Returns the height relative to the table in pixels or percent.
- Returns:
- The height.
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
getRowSpan
public int getRowSpan()
- Returns the row span. The default value is one.
- Returns:
- The row span.
getTag
public String getTag()
- Returns the table cell tag.
- Returns:
- The cell tag.
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.
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
getWidth
public int getWidth()
- Returns the width relative to the table in pixels or percent.
- Returns:
- The width.
isHeightInPercent
public boolean isHeightInPercent()
- Indicates if the height is in percent or pixels.
The default value is false.
- Returns:
- true if percent; pixels otherwise.
isWidthInPercent
public boolean isWidthInPercent()
- Indicates if the width is in percent or pixels.
The default value is false.
- Returns:
- true if percent; pixels otherwise.
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.
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
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
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.
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.
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.
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
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.
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
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
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.
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
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
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.
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
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.
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