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.
Composite
Modifier and Type | Field and Description |
---|---|
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 |
static String |
PageType |
static String |
Prev |
protected Hashtable |
properties |
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 and Description |
---|
Page() |
Page(String title) |
Page(String title,
String attributes) |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
add, contents, nest, replace, reset, setNest, size, unnest
public static final String Request
public static final String Response
public static final String Header
public static final String Title
public static final String Section
public static final String HeaderSize
public static final String Footer
public static final String FooterSize
public static final String Content
public static final String ContentSize
public static final String Margin
public static final String MarginSize
public static final String LeftMargin
public static final String LeftMarginSize
public static final String RightMargin
public static final String RightMarginSize
public static final String Help
public static final String Home
public static final String Heading
public static final String Up
public static final String Prev
public static final String Next
public static final String Back
public static final String Target
public static final String BaseUrl
public static final String FgColour
public static final String BgColour
public static final String HighlightColour
public static final String PageType
public static final String NoTitle
protected Hashtable properties
public Page()
public Page(String title)
public Page addHeader(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(String bg)
public final Page setBackGroundColor(String color)
public final Page setBase(String target, String href)
target
- Default link target, null if none.href
- Default absolute href, null if none.public void write(Writer out) throws IOException
write
in class Composite
out
- Writer to write the element to.IOException
public void writeHtmlHead(Writer out) throws IOException
IOException
public void writeBodyTag(Writer out) throws IOException
IOException
public void writeHtmlEnd(Writer out) throws IOException
IOException
public void writeElements(Writer out) throws IOException
IOException
public void write(Writer out, String section, boolean endHtml) throws IOException
IOException
public void flush(Writer out) throws IOException
IOException
public void rewind()
public Dictionary properties()
public FrameSet frameSet()
public void setSection(String section, Composite composite)
public void addSection(String section, Composite composite)
public void addTo(String section, Object element)
protected void completeSections()
Copyright © 2013. All Rights Reserved.