|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mortbay.HTML.Element | +--com.mortbay.HTML.Composite | +--com.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.
PageFactory classes can be statically registered with the Page class and these are used to instantiate Pages in the getPage method.
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 |
FileBase
|
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
|
protected java.util.Hashtable |
properties
|
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 com.mortbay.HTML.Composite |
elements,
nest |
Fields inherited from class com.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 |
static void |
addPageFactory(PageFactory f)
Add a PageFactory to the static factory list. |
void |
addSection(java.lang.String section,
Composite composite)
Set a composite as a named section and add it to the contents of the page |
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. |
static void |
delPageFactory(PageFactory f)
Delete a PageFactory from the static factory list. |
void |
flush(java.io.Writer out)
|
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. |
static java.lang.String |
getDefaultPageType()
Get default Page The default Page is set per JVM |
static Page |
getPage(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Get a new Page instance from a Page factory by calling manufacturePage(). |
Composite |
getSection(java.lang.String section)
Get a composite as a named section. |
static Page |
manufacturePage(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Get a new Page instance from a Page factory by a named Page specialization of Page. |
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 |
static void |
setDefaultPageType(java.lang.String name)
set default Page The default Page is set per JVM |
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 The page is written containing only the named section. |
void |
writeBodyTag(java.io.Writer out)
Write HTML page body tag Write tags <BODY page attributes>. |
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 Write tags <HTML><HEAD> .... |
Methods inherited from class com.mortbay.HTML.Composite |
add,
contents,
nest,
replace,
reset,
setNest,
size,
unnest |
Methods inherited from class com.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 |
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 FileBase
public static final java.lang.String PageType
public static final java.lang.String NoTitle
protected java.util.Hashtable properties
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
out
- Writer to write the element to.public void writeHtmlHead(java.io.Writer out) throws java.io.IOException
public void writeBodyTag(java.io.Writer out) throws java.io.IOException
public void writeHtmlEnd(java.io.Writer out) throws java.io.IOException
public void writeElements(java.io.Writer out) throws java.io.IOException
public void write(java.io.Writer out, java.lang.String section, boolean endHtml) throws java.io.IOException
public void flush(java.io.Writer out) throws 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)
protected void completeSections()
public static void addPageFactory(PageFactory f)
public static void delPageFactory(PageFactory f)
public static Page manufacturePage(java.lang.String name, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassCastException
name
- The name of the page to pass to any
registered PageFactories, otherwise the
class name.request
- The request that this page is being created
for. The request can be used to select or tailor the
that page and it is also placed in the pages
Request property.public static Page getPage(java.lang.String name, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
name
- The name of the page to pass to any
registered PageFactories, otherwise the
class name.request
- The request that this page is being created
for. The request can be used to select or tailor the
that page and it is also placed in the pages
Request property.public static java.lang.String getDefaultPageType()
public static void setDefaultPageType(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |