public class DocumentLinkerImpl extends Object implements DocumentLinker
Constructor and Description |
---|
DocumentLinkerImpl(ModuleManager moduleManager,
boolean omitGeneratorMetaTag,
boolean enablePageloadingMask,
String tapestryVersion) |
Modifier and Type | Method and Description |
---|---|
protected void |
addContentToBody(Element body)
Adds
<script> elements for the RequireJS library, then any statically includes JavaScript libraries
(including JavaScript stack virtual assets), then the initialization script block. |
void |
addCoreLibrary(String libraryURL)
A special case used only for the libraries that are part of the core stack, which itself contains RequireJS
and is used to bootstrap up to adding non-core libraries.
|
void |
addInitialization(InitializationPriority priority,
String moduleName,
String functionName,
JSONArray arguments)
Adds initialization, based on invoking functions exported by JavaScript modules.
|
void |
addLibrary(String libraryURL)
Adds a link to load a non-core JavaScript library.
|
void |
addModuleConfigurationCallback(ModuleConfigurationCallback callback)
Adds a module configuration callback for this request.
|
void |
addScript(InitializationPriority priority,
String script)
Adds JavaScript code.
|
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 |
updateDocument(Document document)
Updates the supplied Document, possibly adding <head> or <body> elements.
|
public DocumentLinkerImpl(ModuleManager moduleManager, boolean omitGeneratorMetaTag, boolean enablePageloadingMask, String tapestryVersion)
moduleManager
- used to identify the root folder for dynamically loaded modulesomitGeneratorMetaTag
- via symbol configurationenablePageloadingMask
- tapestryVersion
- public void addStylesheetLink(StylesheetLink sheet)
DocumentLinker
addStylesheetLink
in interface DocumentLinker
public void addCoreLibrary(String libraryURL)
DocumentLinker
addCoreLibrary
in interface DocumentLinker
public void addLibrary(String libraryURL)
DocumentLinker
addLibrary
in interface DocumentLinker
public void addScript(InitializationPriority priority, String script)
DocumentLinker
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 addInitialization(InitializationPriority priority, String moduleName, String functionName, JSONArray arguments)
DocumentLinker
addInitialization
in interface DocumentLinker
priority
- priority at which to perform initializationmoduleName
- name of module; the module exports a single function, or a map of functionsfunctionName
- name of function exported by module, or null (if the module exports a single function)arguments
- arguments to pass to the function, or null if no argumentspublic void updateDocument(Document document)
document
- to be updatedprotected void addContentToBody(Element body)
<script>
elements for the RequireJS library, then any statically includes JavaScript libraries
(including JavaScript stack virtual assets), then the initialization script block.body
- element to add the dynamic scripting toprotected void addStylesheetsToHead(Element root, List<StylesheetLink> stylesheets)
root
- element of documentstylesheets
- to add to the documentpublic void addModuleConfigurationCallback(ModuleConfigurationCallback callback)
DocumentLinker
addModuleConfigurationCallback
in interface DocumentLinker
callback
- a ModuleConfigurationCallback
. It cannot be null.${project.version} - Copyright © 2003-2015 The Apache Software Foundation.