org.mortbay.html
Class Block

java.lang.Object
  extended by org.mortbay.html.Element
      extended by org.mortbay.html.Composite
          extended by org.mortbay.html.Block
Direct Known Subclasses:
Applet, Font, Form, Heading, Link, List, Script, Select, Style, Table, Target, 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 String Bold
          Bold
static String Center
          Center the block
static String Div
          Basic Division
static String Italic
          Italic
static String Left
          Left align
static String Listing
          Code listing style
static String Plain
          Plain text
static String Pre
          Preformatted text
static String Quote
          Quoted Text
static String Right
          Right align
static String Span
          Span
static String Xmp
          Old pre format - preserve line breaks
 
Fields inherited from class org.mortbay.html.Composite
elements, nest
 
Fields inherited from class org.mortbay.html.Element
ALIGN, attributeMap, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, noAttributes, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH
 
Constructor Summary
Block(String tag)
          Construct a block using the passed string as the tag.
Block(String tag, String attributes)
          Construct a block using the passed string as the tag.
 
Method Summary
 void write(Writer out)
          Write the composite.
 
Methods inherited from class org.mortbay.html.Composite
add, contents, nest, replace, reset, setNest, size, unnest
 
Methods inherited from class org.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 String Pre
Preformatted text

See Also:
Constant Field Values

Quote

public static final String Quote
Quoted Text

See Also:
Constant Field Values

Center

public static final String Center
Center the block

See Also:
Constant Field Values

Listing

public static final String Listing
Code listing style

See Also:
Constant Field Values

Plain

public static final String Plain
Plain text

See Also:
Constant Field Values

Xmp

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

See Also:
Constant Field Values

Div

public static final String Div
Basic Division

See Also:
Constant Field Values

Left

public static final String Left
Left align

See Also:
Constant Field Values

Right

public static final String Right
Right align

See Also:
Constant Field Values

Bold

public static final String Bold
Bold

See Also:
Constant Field Values

Italic

public static final String Italic
Italic

See Also:
Constant Field Values

Span

public static final String Span
Span

See Also:
Constant Field Values
Constructor Detail

Block

public Block(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(String tag,
             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(Writer out)
           throws 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
Parameters:
out - Writer to write the element to.
Throws:
IOException


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.