|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.html.Element | +--org.mortbay.html.Composite | +--org.mortbay.html.Page
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.
Composite
Field Summary | |
static java.lang.String |
Back
|
static java.lang.String |
BaseUrl
|
static java.lang.String |
BgColour
|
static java.lang.String |
Content
|
static java.lang.String |
ContentSize
|
static java.lang.String |
FgColour
|
static java.lang.String |
Footer
|
static java.lang.String |
FooterSize
|
static java.lang.String |
Header
|
static java.lang.String |
HeaderSize
|
static java.lang.String |
Heading
|
static java.lang.String |
Help
|
static java.lang.String |
HighlightColour
|
static java.lang.String |
Home
|
static java.lang.String |
LeftMargin
|
static java.lang.String |
LeftMarginSize
|
static java.lang.String |
Margin
|
static java.lang.String |
MarginSize
|
static java.lang.String |
Next
|
static java.lang.String |
NoTitle
|
static java.lang.String |
PageType
|
static java.lang.String |
Prev
|
static java.lang.String |
Request
|
static java.lang.String |
Response
|
static java.lang.String |
RightMargin
|
static java.lang.String |
RightMarginSize
|
static java.lang.String |
Section
|
static java.lang.String |
Target
|
static java.lang.String |
Title
|
static java.lang.String |
Up
|
Fields inherited from class org.mortbay.html.Element |
ALIGN, 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. |
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, 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String Request
public static final java.lang.String Response
public static final java.lang.String Header
public static final java.lang.String Title
public static final java.lang.String Section
public static final java.lang.String HeaderSize
public static final java.lang.String Footer
public static final java.lang.String FooterSize
public static final java.lang.String Content
public static final java.lang.String ContentSize
public static final java.lang.String Margin
public static final java.lang.String MarginSize
public static final java.lang.String LeftMargin
public static final java.lang.String LeftMarginSize
public static final java.lang.String RightMargin
public static final java.lang.String RightMarginSize
public static final java.lang.String Help
public static final java.lang.String Home
public static final java.lang.String Heading
public static final java.lang.String Up
public static final java.lang.String Prev
public static final java.lang.String Next
public static final java.lang.String Back
public static final java.lang.String Target
public static final java.lang.String BaseUrl
public static final java.lang.String FgColour
public static final java.lang.String BgColour
public static final java.lang.String HighlightColour
public static final java.lang.String PageType
public static final java.lang.String NoTitle
Constructor Detail |
public Page()
public Page(java.lang.String title)
public Page(java.lang.String title, java.lang.String attributes)
Method Detail |
public Page title(java.lang.String title)
public Page addHeader(java.lang.Object o)
o
- The Object to add. If it is a String or Element, it is
added directly, otherwise toString() is called.
public final Page setBackGroundImage(java.lang.String bg)
public final Page setBackGroundColor(java.lang.String color)
public final Page setBase(java.lang.String target, java.lang.String href)
target
- Default link target, null if none.href
- Default absolute href, null if none.
public void write(java.io.Writer out) throws java.io.IOException
write
in class Composite
out
- Writer to write the element to.
java.io.IOException
public void writeHtmlHead(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void writeBodyTag(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void writeHtmlEnd(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void writeElements(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void write(java.io.Writer out, java.lang.String section, boolean endHtml) throws java.io.IOException
java.io.IOException
public void flush(java.io.Writer out) throws java.io.IOException
flush
in class Composite
java.io.IOException
public void rewind()
public java.util.Dictionary properties()
public FrameSet frameSet()
public void setSection(java.lang.String section, Composite composite)
public void addSection(java.lang.String section, Composite composite)
public Composite getSection(java.lang.String section)
public void addTo(java.lang.String section, java.lang.Object element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |