PAJES 2.3.9

org.pajes.html
Class FormattedText

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.TraversableElement
          extended byorg.pajes.html.Container
              extended byorg.pajes.html.FormattedText
All Implemented Interfaces:
java.lang.Cloneable, HTML, java.io.Serializable, TextContainer, Traversable
Direct Known Subclasses:
Big, Bold, Cite, Code, Dfn, Em, Font, Italic, Kbd, Samp, Small, Strike, Strong, Subscript, Superscript, Teletype, Underline, Var

public class FormattedText
extends Container
implements TextContainer

Formats a piece of text or HTML with the following content and/or physical style tags:

See Also:
Span, Text, PlainText, Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
FormattedText()
          Creates a container that will wrap formatting tags around its content.
FormattedText(HTML html)
          Wraps formatting around another HTML object.
FormattedText(java.lang.String valueToOutput)
          Wraps formatting around a line of text.
FormattedText(java.lang.String valueToOutput, boolean encode)
          Wraps formatting around a line of text.
 
Method Summary
 java.lang.String getContainedText()
          Returns the text that this object contains.
 FormattedText setBig(boolean big)
          Determines if this text is to be increased one size larger than the surrounding text.
 FormattedText setBold(boolean bold)
          Determines if this text is to be displayed in boldface.
 FormattedText setCitation(boolean cite)
          Determines if this text is a bibliographic citation.
 FormattedText setCode(boolean code)
          Determines if this text is computer source code or other formatted content.
protected  FormattedText setDefaults()
          Allows sub-classes to define their default settings.
 FormattedText setDefiningInstance(boolean defn)
          Determines if this text is the defining instance of a special term or phrase.
 FormattedText setEmphasized(boolean em)
          Determines if this text is to be emphasised.
 FormattedText setItalic(boolean italic)
          Determines if this text is to be displayed in italics.
 FormattedText setKeyboard(boolean kbd)
          Determines if this text is to be indicated as text typed at a keyboard.
 FormattedText setSample(boolean samp)
          Determines if this text is a small sequence of characters that are taken out of their normal context.
 FormattedText setSmall(boolean small)
          Determines if this text is to be decreased one size smaller than the surrounding text.
 FormattedText setStrikeThrough(boolean strikeThrough)
          Determines if this text is to be displayed with a line through it.
 FormattedText setStrong(boolean strong)
          Determines if this text is to be heavily emphasized.
 FormattedText setSubscript(boolean sub)
          Determines if this text is to be displayed as a subscript.
 FormattedText setSuperscript(boolean sup)
          Determines if this text is to be displayed as a superscript.
 FormattedText setTeletype(boolean tt)
          Determines if this text is to be displayed in a monospaced teletype font.
 FormattedText setUnderline(boolean underline)
          Determines if this text is to be underlined.
 FormattedText setVariable(boolean var)
          Determines if this text is a variable name or a user-field.
 void write(Browser browser)
          Prints the formatted text to the browser.
 
Methods inherited from class org.pajes.html.Container
add, add, add, add, addContent, clear, clone, delete, delete, destroy, get, getContent, getContents, getPosition, insert, replace, set, setContent, setContent, size, writeContent
 
Methods inherited from class org.pajes.html.TraversableElement
dump, dump, getAll, getFieldByName, getFirstFieldByName, getFirstTagByAttribute, getFirstTagByClass, getFirstTagByID, getFirstTagByName, getTagByAttribute, getTagByClass, getTagByID, getTagByName, setWritable
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, getAttribute, getAttributes, getAttributeSet, getContainer, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, init, initAttributes, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormattedText

public FormattedText()
Creates a container that will wrap formatting tags around its content.


FormattedText

public FormattedText(HTML html)
Wraps formatting around another HTML object.

Parameters:
html - the HTML object to be formatted.

FormattedText

public FormattedText(java.lang.String valueToOutput)
Wraps formatting around a line of text.

Parameters:
valueToOutput - the text to be formatted.

FormattedText

public FormattedText(java.lang.String valueToOutput,
                     boolean encode)
Wraps formatting around a line of text.

Parameters:
valueToOutput - the text to be formatted.
encode - true if any special HTML characters in the text are to be converted to their equivalent HTML named character entity, or false if no changes are to be made to the text.
Method Detail

getContainedText

public java.lang.String getContainedText()
Returns the text that this object contains.

Specified by:
getContainedText in interface TextContainer
Returns:
the text that this object contains.

setBig

public FormattedText setBig(boolean big)
Determines if this text is to be increased one size larger than the surrounding text.

Parameters:
big - true if this text is to be increased one size larger than the surrounding text.
Returns:
the modified FormattedText object.

setBold

public FormattedText setBold(boolean bold)
Determines if this text is to be displayed in boldface.

Parameters:
bold - true if this text is to be displayed in boldface.
Returns:
the modified FormattedText object.

setCitation

public FormattedText setCitation(boolean cite)
Determines if this text is a bibliographic citation.

Parameters:
cite - true if this text is a bibliographic citation.
Returns:
the modified FormattedText object.

setCode

public FormattedText setCode(boolean code)
Determines if this text is computer source code or other formatted content.

Parameters:
code - true if this text is computer source code or other formatted content.
Returns:
the modified FormattedText object.

setDefiningInstance

public FormattedText setDefiningInstance(boolean defn)
Determines if this text is the defining instance of a special term or phrase.

Parameters:
defn - true if this text is the defining instance of a special term or phrase.
Returns:
the modified FormattedText object.

setEmphasized

public FormattedText setEmphasized(boolean em)
Determines if this text is to be emphasised.

Parameters:
em - true if this text is to be emphasised.
Returns:
the modified FormattedText object.

setItalic

public FormattedText setItalic(boolean italic)
Determines if this text is to be displayed in italics.

Parameters:
italic - true if this text is to be displayed in italics.
Returns:
the modified FormattedText object.

setKeyboard

public FormattedText setKeyboard(boolean kbd)
Determines if this text is to be indicated as text typed at a keyboard.

Parameters:
kbd - true if this text is to be indicated as text typed at a keyboard.
Returns:
the modified FormattedText object.

setSample

public FormattedText setSample(boolean samp)
Determines if this text is a small sequence of characters that are taken out of their normal context.

Parameters:
samp - true if this text is a small sequence of characters that are taken out of their normal context.
Returns:
the modified FormattedText object.

setSmall

public FormattedText setSmall(boolean small)
Determines if this text is to be decreased one size smaller than the surrounding text.

Parameters:
small - true if this text is to be decreased one size smaller than the surrounding text.
Returns:
the modified FormattedText object.

setStrikeThrough

public FormattedText setStrikeThrough(boolean strikeThrough)
Determines if this text is to be displayed with a line through it.

Parameters:
strikeThrough - true if this text is to be displayed with a line through it.
Returns:
the modified FormattedText object.

setStrong

public FormattedText setStrong(boolean strong)
Determines if this text is to be heavily emphasized.

Parameters:
strong - true if this text is to be heavily emphasized.
Returns:
the modified FormattedText object.

setSubscript

public FormattedText setSubscript(boolean sub)
Determines if this text is to be displayed as a subscript.

Parameters:
sub - true if this text is to be displayed as a subscript.
Returns:
the modified FormattedText object.

setSuperscript

public FormattedText setSuperscript(boolean sup)
Determines if this text is to be displayed as a superscript.

Parameters:
sup - true if this text is to be displayed as a superscript.
Returns:
the modified FormattedText object.

setTeletype

public FormattedText setTeletype(boolean tt)
Determines if this text is to be displayed in a monospaced teletype font.

Parameters:
tt - true if this text is to be displayed in a monospaced teletype font.
Returns:
the modified FormattedText object.

setUnderline

public FormattedText setUnderline(boolean underline)
Determines if this text is to be underlined.

Parameters:
underline - true if this text is to be underlined.
Returns:
the modified FormattedText object.

setVariable

public FormattedText setVariable(boolean var)
Determines if this text is a variable name or a user-field.

Parameters:
var - true if this text is a variable name or a user-field.
Returns:
the modified FormattedText object.

write

public void write(Browser browser)
           throws java.io.IOException
Prints the formatted text to the browser.

Specified by:
write in interface HTML
Overrides:
write in class Tag
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.
See Also:
Tag.setWriteEndTag(boolean), Tag.writeContent(org.pajes.servlet.Browser)

setDefaults

protected FormattedText setDefaults()
Allows sub-classes to define their default settings. This method will be called prior to any output being returned to the browser.

Returns:
the modified FormattedText object.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.