public class PageRenderSupportImpl extends java.lang.Object implements org.apache.hivemind.Locatable, PageRenderSupport
PageRenderSupport
. The
Body
component uses an instance of this class.Constructor and Description |
---|
PageRenderSupportImpl(AssetFactory assetFactory,
java.lang.String namespace,
org.apache.hivemind.Location location) |
Modifier and Type | Method and Description |
---|---|
void |
addBodyScript(java.lang.String script)
Adds scripting code to the main body.
|
void |
addExternalScript(org.apache.hivemind.Resource scriptLocation)
Adds an external script.
|
void |
addInitializationScript(java.lang.String script)
Adds initialization script.
|
org.apache.hivemind.Location |
getLocation()
Returns the location, which may be used in error messages.
|
java.lang.String |
getPreloadedImageReference(java.lang.String URL)
Sets up the given URL to preload, and returns a reference to the loaded image, in the form of
a snippet of JavaScript expression that can be inserted into some larger block of JavaScript
as a function parameter, or as a property assignment.
|
java.lang.String |
getUniqueString(java.lang.String baseValue)
Ensures that the given string is unique.
|
void |
writeBodyScript(IMarkupWriter writer,
IRequestCycle cycle)
Writes a single large JavaScript block containing:
Any image initializations (via
getPreloadedImageReference(String) ). |
void |
writeInitializationScript(IMarkupWriter writer)
Writes any image initializations; this should be invoked at the end of the render, after all
the related HTML will have already been streamed to the client and parsed by the web browser.
|
public PageRenderSupportImpl(AssetFactory assetFactory, java.lang.String namespace, org.apache.hivemind.Location location)
public org.apache.hivemind.Location getLocation()
Body
component.getLocation
in interface org.apache.hivemind.Locatable
public java.lang.String getPreloadedImageReference(java.lang.String URL)
PageRenderSupport
tapestry_preload[7].src
.getPreloadedImageReference
in interface PageRenderSupport
public void addBodyScript(java.lang.String script)
IScriptProcessor
Body
component will write the body script contents
just inside the <body>
tag.addBodyScript
in interface IScriptProcessor
public void addInitializationScript(java.lang.String script)
IScriptProcessor
</body> tag).
addInitializationScript
in interface IScriptProcessor
public void addExternalScript(org.apache.hivemind.Resource scriptLocation)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
public java.lang.String getUniqueString(java.lang.String baseValue)
IScriptProcessor
getUniqueString
in interface IScriptProcessor
public void writeBodyScript(IMarkupWriter writer, IRequestCycle cycle)
getPreloadedImageReference(String)
).
addExternalScript(Resource)
).
addBodyScript(String)
).
public void writeInitializationScript(IMarkupWriter writer)
window.onload
event handler.