|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.util.html.HTMLTagAttributes
com.ibm.as400.util.html.HTMLTableCell
public class HTMLTableCell extends HTMLTagAttributes implements HTMLConstants, Serializable
The HTMLTableCell class represents data in an HTML table cell.
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 FormModifier and Type | Field and Description |
---|
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 and Description |
---|
HTMLTableCell()
Constructs a default HTMLTableCell object. |
HTMLTableCell(HTMLTagElement element)
Constructs an HTMLTableCell. |
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
int |
getColumnSpan()
Returns the column span. |
String |
getDirection()
Returns the direction of the text interpretation. |
HTMLTagElement |
getElement()
Returns the table cell element. |
String |
getFOTag()
Returns the XSL-FO table cell tag. |
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. |
String |
getHorizontalAlignment()
Returns the horizontal alignment. |
String |
getLanguage()
Returns the language of the table cell. |
int |
getRowSpan()
Returns the row span. |
String |
getTag()
Returns the table cell tag. |
String |
getTag(HTMLTagElement element)
Returns the table cell tag with the specified element. |
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(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(String dir)
Sets the direction of the text interpretation. |
void |
setElement(HTMLTagElement element)
Sets the table cell element. |
void |
setElement(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(String alignment)
Sets the horizontal alignment. |
void |
setLanguage(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(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. |
String |
toString()
Returns the HTML table cell 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 |
---|
public HTMLTableCell()
public HTMLTableCell(HTMLTagElement element)
element
- The table cell element.Method Detail |
---|
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public int getColumnSpan()
public String getDirection()
public HTMLTagElement getElement()
public int getHeight()
public String getHorizontalAlignment()
HTMLConstants
public String getLanguage()
public int getRowSpan()
public String getTag()
getTag
in interface HTMLTagElement
public String getFOTag()
getFOTag
in interface HTMLTagElement
public String getFOTag(HTMLTagElement element)
element
- The table cell element.public String getTag(HTMLTagElement element)
element
- The table cell element.public String getVerticalAlignment()
HTMLConstants
public int getWidth()
public boolean isHeightInPercent()
public boolean isUseFO()
public boolean isWidthInPercent()
public boolean isWrap()
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setColumnSpan(int span) throws PropertyVetoException
span
- The column span.PropertyVetoException
- If the change is vetoed.public void setDirection(String dir) throws PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setElement(String element) throws PropertyVetoException
element
- The cell element.PropertyVetoException
- If the change is vetoed.public void setElement(HTMLTagElement element) throws PropertyVetoException
element
- The cell element.PropertyVetoException
- If the change is vetoed.public void setHeight(int height) throws PropertyVetoException
height
- The height.PropertyVetoException
- If the change is vetoed.setHeightInPercent(boolean)
public void setHeight(int height, boolean heightInPercent) throws PropertyVetoException
height
- The height.heightInPercent
- true if unit is percent; false if pixels.PropertyVetoException
- If the change is vetoed.public void setHeightInPercent(boolean heightInPercent) throws PropertyVetoException
heightInPercent
- true if unit is percent; false if pixels.PropertyVetoException
- If the change is vetoed.setHeight(int)
public void setHorizontalAlignment(String alignment) throws PropertyVetoException
alignment
- The horizontal alignment. One of the following constants
defined in HTMLConstants: CENTER, LEFT, or RIGHT.PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setLanguage(String lang) throws PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.PropertyVetoException
- If a change is vetoed.public void setRowSpan(int span) throws PropertyVetoException
span
- The row span.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(String alignment) throws PropertyVetoException
alignment
- The vertical alignment. One of the following constants
defined in HTMLConstants: BASELINE, BOTTOM, MIDDLE, or TOP.PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setWidth(int width) throws PropertyVetoException
width
- The width.PropertyVetoException
- If the change is vetoed.setWidthInPercent(boolean)
public void setWidth(int width, boolean widthInPercent) throws PropertyVetoException
width
- The width.widthInPercent
- true if unit is percent; false if pixels.PropertyVetoException
- If the change is vetoed.public void setWidthInPercent(boolean widthInPercent) throws PropertyVetoException
widthInPercent
- true if unit is percent; false if pixels.PropertyVetoException
- If the change is vetoed.setWidth(int)
public void setWrap(boolean wrap) throws PropertyVetoException
wrap
- true if normal HTML linebreaking is used; false otherwise.PropertyVetoException
- If the change is vetoed.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |