|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ResponseBuilder
Represents the class responsible for interacting with components for an ajax request library version and type.
| Field Summary | |
|---|---|
static java.lang.String |
BODY_SCRIPT
|
static java.lang.String |
INCLUDE_SCRIPT
|
static java.lang.String |
INITIALIZATION_SCRIPT
|
static java.lang.String |
SCRIPT_TYPE
|
| Method Summary | |
|---|---|
void |
beginBodyScript(IRequestCycle cycle)
Marks the beginning of the core body script. |
void |
endBodyScript(IRequestCycle cycle)
Marks the end of the body block being called. |
IMarkupWriter |
getWriter()
Returns the IMarkupWriter associated with this response, it may or may not be a NullWriter instance depending on the response type or stage of the render cycle. |
IMarkupWriter |
getWriter(java.lang.String id,
java.lang.String type)
Gets a write that will output its content in a response
element with the given id and type. |
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 |
render(IMarkupWriter writer,
IRender render,
IRequestCycle cycle)
Invoked to render a renderable object. |
void |
renderResponse(IRequestCycle cycle)
Renders the response to a client. |
void |
updateComponent(java.lang.String id)
If the component identified by the specified id isn't already set to be updated, will add it to the response for updating. |
void |
writeBodyScript(java.lang.String script,
IRequestCycle cycle)
Called after beginBodyScript(IRequestCycle) to write the containing
body script. |
void |
writeExternalScript(java.lang.String url,
IRequestCycle cycle)
Invoked by PageRenderSupport to write external js package
includes. |
void |
writeImageInitializations(java.lang.String script,
java.lang.String preloadName,
IRequestCycle cycle)
Intended to be written within the confines of the body script, should be invoked once just after beginBodyScript(IRequestCycle) is called
to include any image initializations. |
void |
writeInitializationScript(java.lang.String script)
Writes any javascript that should only execute after all other items on a page have completed rendering. |
| Field Detail |
|---|
static final java.lang.String SCRIPT_TYPE
static final java.lang.String BODY_SCRIPT
static final java.lang.String INCLUDE_SCRIPT
static final java.lang.String INITIALIZATION_SCRIPT
| Method Detail |
|---|
void renderResponse(IRequestCycle cycle)
throws java.io.IOException
cycle - The main request cycle object for this request.
java.io.IOException
void render(IMarkupWriter writer,
IRender render,
IRequestCycle cycle)
writer - The markup writer to use, this may be ignored or swapped
out for a different writer depending on the implementation being used.render - The renderable object to rendercycle - Render request cyclevoid updateComponent(java.lang.String id)
id - The IComponent id to update.
void writeExternalScript(java.lang.String url,
IRequestCycle cycle)
PageRenderSupport to write external js package
includes. This method will be invoked for each external script requesting
inclusion in the response.
These will typically be written out as
.
url - The absolute url to the .js package to be included.cycle - The associated request.void beginBodyScript(IRequestCycle cycle)
cycle - The associated request.
void writeImageInitializations(java.lang.String script,
java.lang.String preloadName,
IRequestCycle cycle)
beginBodyScript(IRequestCycle) is called
to include any image initializations. This method should only be called if
there are actually images that need pre-initialization. Ie in many instances
it will not be called at all.
script - The non null value of the script images to include.preloadName - The global variable name to give to the preloaded images array.cycle - The associated request.
void writeBodyScript(java.lang.String script,
IRequestCycle cycle)
beginBodyScript(IRequestCycle) to write the containing
body script. This method may not be called at all if there is no js body
to write into the response.
script - The script to write into the body response.cycle - The associated request.void endBodyScript(IRequestCycle cycle)
beginBodyScript(IRequestCycle) was previously
called.
cycle - The associated request.void writeInitializationScript(java.lang.String script)
window.onload
event, but will vary depending on the implementation of the builder being used.
This method will ~only~ be called if there is any queued intialization script
to write.
script - The initialzation script to write.IMarkupWriter getWriter()
IMarkupWriter getWriter(java.lang.String id,
java.lang.String type)
response
element with the given id and type.
id - The response element id to give writer.type - Optional - If specified will give the response element a type
attribute.
IMarkupWriter instance to write content to.boolean isBodyScriptAllowed(IComponent target)
target - The component to allow/disallow body script content from.
boolean isInitializationScriptAllowed(IComponent target)
target - The component to allow/disallow initialization script content from.
boolean isExternalScriptAllowed(IComponent target)
target - The component to check for inclusion/exclusion.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||