com.ibm.as400.util.html
Class HTMLHeading

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

public class HTMLHeading
extends HTMLTagAttributes
implements java.io.Serializable

The HTMLHeading class represents a section heading in an HTML page.

This example creates a HTMLHeading tag:

  // Create an HTMLHeading.
  HTMLHeading header = new HTMLHeading(1, "My Heading", HTMLConstants.CENTER);
  System.out.println(header);
  

Here is the output of the HTMLHeading tag:

  <h1 align="center">My Heading</h1>
  

HTMLHeading objects generate the following events:

See Also:
Serialized Form

Constructor Summary
HTMLHeading()
          Constructs a default HTMLHeading object.
HTMLHeading(int level)
          Constructs an HTMLHeading object with the specified heading level.
HTMLHeading(int level, java.lang.String text)
          Constructs an HTMLHeading object with the specified heading level and text.
HTMLHeading(int level, java.lang.String text, java.lang.String align)
          Constructs an HTMLHeading object with the specified heading level, text, and align.
 
Method Summary
 java.lang.String getAlign()
          Returns the alignment of the header.
 java.lang.String getDirection()
          Returns the direction of the text interpretation.
 java.lang.String getLanguage()
          Returns the language of the input element.
 int getLevel()
          Returns the level of the header.
 java.lang.String getTag()
          Returns the tag for the HTML heading.
 java.lang.String getText()
          Returns the text of the header.
 void setAlign(java.lang.String align)
          Sets the horizontal alignment for the header.
 void setDirection(java.lang.String dir)
          Sets the direction of the text interpretation.
 void setLanguage(java.lang.String lang)
          Sets the language of the input tag.
 void setLevel(int level)
          Sets the level of the header.
 void setText(java.lang.String text)
          Set the visible text to display in the header.
 java.lang.String toString()
          Returns a String representation for the HTMLHeading 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

HTMLHeading

public HTMLHeading()
Constructs a default HTMLHeading object.

HTMLHeading

public HTMLHeading(int level)
Constructs an HTMLHeading object with the specified heading level.
Parameters:
level - The heading level.

HTMLHeading

public HTMLHeading(int level,
                   java.lang.String text)
Constructs an HTMLHeading object with the specified heading level and text.
Parameters:
level - The heading level.
text - The heading text.

HTMLHeading

public HTMLHeading(int level,
                   java.lang.String text,
                   java.lang.String align)
Constructs an HTMLHeading object with the specified heading level, text, and align.
Parameters:
level - The heading level.
text - The heading text.
align - The heading alignment. One of the following constants defined in HTMLConstants: LEFT, RIGHT, or CENTER.
Method Detail

getAlign

public java.lang.String getAlign()
Returns the alignment of the header.
Returns:
The alignment.

getDirection

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

getLanguage

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

getLevel

public int getLevel()
Returns the level of the header.
Returns:
The level.

getText

public java.lang.String getText()
Returns the text of the header.
Returns:
The text.

getTag

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

setAlign

public void setAlign(java.lang.String align)
Sets the horizontal alignment for the header.
Parameters:
align - The alignment. One of the following constants defined in HTMLConstants: LEFT, RIGHT, or CENTER.
See Also:
HTMLConstants

setDirection

public void setDirection(java.lang.String dir)
Sets the direction of the text interpretation.
Parameters:
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
See Also:
HTMLConstants

setLanguage

public void setLanguage(java.lang.String lang)
Sets the language of the input tag.
Parameters:
lang - The language. Example language tags include: en and en-US.

setLevel

public void setLevel(int level)
Sets the level of the header. Heading 1(H1) is rendered as the largest and most important section heading while Heading 6(H6) is rendered as the smallest (lowest importance) heading.
Parameters:
level - The heading level (1 - 6).
See Also:
HTMLConstants

setText

public void setText(java.lang.String text)
Set the visible text to display in the header.
Parameters:
text - The text.

toString

public java.lang.String toString()
Returns a String representation for the HTMLHeading tag.
Overrides:
toString in class java.lang.Object
Returns:
The tag.