org.apache.tapestry.internal.services
Interface DocumentHeadBuilder

All Known Implementing Classes:
DocumentHeadBuilderImpl

public interface DocumentHeadBuilder

Responsible for injecting script and style links into the <head> element of the rendered HTML document.


Method Summary
 void addScript(String script)
          Adds JavaScript code.
 void addScriptLink(String scriptURL)
          Adds a link to load a script.
 void addStylesheetLink(String styleURL, String media)
          Adds a link to load a CSS stylesheet.
 void updateDocument(Document document)
          Updates the supplied Document, locating the html/body element and adding script links (to the top) and a script block (to the end).
 

Method Detail

addScriptLink

void addScriptLink(String scriptURL)
Adds a link to load a script. Scripts will be loaded only once.


addStylesheetLink

void addStylesheetLink(String styleURL,
                       String media)
Adds a link to load a CSS stylesheet. Stylesheets are loaded only once.

Parameters:
styleURL - URL of stylesheet to load
media - media value (or null to omit the media attribute)

addScript

void addScript(String script)
Adds JavaScript code. The code is collected into a single block that is injected just before the close body tag of the page.

Parameters:
script - statement to add to the block (a newline will be appended as well)

updateDocument

void updateDocument(Document document)
Updates the supplied Document, locating the html/body element and adding script links (to the top) and a script block (to the end).

Parameters:
document - to be updated


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.