org.mortbay.html
public class Page extends Composite
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 $
See Also: Composite
Field Summary | |
---|---|
static String | Back |
static String | BaseUrl |
static String | BgColour |
static String | Content |
static String | ContentSize |
static String | FgColour |
static String | Footer |
static String | FooterSize |
static String | Header |
static String | HeaderSize |
static String | Heading |
static String | Help |
static String | HighlightColour |
static String | Home |
static String | LeftMargin |
static String | LeftMarginSize |
static String | Margin |
static String | MarginSize |
static String | Next |
static String | NoTitle |
protected Hashtable | properties |
static String | PageType |
static String | Prev |
static String | Request |
static String | Response |
static String | RightMargin |
static String | RightMarginSize |
static String | Section |
static String | Target |
static String | Title |
static String | Up |
Constructor Summary | |
---|---|
Page() | |
Page(String title) | |
Page(String title, String attributes) |
Method Summary | |
---|---|
Page | addHeader(Object o) Add element or object to the page header. |
void | addSection(String section, Composite composite) Set a composite as a named section and add it to the.
contents of the page |
void | addTo(String section, 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(Writer out) |
FrameSet | frameSet() Return the preferred FrameSet to be used with a specialized Page.
|
Composite | getSection(String section) Get a composite as a named section. |
Dictionary | properties() Access the page properties. |
void | rewind() |
Page | setBackGroundColor(String color) Set page background color. |
Page | setBackGroundImage(String bg) Set page background image. |
Page | setBase(String target, String href) Set the URL Base for the Page. |
void | setSection(String section, Composite composite) Set a composite as a named section. |
Page | title(String title) Set page title. |
void | write(Writer out) Write the entire page by calling: writeHtmlHead(out) writeBodyTag(out) writeElements(out) writeHtmlEnd(out) |
void | write(Writer out, String section, boolean endHtml) Write page section.
|
void | writeBodyTag(Writer out) Write HTML page body tag.
|
void | writeElements(Writer out) Write any body elements of the page. |
void | writeHtmlEnd(Writer out) Write end BODY and end HTML tags. |
void | writeHtmlHead(Writer out) Write HTML page head tags.
|
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)
Returns: This Page (for chained commands)
Returns: This Page (for chained commands)
Parameters: target Default link target, null if none. href Default absolute href, null if none.
Returns: This Page (for chained commands)
Returns: This Page (for chained commands)