|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.util.html.HTMLTagAttributes com.ibm.as400.util.html.HTMLTableCaption
public class HTMLTableCaption extends HTMLTagAttributes implements HTMLConstants, Serializable
The HTMLTableCaption class represents an HTML Caption tag.
This example creates an HTMLTableCaption object with an HTMLText object for the caption element.
// Create an HTMLText object for the caption text. HTMLText captionText = new HTMLText("MY TABLE"); // Create the HTMLTableCaption object with the new HTMLText object. HTMLTableCaption caption = new HTMLTableCaption(captionText); // Display the tag. System.out.println(caption.getTag());
Here is the output of the tag:
<caption>MY TABLE</caption>
The equivalent tag using XSL Formatting Objects is:
<fo:block><fo:block>MY TABLE</fo:block> </fo:block>
This example creates an HTMLTableCaption object with an HTMLHyperlink object for the caption element.
// Create an HTMLHyperlink object for the caption text. HTMLHyperlink companyLink = new HTMLHyperlink("http://www.myCompany.com", "My Company"); // Create the HTMLTableCaption object with the new HTMLHyperlink object. HTMLTableCaption caption = new HTMLTableCaption(companyLink); caption.setAlignment(HTMLConstants.BOTTOM); // Display the tag. System.out.println(caption.getTag());
Here is the output of the tag:
<caption align="bottom"><a href="http://www.myCompany.com>My Company"</a></caption>
HTMLTableCaption objects generate the following events:
Modifier 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 |
---|
HTMLTableCaption()
Constructs a default HTMLTableCaption object. |
HTMLTableCaption(HTMLTagElement element)
Constructs an HTMLTableCaption object with the specified element. |
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
String |
getAlignment()
Returns the caption alignment relative to the table. |
String |
getDirection()
Returns the direction of the text interpretation. |
HTMLTagElement |
getElement()
Returns the element for the caption. |
String |
getFOTag()
Returns the XSL-FO caption tag. |
String |
getLanguage()
Returns the language of the caption. |
String |
getTag()
Returns the HTML caption tag. |
boolean |
isUseFO()
Returns if Formatting Object tags are outputted. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setAlignment(String alignment)
Sets the caption alignment relative to the table. |
void |
setDirection(String dir)
Sets the direction of the text interpretation. |
void |
setElement(HTMLTagElement element)
Sets the element for the caption. |
void |
setElement(String text)
Sets the specified text for the caption. |
void |
setLanguage(String lang)
Sets the language of the caption. |
void |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used. |
String |
toString()
Returns the HTML caption 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 HTMLTableCaption()
public HTMLTableCaption(HTMLTagElement element)
element
- An HTMLTagElement object.Method Detail |
---|
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public String getAlignment()
HTMLConstants
public String getDirection()
public HTMLTagElement getElement()
public String getLanguage()
public String getTag()
getTag
in interface HTMLTagElement
public String getFOTag()
getFOTag
in interface HTMLTagElement
public boolean isUseFO()
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setAlignment(String alignment) throws PropertyVetoException
alignment
- The caption alignment. One of the following constants
defined in HTMLConstants: BOTTOM, LEFT, RIGHT, or TOP.PropertyVetoException
- If the change is vetoed.HTMLConstants
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 text) throws PropertyVetoException
text
- The caption text.PropertyVetoException
- If the change is vetoed.public void setElement(HTMLTagElement element) throws PropertyVetoException
element
- An HTMLTagElement.PropertyVetoException
- If the change is vetoed.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 setUseFO(boolean useFO)
useFO
- - true if output generated is an XSL formatting object, false if the output generated is HTML.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |