Expresso 5-6

com.jcorporate.expresso.services.html
Class Heading

java.lang.Object
  extended bycom.jcorporate.expresso.services.html.HtmlElement
      extended bycom.jcorporate.expresso.services.html.Text
          extended bycom.jcorporate.expresso.services.html.Heading

public class Heading
extends Text

An HTML Heading item

Version:
$Revision: 1.8 $ $Date: 2004/11/17 20:48:18 $
Author:
Michael Nash

Field Summary
 
Fields inherited from class com.jcorporate.expresso.services.html.Text
contentString
 
Fields inherited from class com.jcorporate.expresso.services.html.HtmlElement
attributes, contents, cSSClass, cSSID
 
Constructor Summary
Heading()
          Constructor
Heading(String newString)
          Constructor Create the heading with the given name
Heading(String newString, int newLevel)
          Constructor Create a heading with the given level and given string as contents
Heading(String newString, String newStyle)
          Constructor Build a heading object with the given contents and the given style
Heading(String newString, String newStyle, int newLevel)
          Constructor Create a heading specifying the contents, style and level
 
Method Summary
protected  void display(PrintWriter out, int depth)
          Display the heading
 void setAlignment(String newAlignment)
          Set the horizontal alignment of the contents of this heading
 
Methods inherited from class com.jcorporate.expresso.services.html.Text
resetDefaults, setDefaultFontColor, setDefaultFontFace, setDefaultSmall, setDefaultStyle, setFontColor, setFontFace, setSmall, setStyle, setText
 
Methods inherited from class com.jcorporate.expresso.services.html.HtmlElement
add, display, finalize, getAttribute, getContentCount, getCSSClass, getName, padWithTabs, setAttribute, setCSSClass, setCSSID, setDisplayed, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Heading

public Heading()
        throws HtmlException
Constructor

Throws:
HtmlException - If the superclass constructor fails

Heading

public Heading(String newString)
        throws HtmlException
Constructor Create the heading with the given name

Parameters:
newString - the value for the heading

Heading

public Heading(String newString,
               int newLevel)
        throws HtmlException
Constructor Create a heading with the given level and given string as contents

Parameters:
newString - String for the contents of the heading
newLevel - Level of the heading
Throws:
HtmlException - If the parameters are invalid

Heading

public Heading(String newString,
               String newStyle)
        throws HtmlException
Constructor Build a heading object with the given contents and the given style

Parameters:
newString - The string for the heading
newStyle - A style, such as "bold", or "italic"
Throws:
HtmlException - If the parameters are invalid

Heading

public Heading(String newString,
               String newStyle,
               int newLevel)
        throws HtmlException
Constructor Create a heading specifying the contents, style and level

Parameters:
newString - String for the contents of the heading
newStyle - Style of the contents, e.g. "bold", "italic"
newLevel - Level of the heading
Throws:
HtmlException - If the parameters are invalid
Method Detail

display

protected void display(PrintWriter out,
                       int depth)
                throws HtmlException
Display the heading

Overrides:
display in class Text
Parameters:
out - PrintWriter to display
depth - the number of tabs to indent
Throws:
HtmlException - If the heading cannot be displayed

setAlignment

public void setAlignment(String newAlignment)
                  throws HtmlException
Set the horizontal alignment of the contents of this heading

Parameters:
newAlignment - New alignment as a string. Must be "left", "right" or "center"
Throws:
HtmlException - If the parameter is invalid

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.