Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.html
Class Page

    java.lang.Object
      org.mortbay.html.Element
          org.mortbay.html.Composite
              org.mortbay.html.Page

Direct Known Subclasses:
  FrameSet

Deprecated. Unless somebody steps forward to update and maintain this package

    public class Page

extends Composite

HTML Page. A HTML Page extends composite with the addition of the HTML Header tags, fields and elements. Furthermore, individual parts of the page may be written or the progressive page be output with flush.

Pages contain parameters and named sections. These are used by derived Page classes that implement a Look and Feel. Page users may add to name sections such as "Margin" or "Footer" and set parameters such as "HelpUrl" without knowledge of how the look and feel will arrange these. To assist with standard look and feel creation Page defines a set of standard names for many common parameters and sections.

If named sections are used, the page constructor or completeSections must add the named section to the page in the appropriate places. If named sections are not added to the page, then they can only be written with an explicit call to write(out,"section",end); Changes in behaviour to section creation and adding, should be controlled via page properties.

Version:
  $Id: Page.java,v 1.5 2004/09/23 02:15:15 gregwilkins Exp $
Author:
  Greg Wilkins
See Also:
  `Composite`

Field Summary
`static java.lang.String` | `Back` Deprecated.
`static java.lang.String` | `BaseUrl` Deprecated.
`static java.lang.String` | `BgColour` Deprecated.
`static java.lang.String` | `Content` Deprecated.
`static java.lang.String` | `ContentSize` Deprecated.
`static java.lang.String` | `FgColour` Deprecated.
`static java.lang.String` | `Footer` Deprecated.
`static java.lang.String` | `FooterSize` Deprecated.
`static java.lang.String` | `Header` Deprecated.
`static java.lang.String` | `HeaderSize` Deprecated.
`static java.lang.String` | `Heading` Deprecated.
`static java.lang.String` | `Help` Deprecated.
`static java.lang.String` | `HighlightColour` Deprecated.
`static java.lang.String` | `Home` Deprecated.
`static java.lang.String` | `LeftMargin` Deprecated.
`static java.lang.String` | `LeftMarginSize` Deprecated.
`static java.lang.String` | `Margin` Deprecated.
`static java.lang.String` | `MarginSize` Deprecated.
`static java.lang.String` | `Next` Deprecated.
`static java.lang.String` | `NoTitle` Deprecated.
`static java.lang.String` | `PageType` Deprecated.
`static java.lang.String` | `Prev` Deprecated.
`protected java.util.Hashtable` | `properties` Deprecated.
`static java.lang.String` | `Request` Deprecated.
`static java.lang.String` | `Response` Deprecated.
`static java.lang.String` | `RightMargin` Deprecated.
`static java.lang.String` | `RightMarginSize` Deprecated.
`static java.lang.String` | `Section` Deprecated.
`static java.lang.String` | `Target` Deprecated.
`static java.lang.String` | `Title` Deprecated.
`static java.lang.String` | `Up` Deprecated.

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
`Page()` Deprecated.
`Page(java.lang.String title)` Deprecated.
`Page(java.lang.String title, java.lang.String attributes)` Deprecated.

Method Summary
`Page` | `addHeader(java.lang.Object o)` Deprecated. Add element or object to the page header.
`void` | `addSection(java.lang.String section, Composite composite)` Deprecated. Set a composite as a named section and add it to the.
`void` | `addTo(java.lang.String section, java.lang.Object element)` Deprecated. Add content to a named sections.
`protected void` | `completeSections()` Deprecated. This call back is called just before writeHeaders() actually writes the HTML page headers.
`void` | `flush(java.io.Writer out)` Deprecated.
`FrameSet` | `frameSet()` Deprecated. Return the preferred FrameSet to be used with a specialized Page.
`Composite` | `getSection(java.lang.String section)` Deprecated. Get a composite as a named section.
`java.util.Dictionary` | `properties()` Deprecated. Access the page properties.
`void` | `rewind()` Deprecated.
`Page` | `setBackGroundColor(java.lang.String color)` Deprecated. Set page background color.
`Page` | `setBackGroundImage(java.lang.String bg)` Deprecated. Set page background image.
`Page` | `setBase(java.lang.String target, java.lang.String href)` Deprecated. Set the URL Base for the Page.
`void` | `setSection(java.lang.String section, Composite composite)` Deprecated. Set a composite as a named section.
`Page` | `title(java.lang.String title)` Deprecated. Set page title.
`void` | `write(java.io.Writer out)` Deprecated. Write the entire page by calling: writeHtmlHead(out) writeBodyTag(out) writeElements(out) writeHtmlEnd(out)
`void` | `write(java.io.Writer out, java.lang.String section, boolean endHtml)` Deprecated. Write page section.
`void` | `writeBodyTag(java.io.Writer out)` Deprecated. Write HTML page body tag.
`void` | `writeElements(java.io.Writer out)` Deprecated. Write any body elements of the page.
`void` | `writeHtmlEnd(java.io.Writer out)` Deprecated. Write end BODY and end HTML tags.
`void` | `writeHtmlHead(java.io.Writer out)` Deprecated. Write HTML page head tags.

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

### Request

    public static final java.lang.String Request

  Deprecated.
  See Also:
    Constant Field Values

### Response

    public static final java.lang.String Response

  Deprecated.
  See Also:
    Constant Field Values

### Header

    public static final java.lang.String Header

  Deprecated.
  See Also:
    Constant Field Values

### Title

    public static final java.lang.String Title

  Deprecated.
  See Also:
    Constant Field Values

### Section

    public static final java.lang.String Section

  Deprecated.
  See Also:
    Constant Field Values

### HeaderSize

    public static final java.lang.String HeaderSize

  Deprecated.
  See Also:
    Constant Field Values

### Footer

    public static final java.lang.String Footer

  Deprecated.
  See Also:
    Constant Field Values

### FooterSize

    public static final java.lang.String FooterSize

  Deprecated.
  See Also:
    Constant Field Values

### Content

    public static final java.lang.String Content

  Deprecated.
  See Also:
    Constant Field Values

### ContentSize

    public static final java.lang.String ContentSize

  Deprecated.
  See Also:
    Constant Field Values

### Margin

    public static final java.lang.String Margin

  Deprecated.
  See Also:
    Constant Field Values

### MarginSize

    public static final java.lang.String MarginSize

  Deprecated.
  See Also:
    Constant Field Values

### LeftMargin

    public static final java.lang.String LeftMargin

  Deprecated.
  See Also:
    Constant Field Values

### LeftMarginSize

    public static final java.lang.String LeftMarginSize

  Deprecated.
  See Also:
    Constant Field Values

### RightMargin

    public static final java.lang.String RightMargin

  Deprecated.
  See Also:
    Constant Field Values

### RightMarginSize

    public static final java.lang.String RightMarginSize

  Deprecated.
  See Also:
    Constant Field Values

### Help

    public static final java.lang.String Help

  Deprecated.
  See Also:
    Constant Field Values

### Home

    public static final java.lang.String Home

  Deprecated.
  See Also:
    Constant Field Values

### Heading

    public static final java.lang.String Heading

  Deprecated.
  See Also:
    Constant Field Values

### Up

    public static final java.lang.String Up

  Deprecated.
  See Also:
    Constant Field Values

### Prev

    public static final java.lang.String Prev

  Deprecated.
  See Also:
    Constant Field Values

### Next

    public static final java.lang.String Next

  Deprecated.
  See Also:
    Constant Field Values

### Back

    public static final java.lang.String Back

  Deprecated.
  See Also:
    Constant Field Values

### Target

    public static final java.lang.String Target

  Deprecated.
  See Also:
    Constant Field Values

### BaseUrl

    public static final java.lang.String BaseUrl

  Deprecated.
  See Also:
    Constant Field Values

### FgColour

    public static final java.lang.String FgColour

  Deprecated.
  See Also:
    Constant Field Values

### BgColour

    public static final java.lang.String BgColour

  Deprecated.
  See Also:
    Constant Field Values

### HighlightColour

    public static final java.lang.String HighlightColour

  Deprecated.
  See Also:
    Constant Field Values

### PageType

    public static final java.lang.String PageType

  Deprecated.
  See Also:
    Constant Field Values

### NoTitle

    public static final java.lang.String NoTitle

  Deprecated.
  See Also:
    Constant Field Values

### properties

    protected java.util.Hashtable properties

  Deprecated.

Constructor Detail

### Page

    public Page()

  Deprecated.

### Page

    public Page(java.lang.String title)

  Deprecated.

### Page

    public Page(java.lang.String title,
                java.lang.String attributes)

  Deprecated.

Method Detail

### title

    public Page title(java.lang.String title)

  Deprecated.
  Set page title.

  Returns:
    This Page (for chained commands)

### addHeader

    public Page addHeader(java.lang.Object o)

  Deprecated.
  Add element or object to the page header.

  Parameters:
    `o` - The Object to add. If it is a String or Element, it is added directly, otherwise toString() is called.
  Returns:
    This Page (for chained commands)

### setBackGroundImage

    public final Page setBackGroundImage(java.lang.String bg)

  Deprecated.
  Set page background image.

  Returns:
    This Page (for chained commands)

### setBackGroundColor

    public final Page setBackGroundColor(java.lang.String color)

  Deprecated.
  Set page background color.

  Returns:
    This Page (for chained commands)

### setBase

    public final Page setBase(java.lang.String target,
                              java.lang.String href)

  Deprecated.
  Set the URL Base for the Page.

  Parameters:
    `target` - Default link target, null if none.
    `href` - Default absolute href, null if none.
  Returns:
    This Page (for chained commands)

### write

    public void write(java.io.Writer out)
               throws java.io.IOException

  Deprecated.
  Write the entire page by calling:
  writeHtmlHead(out)
  writeBodyTag(out)
  writeElements(out)
  writeHtmlEnd(out)

  Overrides:
    `write` in class `Composite`
  Parameters:
    `out` - Writer to write the element to.
  Throws:
    `java.io.IOException`

### writeHtmlHead

    public void writeHtmlHead(java.io.Writer out)
                       throws java.io.IOException

  Deprecated.
  Write HTML page head tags. Write tags <HTML><head> .... </head>

  Throws:
    `java.io.IOException`

### writeBodyTag

    public void writeBodyTag(java.io.Writer out)
                      throws java.io.IOException

  Deprecated.
  Write HTML page body tag. Write tags <BODY page attributes>.

  Throws:
    `java.io.IOException`

### writeHtmlEnd

    public void writeHtmlEnd(java.io.Writer out)
                      throws java.io.IOException

  Deprecated.
  Write end BODY and end HTML tags.

  Throws:
    `java.io.IOException`

### writeElements

    public void writeElements(java.io.Writer out)
                       throws java.io.IOException

  Deprecated.
  Write any body elements of the page.

  Throws:
    `java.io.IOException`

### write

    public void write(java.io.Writer out,
                      java.lang.String section,
                      boolean endHtml)
               throws java.io.IOException

  Deprecated.
  Write page section. The page is written containing only the named section. If a head and bodyTag have not been written, then they are written before the section. If endHtml is true, the end HTML tag is also written. If the named section is Content and it cannot be found, then the normal page contents are written.

  Throws:
    `java.io.IOException`

### flush

    public void flush(java.io.Writer out)
               throws java.io.IOException

  Deprecated.
  Throws:
    `java.io.IOException`

### rewind

    public void rewind()

  Deprecated.

### properties

    public java.util.Dictionary properties()

  Deprecated.
  Access the page properties. It is up to a derived Page class to interpret these properties.

### frameSet

    public FrameSet frameSet()

  Deprecated.
  Return the preferred FrameSet to be used with a specialized Page. The Frames will be named after the sections they are to contain. The default implementation returns null

### setSection

    public void setSection(java.lang.String section,
                           Composite composite)

  Deprecated.
  Set a composite as a named section. Other Page users may. add to the section by calling addTo(). It is up to the section creator to add the section to the page in it appropriate position.

### addSection

    public void addSection(java.lang.String section,
                           Composite composite)

  Deprecated.
  Set a composite as a named section and add it to the. contents of the page

### getSection

    public Composite getSection(java.lang.String section)

  Deprecated.
  Get a composite as a named section.

### addTo

    public void addTo(java.lang.String section,
                      java.lang.Object element)

  Deprecated.
  Add content to a named sections. If the named section cannot. be found, the content is added to the page.

### completeSections

    protected void completeSections()

  Deprecated.
  This call back is called just before writeHeaders() actually writes the HTML page headers. It can be implemented by a derived Page class to complete a named section after the rest of the Page has been created and appropriate properties set.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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