All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.html.HTMLTableCaption

java.lang.Object
   |
   +----com.ibm.as400.util.html.HTMLTableCaption

public class HTMLTableCaption
extends Object
implements HTMLTagElement, 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>
  

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:


Constructor Index

 o HTMLTableCaption()
Constructs a default HTMLTableCaption object.
 o HTMLTableCaption(HTMLTagElement)
Constructs an HTMLTableCaption object with the specified element.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener.
 o addVetoableChangeListener(VetoableChangeListener)
Adds the VetoableChangeListener.
 o getAlignment()
Returns the caption alignment relative to the table.
 o getElement()
Returns the element for the caption.
 o getTag()
Returns the HTML caption tag.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the PropertyChangeListener from the internal list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes the VetoableChangeListener from the internal list.
 o setAlignment(String)
Sets the caption alignment relative to the table.
 o setElement(HTMLTagElement)
Sets the element for the caption.
 o setElement(String)
Sets the specified text for the caption.
 o toString()
Returns the HTML caption tag.

Constructors

 o HTMLTableCaption
 public HTMLTableCaption()
Constructs a default HTMLTableCaption object.

 o HTMLTableCaption
 public HTMLTableCaption(HTMLTagElement element)
Constructs an HTMLTableCaption object with the specified element.

Parameters:
element - An HTMLTagElement object.

Methods

 o 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
 o 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
 o getAlignment
 public 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
 o getElement
 public HTMLTagElement getElement()
Returns the element for the caption.

Returns:
An HTMLTagElement.
 o getTag
 public String getTag()
Returns the HTML caption tag.

Returns:
The caption tag.
 o 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
 o 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
 o setAlignment
 public void setAlignment(String alignment) throws 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: PropertyVetoException
If the change is vetoed.
See Also:
HTMLConstants
 o setElement
 public void setElement(String text) throws PropertyVetoException
Sets the specified text for the caption.

Parameters:
text - The caption text.
Throws: PropertyVetoException
If the change is vetoed.
 o setElement
 public void setElement(HTMLTagElement element) throws PropertyVetoException
Sets the element for the caption.

Parameters:
element - An HTMLTagElement.
Throws: PropertyVetoException
If the change is vetoed.
 o toString
 public String toString()
Returns the HTML caption tag.

Returns:
The caption tag.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index