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:
- PropertyChangeEvent
- VetoableChangeEvent
-
HTMLTableCaption()
- Constructs a default HTMLTableCaption object.
-
HTMLTableCaption(HTMLTagElement)
- Constructs an HTMLTableCaption object with the specified element.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a PropertyChangeListener.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the VetoableChangeListener.
-
getAlignment()
- Returns the caption alignment relative to the table.
-
getElement()
- Returns the element for the caption.
-
getTag()
- Returns the HTML caption tag.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the PropertyChangeListener from the internal list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the VetoableChangeListener from the internal list.
-
setAlignment(String)
- Sets the caption alignment relative to the table.
-
setElement(HTMLTagElement)
- Sets the element for the caption.
-
setElement(String)
- Sets the specified text for the caption.
-
toString()
- Returns the HTML caption tag.
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.
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
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
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
getElement
public HTMLTagElement getElement()
- Returns the element for the caption.
- Returns:
- An HTMLTagElement.
getTag
public String getTag()
- Returns the HTML caption tag.
- Returns:
- The caption tag.
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
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
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
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.
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.
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