com.ibm.as400.util.html
Class HTMLTableCaption

java.lang.Object
  |
  +--com.ibm.as400.util.html.HTMLTagAttributes
        |
        +--com.ibm.as400.util.html.HTMLTableCaption
All Implemented Interfaces:
HTMLConstants, HTMLTagElement, java.io.Serializable

public class HTMLTableCaption
extends HTMLTagAttributes
implements HTMLConstants, java.io.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>
  

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:

See Also:
Serialized Form

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 Summary
HTMLTableCaption()
          Constructs a default HTMLTableCaption object.
HTMLTableCaption(HTMLTagElement element)
          Constructs an HTMLTableCaption object with the specified element.
 
Method Summary
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds the VetoableChangeListener.
 java.lang.String getAlignment()
          Returns the caption alignment relative to the table.
 java.lang.String getDirection()
          Returns the direction of the text interpretation.
 HTMLTagElement getElement()
          Returns the element for the caption.
 java.lang.String getLanguage()
          Returns the language of the caption.
 java.lang.String getTag()
          Returns the HTML caption tag.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes the VetoableChangeListener from the internal list.
 void setAlignment(java.lang.String alignment)
          Sets the caption alignment relative to the table.
 void setDirection(java.lang.String dir)
          Sets the direction of the text interpretation.
 void setElement(HTMLTagElement element)
          Sets the element for the caption.
 void setElement(java.lang.String text)
          Sets the specified text for the caption.
 void setLanguage(java.lang.String lang)
          Sets the language of the caption.
 java.lang.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

HTMLTableCaption

public HTMLTableCaption()
Constructs a default HTMLTableCaption object.

HTMLTableCaption

public HTMLTableCaption(HTMLTagElement element)
Constructs an HTMLTableCaption object with the specified element.
Parameters:
element - An HTMLTagElement object.
Method Detail

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.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(java.beans.VetoableChangeListener)

getAlignment

public java.lang.String getAlignment()
Returns the caption alignment relative to the table.
Returns:
The caption alignment. One of the following constants defined in HTMLConstants: BOTTOM, LEFT, RIGHT, or TOP.
See Also:
HTMLConstants

getDirection

public java.lang.String getDirection()
Returns the direction of the text interpretation.
Returns:
The direction of the text.

getElement

public HTMLTagElement getElement()
Returns the element for the caption.
Returns:
An HTMLTagElement.

getLanguage

public java.lang.String getLanguage()
Returns the language of the caption.
Returns:
The language of the caption.

getTag

public java.lang.String getTag()
Returns the HTML caption tag.
Returns:
The caption tag.

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.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(java.beans.VetoableChangeListener)

setAlignment

public void setAlignment(java.lang.String alignment)
                  throws java.beans.PropertyVetoException
Sets the caption alignment relative to the table.
Parameters:
alignment - The caption alignment. One of the following constants defined in HTMLConstants: BOTTOM, LEFT, RIGHT, or TOP.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
HTMLConstants

setDirection

public void setDirection(java.lang.String dir)
                  throws java.beans.PropertyVetoException
Sets the direction of the text interpretation.
Parameters:
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
Throws:
java.beans.PropertyVetoException - If a change is vetoed.
See Also:
HTMLConstants

setElement

public void setElement(java.lang.String text)
                throws java.beans.PropertyVetoException
Sets the specified text for the caption.
Parameters:
text - The caption text.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.

setElement

public void setElement(HTMLTagElement element)
                throws java.beans.PropertyVetoException
Sets the element for the caption.
Parameters:
element - An HTMLTagElement.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.

setLanguage

public void setLanguage(java.lang.String lang)
                 throws java.beans.PropertyVetoException
Sets the language of the caption.
Parameters:
lang - The language. Example language tags include: en and en-US.
Throws:
java.beans.PropertyVetoException - If a change is vetoed.

toString

public java.lang.String toString()
Returns the HTML caption tag.
Overrides:
toString in class java.lang.Object
Returns:
The caption tag.