|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.html.Formatter
HTML formats text, which contains special tags to indicate various text features (bold, italic, etc). HTML has three special characters (<, >, &) which must be encoded if they are to displayed in a browser. Use the class to format items in HTML. This class escapes the special HTML characters. It is used by other class in sdsu.html to process strings to html. If you wish to generate HTML tags directly use appendHTMLTags(). This will not escape the special characters. The resulting Formatter object can be used correctly by other classes in sdsu.html.
Constructor Summary | |
Formatter()
Create a new Formatter |
|
Formatter(java.lang.String asciiText)
Create a new Formatter object on the string All special html characters in string asciiText are escaped |
Method Summary | |
void |
alignCenter()
Centers the contents of object. |
void |
alignLeft()
Left justifies contents of object. |
void |
alignRight()
Right justifies the contents of object. |
void |
append(HTML htmlObject)
Append the an existing HTML object to the current end of the text. |
void |
append(java.lang.String asciiText)
Append the string 'asciiText' to the current end of the text |
void |
appendBold(java.lang.String asciiText)
Append the string 'asciiText' to the current end of the text as bold text |
void |
appendHeading(java.lang.String heading,
int headingLevel)
Append the string heading to the current end of the text as a heading. |
void |
appendHTMLTags(java.lang.String withHTMLTags)
Appends the string withHTMLTags without escaping special characters. |
void |
appendItalic(java.lang.String asciiText)
Append the string 'asciiText' to the current end of the text as bold text |
void |
appendLineBreak()
Appends one HTML line break (or carriage returns) to the current end of the text. |
void |
appendLink(java.lang.String asciiText,
java.lang.String url)
Append the string 'asciiText' to the current end of the text as linked text. |
void |
appendMailLink(java.lang.String mailAddress)
Appends a mailTo reference. |
void |
makeBlockQuote()
Sets the current object to be a HTML block quote. |
void |
makeParagraph()
Sets the current object to be a HTML paragraph. |
void |
makePreformatted()
Sets the current text to preformatted. |
java.lang.String |
toString()
Converts the text to an string with proper html tags |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Formatter(java.lang.String asciiText)
public Formatter()
Method Detail |
public void alignCenter()
public void alignRight()
public void alignLeft()
public void makePreformatted()
This has some extra spaces in it
public void makeParagraph()
public void makeBlockQuote()
public java.lang.String toString()
public void append(java.lang.String asciiText)
public void append(HTML htmlObject)
public void appendBold(java.lang.String asciiText)
public void appendItalic(java.lang.String asciiText)
public void appendHeading(java.lang.String heading, int headingLevel)
heading
- string added as a heading.headingLevel
- heading level text is set to.public void appendHTMLTags(java.lang.String withHTMLTags)
public void appendLink(java.lang.String asciiText, java.lang.String url)
asciiText
- the string appendedurl
- the url the string is a link topublic void appendMailLink(java.lang.String mailAddress)
mailAddress
- string containing a well formed and valid
mail addresspublic void appendLineBreak()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |