org.codehaus.plexus.summit.pull.tools
Class TemplatePageAttributes

java.lang.Object
  extended byorg.codehaus.plexus.summit.pull.tools.TemplatePageAttributes
All Implemented Interfaces:
RequestTool

public class TemplatePageAttributes
extends java.lang.Object
implements RequestTool

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");

This should become a general attribute storage class for a page. We should have something general like:

$page.setAttr("bgcolor", "#ffffff")

Instead of set methods for HTML because we might want to set attributes for WML output or anything else.

Version:
$Id: TemplatePageAttributes.java 2082 2005-06-05 02:58:52Z jvanzyl $
Author:
Sean Legassick

Field Summary
private  java.util.Map attributes
           
private  RunData data
           
private  java.lang.String title
           
 
Constructor Summary
TemplatePageAttributes()
           
 
Method Summary
 java.util.Map getAttributes()
           
 java.lang.String getTitle()
           
 void refresh()
          Refresh the application tool.
 TemplatePageAttributes setAttribute(java.lang.String key, java.lang.String value)
           
 void setRunData(RunData data)
          Initialize the RequestTool with RunData from the request.
 TemplatePageAttributes setTitle(java.lang.String title)
           
 java.lang.String toString()
          A dummy toString method that returns an empty string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

private RunData data

title

private java.lang.String title

attributes

private java.util.Map attributes
Constructor Detail

TemplatePageAttributes

public TemplatePageAttributes()
Method Detail

setRunData

public void setRunData(RunData data)
Description copied from interface: RequestTool
Initialize the RequestTool with RunData from the request.

Specified by:
setRunData in interface RequestTool
Parameters:
data - initialization data

refresh

public void refresh()
Description copied from interface: RequestTool
Refresh the application tool. This is necessary for development work where you probably want the tool to refresh itself if it is using configuration information that is typically cached after initialization

Specified by:
refresh in interface RequestTool

setAttribute

public TemplatePageAttributes setAttribute(java.lang.String key,
                                           java.lang.String value)

getAttributes

public java.util.Map getAttributes()

setTitle

public TemplatePageAttributes setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

toString

public java.lang.String toString()
A dummy toString method that returns an empty string.

Returns:
An empty String ("").