|
||||||||||
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,
org.apache.hivemind.Location location,
ResponseBuilder builder)
Deprecated. To be removed in 4.1.2 - use the new PageRenderSupportImpl(org.apache.tapestry.asset.AssetFactory, String, org.apache.tapestry.services.ResponseBuilder, org.apache.tapestry.IRequestCycle)
constructor instead. |
|
PageRenderSupportImpl(AssetFactory assetFactory,
String namespace,
ResponseBuilder builder,
IRequestCycle cycle)
|
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,
org.apache.hivemind.Resource scriptLocation)
Adds an external script. |
void |
addExternalScript(org.apache.hivemind.Resource scriptLocation)
Adds an external script. |
void |
addInitializationScript(IComponent target,
String script)
Adds initialization script. |
void |
addInitializationScript(String script)
Adds initialization script. |
void |
addScriptAfterInitialization(IComponent target,
String script)
Works in the same way as IScriptProcessor.addInitializationScript(IComponent, String) - except this
method causes the script being added to appear after all of the script content written out
from the normal initialization script processing happens. |
static String |
getContent(StringBuffer buffer)
|
org.apache.hivemind.Location |
getLocation()
Returns the location, which may be used in error messages. |
String |
getPreloadedImageReference(IComponent target,
IAsset source)
Operates in the same way that PageRenderSupport.getPreloadedImageReference(IComponent, String) does, except
the source is the actual IAsset of an image to preload. |
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. |
boolean |
isBodyScriptAllowed(IComponent target)
Determines if the specified component should have its javascript body added to the response. |
boolean |
isExternalScriptAllowed(IComponent target)
Determines if the specified component should have its javascript external resource scripts added to the response. |
boolean |
isInitializationScriptAllowed(IComponent target)
Determines if the specified component should have its javascript initialization added to the response. |
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, org.apache.hivemind.Location location, ResponseBuilder builder)
PageRenderSupportImpl(org.apache.tapestry.asset.AssetFactory, String, org.apache.tapestry.services.ResponseBuilder, org.apache.tapestry.IRequestCycle)
constructor instead.
assetFactory
- Used to generate asset urls.namespace
- Namespace that javascript / portlet related items should be in.location
- Location of what is primarily the Body
component.builder
- The response delegate.public PageRenderSupportImpl(AssetFactory assetFactory, String namespace, ResponseBuilder builder, IRequestCycle cycle)
Method Detail |
---|
public org.apache.hivemind.Location getLocation()
Body
component.
getLocation
in interface org.apache.hivemind.Locatable
public String getPreloadedImageReference(String URL)
PageRenderSupport
tapestry_preload[7].src
.
getPreloadedImageReference
in interface PageRenderSupport
URL
- The url to the resource to be preloaded.
public String getPreloadedImageReference(IComponent target, IAsset source)
PageRenderSupport
PageRenderSupport.getPreloadedImageReference(IComponent, String)
does, except
the source is the actual IAsset
of an image to preload.
getPreloadedImageReference
in interface PageRenderSupport
target
- The component the asset is being loaded for.source
- The asset image to preload.
public String getPreloadedImageReference(IComponent target, String URL)
PageRenderSupport
tapestry_preload[7].src
.
getPreloadedImageReference
in interface PageRenderSupport
target
- The component url being loaded for.URL
- The asset URL to preload.
public void addBodyScript(String script)
IScriptProcessor
Body
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)
IScriptProcessor
Body
component will write the body script contents
just inside the <body>
tag.
addBodyScript
in interface IScriptProcessor
target
- The component this script is being added for.script
- The script to add to the body response.public boolean isBodyScriptAllowed(IComponent target)
isBodyScriptAllowed
in interface IScriptProcessor
target
- The component to allow/disallow body script content from.
public boolean isExternalScriptAllowed(IComponent target)
isExternalScriptAllowed
in interface IScriptProcessor
target
- The component to check for inclusion/exclusion.
public boolean isInitializationScriptAllowed(IComponent target)
isInitializationScriptAllowed
in interface IScriptProcessor
target
- The component to allow/disallow initialization script content from.
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 IScriptProcessor
target
- The component the script is being added for.script
- The script to add.public void addScriptAfterInitialization(IComponent target, String script)
IScriptProcessor
IScriptProcessor.addInitializationScript(IComponent, String)
- except this
method causes the script being added to appear after all of the script content written out
from the normal initialization script processing happens. This is useful if you have some initialization
script logic that absolutely must happen at the very end of the rest of things.
addScriptAfterInitialization
in interface IScriptProcessor
target
- The component the script is being added for.script
- The script to add.#addInitializationScript(IComponent, String)}.
public void addExternalScript(org.apache.hivemind.Resource scriptLocation)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
#addExternalScript(IComponent, Resource)}
public void addExternalScript(IComponent target, org.apache.hivemind.Resource scriptLocation)
IScriptProcessor
addExternalScript
in interface IScriptProcessor
target
- 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)
).
writer
- The markup writer to use.cycle
- The current request.writeInitializationScript(IMarkupWriter)
public void writeInitializationScript(IMarkupWriter writer)
window.onload
event handler.
writer
- The markup writer to use.public static String getContent(StringBuffer buffer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |