|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.util.template.TemplatePageAttributes
Template context tool that will set various attributes of the HTML page. It is automatically placed in the Template context as '$page'. Here's an example of some uses:
$page.setBgColor("#ffffff"); $page.setBgColor("white"); $page.setBackground("/images/standardbg.jpeg"); $page.setTitle("This is the title!"); $page.setKeywords("turbine, cool, servlet framework"); $page.setStyleSheet("/style.css");
Field Summary | |
private java.lang.String |
cachedTitle
The title. |
private RunData |
data
The RunData object. |
Constructor Summary | |
TemplatePageAttributes()
Default constructor. |
|
TemplatePageAttributes(RunData data)
Construct a new instance with the given RunData object. |
Method Summary | |
TemplatePageAttributes |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute to the BODY tag. |
java.lang.String |
getTitle()
Get the title in the page. |
void |
init(java.lang.Object data)
Initialise this instance with the given RunData object. |
void |
refresh()
Refresh method - does nothing |
TemplatePageAttributes |
setBackground(java.lang.String url)
Set the background image for the BODY tag. |
TemplatePageAttributes |
setBgColor(java.lang.String color)
Set the background color for the BODY tag. |
TemplatePageAttributes |
setDescription(java.lang.String description)
Add a description META tag to the HEAD of the page. |
TemplatePageAttributes |
setHttpEquiv(java.lang.String httpEquiv,
java.lang.String content)
Sets a HttpEquiv META tag in the HEAD of the page, usage: setHttpEquiv("refresh", "5; http://localhost/nextpage.html")
setHttpEquiv("Expires", "Tue, 20 Aug 1996 14:25:27 GMT") |
TemplatePageAttributes |
setKeywords(java.lang.String keywords)
Set a keywords META tag in the HEAD of the page. |
TemplatePageAttributes |
setLinkColor(java.lang.String color)
Set the link color for the BODY tag. |
TemplatePageAttributes |
setStyleSheet(java.lang.String url)
Adds a LINK to a CSS styleshet to the HEAD of the page. |
TemplatePageAttributes |
setTextColor(java.lang.String color)
Set the text color for the BODY tag. |
TemplatePageAttributes |
setTitle(java.lang.String intitle)
Set the title in the page. |
TemplatePageAttributes |
setVlinkColor(java.lang.String color)
Set the visited link color for the BODY tag. |
java.lang.String |
toString()
A dummy toString method that returns an empty string. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private RunData data
private java.lang.String cachedTitle
Constructor Detail |
public TemplatePageAttributes()
public TemplatePageAttributes(RunData data)
data
- a RunData instanceMethod Detail |
public void init(java.lang.Object data)
init
in interface ApplicationTool
data
- Assumed to be a RunData instancepublic void refresh()
refresh
in interface ApplicationTool
public TemplatePageAttributes setTitle(java.lang.String intitle)
intitle
- A String with the title.public java.lang.String getTitle()
public TemplatePageAttributes setStyleSheet(java.lang.String url)
url
- A String.public TemplatePageAttributes setKeywords(java.lang.String keywords)
keywords
- A String.public TemplatePageAttributes setHttpEquiv(java.lang.String httpEquiv, java.lang.String content)
setHttpEquiv("refresh", "5; http://localhost/nextpage.html")
setHttpEquiv("Expires", "Tue, 20 Aug 1996 14:25:27 GMT")
httpEquiv
- The value to use for the http-equiv attribute.content
- The text for the content attribute of the meta tag.public TemplatePageAttributes setDescription(java.lang.String description)
description
- A String.public TemplatePageAttributes setBackground(java.lang.String url)
url
- A String.public TemplatePageAttributes setBgColor(java.lang.String color)
color
- A String.public TemplatePageAttributes setTextColor(java.lang.String color)
color
- A String.public TemplatePageAttributes setLinkColor(java.lang.String color)
color
- A String.public TemplatePageAttributes setVlinkColor(java.lang.String color)
color
- A String.public TemplatePageAttributes addAttribute(java.lang.String name, java.lang.String value)
name
- A String.value
- A String.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |