| java.lang.Object org.mortbay.html.Element org.mortbay.html.Composite org.mortbay.html.Page
All known Subclasses: org.mortbay.html.FrameSet,
Page | public class Page extends Composite (Code) | | 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.
See Also: Composite version: $Id: Page.java,v 1.5 2004/09/23 02:15:15 gregwilkins Exp $ author: Greg Wilkins |
RequestResponseHeaderTitleSectionHeaderSizeFooterFooterSizeContentContentSizeMarginMarginSizeLeftMarginLeftMarginSizeRightMarginRightMarginSizeHelpHomeHeadingUpPrevNextBackTargetBaseUrlFgColourBgColourHighlightColourPageTypeNoTitle | final public static String RequestResponseHeaderTitleSectionHeaderSizeFooterFooterSizeContentContentSizeMarginMarginSizeLeftMarginLeftMarginSizeRightMarginRightMarginSizeHelpHomeHeadingUpPrevNextBackTargetBaseUrlFgColourBgColourHighlightColourPageTypeNoTitle(Code) | | |
addHeader | public Page addHeader(Object o)(Code) | | Add element or object to the page header.
Parameters: o - The Object to add. If it is a String or Element, it isadded directly, otherwise toString() is called. This Page (for chained commands) |
addSection | public void addSection(String section, Composite composite)(Code) | | Set a composite as a named section and add it to the.
contents of the page
|
addTo | public void addTo(String section, Object element)(Code) | | Add content to a named sections. If the named section cannot.
be found, the content is added to the page.
|
completeSections | protected void completeSections()(Code) | | 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.
|
frameSet | public FrameSet frameSet()(Code) | | 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
|
properties | public Dictionary properties()(Code) | | Access the page properties. It is up to a derived Page class
to interpret these properties.
|
rewind | public void rewind()(Code) | | |
setBackGroundColor | final public Page setBackGroundColor(String color)(Code) | | Set page background color.
This Page (for chained commands) |
setBackGroundImage | final public Page setBackGroundImage(String bg)(Code) | | Set page background image.
This Page (for chained commands) |
setBase | final public Page setBase(String target, String href)(Code) | | Set the URL Base for the Page.
Parameters: target - Default link target, null if none. Parameters: href - Default absolute href, null if none. This Page (for chained commands) |
setSection | public void setSection(String section, Composite composite)(Code) | | 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.
|
title | public Page title(String title)(Code) | | Set page title.
This Page (for chained commands) |
write | public void write(Writer out) throws IOException(Code) | | Write the entire page by calling:
writeHtmlHead(out)
writeBodyTag(out)
writeElements(out)
writeHtmlEnd(out)
|
write | public void write(Writer out, String section, boolean endHtml) throws IOException(Code) | | 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.
|
writeBodyTag | public void writeBodyTag(Writer out) throws IOException(Code) | | Write HTML page body tag.
Write tags <BODY page attributes>.
|
writeHtmlHead | public void writeHtmlHead(Writer out) throws IOException(Code) | | Write HTML page head tags.
Write tags <HTML><head> .... </head>
|
|
|