com.mortbay.HTML
Class Block

java.lang.Object
  |
  +--com.mortbay.HTML.Element
        |
        +--com.mortbay.HTML.Composite
              |
              +--com.mortbay.HTML.Block
Direct Known Subclasses:
Applet, Font, Form, Heading, Link, List, Script, Select, Style, Table, TextArea

public class Block
extends Composite

HTML Block Composite Block of predefined or arbitrary type. Block types are predefined for PRE, BLOCKQUOTE, CENTER, LISTING, PLAINTEXT, XMP, DIV (Left and Right) and SPAN.

See Also:
Composite

Field Summary
static java.lang.String Bold
          Bold
static java.lang.String Center
          Center the block
static java.lang.String Div
          Basic Division
static java.lang.String Italic
          Italic
static java.lang.String Left
          Left align
static java.lang.String Listing
          Code listing style
static java.lang.String Plain
          Plain text
static java.lang.String Pre
          Preformatted text
static java.lang.String Quote
          Quoted Text
static java.lang.String Right
          Right align
static java.lang.String Span
          Span
static java.lang.String Xmp
          Old pre format - preserve line breaks
 
Fields inherited from class com.mortbay.HTML.Composite
elements, nest
 
Fields inherited from class com.mortbay.HTML.Element
ALIGN, attributeMap, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, noAttributes, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH
 
Constructor Summary
Block(java.lang.String tag)
          Construct a block using the passed string as the tag
Block(java.lang.String tag, java.lang.String attributes)
          Construct a block using the passed string as the tag
 
Method Summary
 void write(java.io.Writer out)
          Write the composite.
 
Methods inherited from class com.mortbay.HTML.Composite
add, contents, nest, replace, reset, setNest, size, unnest
 
Methods inherited from class com.mortbay.HTML.Element
attribute, attribute, attribute, attributes, attributes, bgColor, bottom, center, color, cssClass, cssID, height, height, height, left, middle, right, setAttributesFrom, size, size, style, top, toString, width, width, width, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Pre

public static final java.lang.String Pre
Preformatted text

Quote

public static final java.lang.String Quote
Quoted Text

Center

public static final java.lang.String Center
Center the block

Listing

public static final java.lang.String Listing
Code listing style

Plain

public static final java.lang.String Plain
Plain text

Xmp

public static final java.lang.String Xmp
Old pre format - preserve line breaks

Div

public static final java.lang.String Div
Basic Division

Left

public static final java.lang.String Left
Left align

Right

public static final java.lang.String Right
Right align

Bold

public static final java.lang.String Bold
Bold

Italic

public static final java.lang.String Italic
Italic

Span

public static final java.lang.String Span
Span
Constructor Detail

Block

public Block(java.lang.String tag)
Construct a block using the passed string as the tag
Parameters:
tag - The tag to use to open and close the block.

Block

public Block(java.lang.String tag,
             java.lang.String attributes)
Construct a block using the passed string as the tag
Parameters:
tag - The tag to use to open and close the block.
attributes - String of attributes for opening tag.
Method Detail

write

public void write(java.io.Writer out)
           throws java.io.IOException
Description copied from class: Composite
Write the composite. The default implementation writes the elements sequentially. May be overridden for more specialized behaviour.
Overrides:
write in class Composite
Tags copied from class: Composite
Parameters:
out - Writer to write the element to.