|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry.util.PageRenderSupportImpl
public class PageRenderSupportImpl
Implementation of PageRenderSupport. The
Body component uses an instance of this class.
| Constructor Summary | |
|---|---|
PageRenderSupportImpl(AssetFactory assetFactory,
String namespace,
Location location,
ResponseBuilder builder)
|
|
| Method Summary | |
|---|---|
void |
addBodyScript(IComponent target,
String script)
Adds scripting code to the main body. |
void |
addBodyScript(String script)
Adds scripting code to the main body. |
void |
addExternalScript(IComponent target,
Resource scriptLocation)
Adds an external script. |
void |
addExternalScript(Resource scriptLocation)
Adds an external script. |
void |
addInitializationScript(IComponent target,
String script)
Adds initialization script. |
void |
addInitializationScript(String script)
Adds initialization script. |
Location |
getLocation()
Returns the location, which may be used in error messages. |
String |
getPreloadedImageReference(IComponent target,
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. |
String |
getPreloadedImageReference(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. |
String |
getUniqueString(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(IComponent, 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PageRenderSupportImpl(AssetFactory assetFactory,
String namespace,
Location location,
ResponseBuilder builder)
| Method Detail |
|---|
public Location getLocation()
Body component.
getLocation in interface Locatablepublic String getPreloadedImageReference(String URL)
PageRenderSupporttapestry_preload[7].src.
getPreloadedImageReference in interface PageRenderSupport
public String getPreloadedImageReference(IComponent target,
String URL)
PageRenderSupporttapestry_preload[7].src.
getPreloadedImageReference in interface PageRenderSupporttarget - The component url being loaded forURL - The asset URL to preloadpublic void addBodyScript(String script)
IScriptProcessorBody component will write the body script contents
just inside the <body> tag.
addBodyScript in interface IScriptProcessor#addBodyScript(IComponent, String)}
public void addBodyScript(IComponent target,
String script)
IScriptProcessorBody component will write the body script contents
just inside the <body> tag.
addBodyScript in interface IScriptProcessortarget - The component this script is being added for.script - The script to add to the body response.public void addInitializationScript(String script)
IScriptProcessor</body> tag).
addInitializationScript in interface IScriptProcessor#addInitializationScript(IComponent, String)}
public void addInitializationScript(IComponent target,
String script)
IScriptProcessor</body> tag).
addInitializationScript in interface IScriptProcessortarget - The component the script is being added for.script - The script to add.public void addExternalScript(Resource scriptLocation)
IScriptProcessor
addExternalScript in interface IScriptProcessor#addExternalScript(IComponent, Resource)}
public void addExternalScript(IComponent target,
Resource scriptLocation)
IScriptProcessor
addExternalScript in interface IScriptProcessortarget - The component the script is being added for.scriptLocation - The external script to add.public String getUniqueString(String baseValue)
IScriptProcessor
getUniqueString in interface IScriptProcessor
public void writeBodyScript(IMarkupWriter writer,
IRequestCycle cycle)
getPreloadedImageReference(IComponent, String)).
addExternalScript(Resource)).
addBodyScript(String)).
writeInitializationScript(IMarkupWriter)public void writeInitializationScript(IMarkupWriter writer)
window.onload event handler.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||