|
|||||||||
| Home >> All >> org >> mortbay >> [ html overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.mortbay.html
Class Page

java.lang.Objectorg.mortbay.html.Element
org.mortbay.html.Composite
org.mortbay.html.Page
- Direct Known Subclasses:
- FrameSet
- 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.3 2001/11/08 03:49:03 gregwilkins Exp $
| 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()
|
|
Page(java.lang.String title)
|
|
Page(java.lang.String title,
java.lang.String attributes)
|
|
| Method Summary | |
Page |
addHeader(java.lang.Object o)
Add element or object to the page header. |
void |
addSection(java.lang.String section,
Composite composite)
Set a composite as a named section and add it to the. |
void |
addTo(java.lang.String section,
java.lang.Object element)
Add content to a named sections. |
protected void |
completeSections()
This call back is called just before writeHeaders() actually writes the HTML page headers. |
void |
flush(java.io.Writer out)
|
FrameSet |
frameSet()
Return the preferred FrameSet to be used with a specialized Page. |
Composite |
getSection(java.lang.String section)
Get a composite as a named section. |
java.util.Dictionary |
properties()
Access the page properties. |
void |
rewind()
|
Page |
setBackGroundColor(java.lang.String color)
Set page background color. |
Page |
setBackGroundImage(java.lang.String bg)
Set page background image. |
Page |
setBase(java.lang.String target,
java.lang.String href)
Set the URL Base for the Page. |
void |
setSection(java.lang.String section,
Composite composite)
Set a composite as a named section. |
Page |
title(java.lang.String title)
Set page title. |
void |
write(java.io.Writer out)
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)
Write page section. |
void |
writeBodyTag(java.io.Writer out)
Write HTML page body tag. |
void |
writeElements(java.io.Writer out)
Write any body elements of the page. |
void |
writeHtmlEnd(java.io.Writer out)
Write end BODY and end HTML tags. |
void |
writeHtmlHead(java.io.Writer out)
Write HTML page head tags. |
| Methods inherited from class org.mortbay.html.Composite |
add, contents, flush, flush, 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
- See Also:
- Constant Field Values
Response
public static final java.lang.String Response
- See Also:
- Constant Field Values
Header
public static final java.lang.String Header
- See Also:
- Constant Field Values
Title
public static final java.lang.String Title
- See Also:
- Constant Field Values
Section
public static final java.lang.String Section
- See Also:
- Constant Field Values
HeaderSize
public static final java.lang.String HeaderSize
- See Also:
- Constant Field Values
Footer
public static final java.lang.String Footer
- See Also:
- Constant Field Values
FooterSize
public static final java.lang.String FooterSize
- See Also:
- Constant Field Values
Content
public static final java.lang.String Content
- See Also:
- Constant Field Values
ContentSize
public static final java.lang.String ContentSize
- See Also:
- Constant Field Values
Margin
public static final java.lang.String Margin
- See Also:
- Constant Field Values
MarginSize
public static final java.lang.String MarginSize
- See Also:
- Constant Field Values
LeftMargin
public static final java.lang.String LeftMargin
- See Also:
- Constant Field Values
LeftMarginSize
public static final java.lang.String LeftMarginSize
- See Also:
- Constant Field Values
RightMargin
public static final java.lang.String RightMargin
- See Also:
- Constant Field Values
RightMarginSize
public static final java.lang.String RightMarginSize
- See Also:
- Constant Field Values
Help
public static final java.lang.String Help
- See Also:
- Constant Field Values
Home
public static final java.lang.String Home
- See Also:
- Constant Field Values
Heading
public static final java.lang.String Heading
- See Also:
- Constant Field Values
Up
public static final java.lang.String Up
- See Also:
- Constant Field Values
Prev
public static final java.lang.String Prev
- See Also:
- Constant Field Values
Next
public static final java.lang.String Next
- See Also:
- Constant Field Values
Back
public static final java.lang.String Back
- See Also:
- Constant Field Values
Target
public static final java.lang.String Target
- See Also:
- Constant Field Values
BaseUrl
public static final java.lang.String BaseUrl
- See Also:
- Constant Field Values
FgColour
public static final java.lang.String FgColour
- See Also:
- Constant Field Values
BgColour
public static final java.lang.String BgColour
- See Also:
- Constant Field Values
HighlightColour
public static final java.lang.String HighlightColour
- See Also:
- Constant Field Values
PageType
public static final java.lang.String PageType
- See Also:
- Constant Field Values
NoTitle
public static final java.lang.String NoTitle
- See Also:
- Constant Field Values
properties
protected java.util.Hashtable properties
sections
java.util.Hashtable sections
head
private Composite head
base
private java.lang.String base
writtenHtmlHead
private boolean writtenHtmlHead
writtenBodyTag
private boolean writtenBodyTag
| Constructor Detail |
Page
public Page()
Page
public Page(java.lang.String title)
Page
public Page(java.lang.String title, java.lang.String attributes)
| Method Detail |
title
public Page title(java.lang.String title)
- Set page title.
addHeader
public Page addHeader(java.lang.Object o)
- Add element or object to the page header.
setBackGroundImage
public final Page setBackGroundImage(java.lang.String bg)
- Set page background image.
setBackGroundColor
public final Page setBackGroundColor(java.lang.String color)
- Set page background color.
setBase
public final Page setBase(java.lang.String target, java.lang.String href)
- Set the URL Base for the Page.
write
public void write(java.io.Writer out) throws java.io.IOException
- Write the entire page by calling:
writeHtmlHead(out)
writeBodyTag(out)
writeElements(out)
writeHtmlEnd(out)
writeHtmlHead
public void writeHtmlHead(java.io.Writer out) throws java.io.IOException
- Write HTML page head tags.
Write tags <HTML><head> .... </head>
writeBodyTag
public void writeBodyTag(java.io.Writer out) throws java.io.IOException
- Write HTML page body tag.
Write tags <BODY page attributes>.
writeHtmlEnd
public void writeHtmlEnd(java.io.Writer out) throws java.io.IOException
- Write end BODY and end HTML tags.
writeElements
public void writeElements(java.io.Writer out) throws java.io.IOException
- Write any body elements of the page.
write
public void write(java.io.Writer out, java.lang.String section, boolean endHtml) throws java.io.IOException
- 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.
flush
public void flush(java.io.Writer out) throws java.io.IOException
rewind
public void rewind()
properties
public java.util.Dictionary properties()
- Access the page properties. It is up to a derived Page class
to interpret these properties.
frameSet
public FrameSet frameSet()
- 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)
- 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)
- Set a composite as a named section and add it to the.
contents of the page
getSection
public Composite getSection(java.lang.String section)
- Get a composite as a named section.
addTo
public void addTo(java.lang.String section, java.lang.Object element)
- Add content to a named sections. If the named section cannot.
be found, the content is added to the page.
completeSections
protected void completeSections()
- 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.
|
|||||||||
| Home >> All >> org >> mortbay >> [ html overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC