|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.internal.services.DocumentLinkerImpl
public class DocumentLinkerImpl
Constructor Summary | |
---|---|
DocumentLinkerImpl(boolean omitGeneratorMetaTag,
String tapestryVersion,
boolean compactJSON)
|
Method Summary | |
---|---|
protected void |
addDynamicScriptBlock(Element body)
Adds the dynamic script block, which is, ultimately, a call to the client-side Tapestry.onDOMLoaded() function. |
void |
addScript(InitializationPriority priority,
String script)
Adds JavaScript code. |
void |
addScriptLink(String scriptURL)
Adds a link to load a JavaScript library. |
protected void |
addScriptLinksForIncludedScripts(Element headElement,
List<String> scripts)
Adds a script link for each included script to the top of the the <head> element. |
void |
addStylesheetLink(StylesheetLink sheet)
Adds a link to load a CSS stylesheet. |
protected void |
addStylesheetsToHead(Element root,
List<StylesheetLink> stylesheets)
Locates the head element under the root ("html") element, creating it if necessary, and adds the stylesheets to it. |
void |
setInitialization(InitializationPriority priority,
JSONObject initialization)
Adds a call to the Tapestry.init() function. |
void |
updateDocument(Document document)
Updates the supplied Document, possibly adding <head> or <body> elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentLinkerImpl(boolean omitGeneratorMetaTag, String tapestryVersion, boolean compactJSON)
omitGeneratorMetaTag
- via symbol configurationtapestryVersion
- version of Tapestry framework (for meta tag)compactJSON
- should JSON content be compact or pretty printed?Method Detail |
---|
public void addStylesheetLink(StylesheetLink sheet)
DocumentLinker
addStylesheetLink
in interface DocumentLinker
public void addScriptLink(String scriptURL)
DocumentLinker
addScriptLink
in interface DocumentLinker
public void addScript(InitializationPriority priority, String script)
DocumentLinker
This method may be called multiple times for the same priority and the script will be accumulated.
addScript
in interface DocumentLinker
priority
- when to execute the provided scriptscript
- statement to add to the block (a newline will be appended as well)public void setInitialization(InitializationPriority priority, JSONObject initialization)
DocumentLinker
This method should only be invoked at most once per priority.
setInitialization
in interface DocumentLinker
public void updateDocument(Document document)
document
- to be updatedprotected void addDynamicScriptBlock(Element body)
body
- element to add the dynamic scripting toprotected void addScriptLinksForIncludedScripts(Element headElement, List<String> scripts)
<head>
element.
The new elements are inserted just before the first <script>
tag, or appended at
the end.
headElement
- element to add the script links toscripts
- scripts URLs to add as <script>
elementsprotected void addStylesheetsToHead(Element root, List<StylesheetLink> stylesheets)
root
- element of documentstylesheets
- to add to the document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |