public class HTMLTableCell extends HTMLTagAttributes implements HTMLConstants, java.io.Serializable
This example creates an HTML text HTMLTableCell object.
Here is the output of the tag:// 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());
<td align="center"><b><i>IBM</i></b></td>
Calling getFOTag() produces the following:
<fo:table-cell border-style='solid' border-width='1px' padding='1px' text-align='center'><fo:block-container> <fo:block font-weight='bold' font-style='italic'>IBM</fo:block> </fo:block-container> </fo:table-cell>
This example creates an HTMLTableCell object with the element as an HTMLForm object containing a submit button.
Here is the output of the tag: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());
<td><form action="http://myCompany.com/myServlet" method="get"> <input type="submit" value="Send" /> </form></td>
HTMLTableCell objects generate the following events:
HTMLTable
,
HTMLTableRow
,
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 |
---|
HTMLTableCell()
Constructs a default HTMLTableCell object.
|
HTMLTableCell(HTMLTagElement element)
Constructs an HTMLTableCell.
|
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the VetoableChangeListener.
|
int |
getColumnSpan()
Returns the column span.
|
java.lang.String |
getDirection()
Returns the direction of the text interpretation.
|
HTMLTagElement |
getElement()
Returns the table cell element.
|
java.lang.String |
getFOTag()
Returns the XSL-FO table cell tag.
|
java.lang.String |
getFOTag(HTMLTagElement element)
Returns the XSL-FO table cell tag with the specified element.
|
int |
getHeight()
Returns the height relative to the table in pixels or percent.
|
java.lang.String |
getHorizontalAlignment()
Returns the horizontal alignment.
|
java.lang.String |
getLanguage()
Returns the language of the table cell.
|
int |
getRowSpan()
Returns the row span.
|
java.lang.String |
getTag()
Returns the table cell tag.
|
java.lang.String |
getTag(HTMLTagElement element)
Returns the table cell tag with the specified element.
|
java.lang.String |
getVerticalAlignment()
Returns the vertical alignment.
|
int |
getWidth()
Returns the width relative to the table in pixels or percent.
|
boolean |
isHeightInPercent()
Indicates if the height is in percent or pixels.
|
boolean |
isUseFO()
Returns if Formatting Object tags are outputted.
|
boolean |
isWidthInPercent()
Indicates if the width is in percent or pixels.
|
boolean |
isWrap()
Indicates if the cell data will use normal HTML linebreaking conventions.
|
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 |
setColumnSpan(int span)
Sets the column span.
|
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation.
|
void |
setElement(HTMLTagElement element)
Sets the table cell element.
|
void |
setElement(java.lang.String element)
Sets the table cell element.
|
void |
setHeight(int height)
Sets the height relative to the table.
|
void |
setHeight(int height,
boolean heightInPercent)
Sets the height relative to the table in pixels or percent.
|
void |
setHeightInPercent(boolean heightInPercent)
Sets the height unit in percent or pixels.
|
void |
setHorizontalAlignment(java.lang.String alignment)
Sets the horizontal alignment.
|
void |
setLanguage(java.lang.String lang)
Sets the language of the table cell.
|
void |
setRowSpan(int span)
Sets the row span.
|
void |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used.
|
void |
setVerticalAlignment(java.lang.String alignment)
Sets the vertical alignment.
|
void |
setWidth(int width)
Sets the width relative to the table.
|
void |
setWidth(int width,
boolean widthInPercent)
Sets the width relative to the table in percent or pixels.
|
void |
setWidthInPercent(boolean widthInPercent)
Sets the width unit in percent or pixels.
|
void |
setWrap(boolean wrap)
Sets if the cell data will use normal HTML linebreaking conventions.
|
java.lang.String |
toString()
Returns the HTML table cell tag.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLTableCell()
public HTMLTableCell(HTMLTagElement element)
element
- The table cell element.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public int getColumnSpan()
public java.lang.String getDirection()
public HTMLTagElement getElement()
public int getHeight()
public java.lang.String getHorizontalAlignment()
HTMLConstants
public java.lang.String getLanguage()
public int getRowSpan()
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getFOTag(HTMLTagElement element)
element
- The table cell element.public java.lang.String getTag(HTMLTagElement element)
element
- The table cell element.public java.lang.String getVerticalAlignment()
HTMLConstants
public int getWidth()
public boolean isHeightInPercent()
public boolean isUseFO()
public boolean isWidthInPercent()
public boolean isWrap()
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setColumnSpan(int span) throws java.beans.PropertyVetoException
span
- The column span.java.beans.PropertyVetoException
- If the change is vetoed.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 setElement(java.lang.String element) throws java.beans.PropertyVetoException
element
- The cell element.java.beans.PropertyVetoException
- If the change is vetoed.public void setElement(HTMLTagElement element) throws java.beans.PropertyVetoException
element
- The cell element.java.beans.PropertyVetoException
- If the change is vetoed.public void setHeight(int height) throws java.beans.PropertyVetoException
height
- The height.java.beans.PropertyVetoException
- If the change is vetoed.setHeightInPercent(boolean)
public void setHeight(int height, boolean heightInPercent) throws java.beans.PropertyVetoException
height
- The height.heightInPercent
- true if unit is percent; false if pixels.java.beans.PropertyVetoException
- If the change is vetoed.public void setHeightInPercent(boolean heightInPercent) throws java.beans.PropertyVetoException
heightInPercent
- true if unit is percent; false if pixels.java.beans.PropertyVetoException
- If the change is vetoed.setHeight(int)
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 setRowSpan(int span) throws java.beans.PropertyVetoException
span
- The row span.java.beans.PropertyVetoException
- If the change is vetoed.public void setUseFO(boolean useFO)
useFO
- - true if output generated is a XSL formatting object, false if the output generated is HTML.public void setBorderWidth(int borderWidth)
borderWidth
- The border width.public void setCellPadding(int cellPadding)
cellPadding
- The cell padding.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 void setWidth(int width) throws java.beans.PropertyVetoException
width
- The width.java.beans.PropertyVetoException
- If the change is vetoed.setWidthInPercent(boolean)
public void setWidth(int width, boolean widthInPercent) throws java.beans.PropertyVetoException
width
- The width.widthInPercent
- true if unit is percent; false if pixels.java.beans.PropertyVetoException
- If the change is vetoed.public void setWidthInPercent(boolean widthInPercent) throws java.beans.PropertyVetoException
widthInPercent
- true if unit is percent; false if pixels.java.beans.PropertyVetoException
- If the change is vetoed.setWidth(int)
public void setWrap(boolean wrap) throws java.beans.PropertyVetoException
wrap
- true if normal HTML linebreaking is used; false otherwise.java.beans.PropertyVetoException
- If the change is vetoed.public java.lang.String toString()
toString
in class java.lang.Object