|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hivemind.impl.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.html.Body
The body of a Tapestry page. This is used since it allows components on the page access to an
initialization script (that is written the start, just inside the <body> tag). This is
currently used by Rollover
and Script
components. [ Component Reference ]
Constructor Summary | |
Body()
|
Method Summary | |
void |
addBodyScript(java.lang.String script)
Adds additional scripting code to the page. |
void |
addExternalScript(org.apache.hivemind.Resource scriptLocation)
Used to include a script from an outside URL (the scriptLocation is a URL, probably obtained from an asset. |
void |
addInitializationScript(java.lang.String script)
Adds other initialization, in the form of additional JavaScript code to execute from the <body>'s onLoad event handler. |
protected void |
cleanupAfterRender(IRequestCycle cycle)
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) after the component renders. |
static Body |
get(IRequestCycle cycle)
Deprecated. To be removed in 4.1. Use org.apache.tapestry.TapestryUtils#getPageRenderSupport(IRequestCycle)
instead. |
abstract AssetFactory |
getAssetFactory()
Injected |
abstract java.lang.String |
getElement()
Parameter. |
java.lang.String |
getPreloadedImageReference(java.lang.String URL)
Adds to the script an initialization for the named variable as an Image(), to the given URL. |
abstract WebResponse |
getResponse()
Injected |
java.lang.String |
getUniqueString(java.lang.String baseValue)
Ensures that the given string is unique. |
protected void |
prepareForRender(IRequestCycle cycle)
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) to prepare the component to render. |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) to actually render the component
(with any parameter values already set). |
Methods inherited from class org.apache.tapestry.AbstractComponent |
addAsset, addBody, addComponent, checkActiveLock, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString |
Methods inherited from class org.apache.hivemind.impl.BaseLocatable |
getLocation, setLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.hivemind.LocationHolder |
setLocation |
Methods inherited from interface org.apache.hivemind.Locatable |
getLocation |
Constructor Detail |
public Body()
Method Detail |
public java.lang.String getPreloadedImageReference(java.lang.String URL)
Returns a reference, a string that can be used to represent the preloaded image in a JavaScript function.
getPreloadedImageReference
in interface PageRenderSupport
public void addInitializationScript(java.lang.String script)
onLoad
event handler. The caller is responsible for adding a
semicolon (statement terminator). This method will add a newline after the script.
addInitializationScript
in interface IScriptProcessor
public void addBodyScript(java.lang.String script)
This is typically used to add some form of JavaScript event handler to a page. For example,
the Rollover
component makes use of this.
Another way this is invoked is by using the Script
component.
The string will be added, as-is, within the <script> block generated by this
Body
component. The script should not contain HTML comments, those
will be supplied by this Body component.
A frequent use is to add an initialization function using this method, then cause it to be
executed using addInitializationScript(String)
.
addBodyScript
in interface IScriptProcessor
public void addExternalScript(org.apache.hivemind.Resource scriptLocation)
addExternalScript
in interface IScriptProcessor
public static Body get(IRequestCycle cycle)
org.apache.tapestry.TapestryUtils#getPageRenderSupport(IRequestCycle)
instead.
Body
that was stored into the request cycle. This allows
components wrapped by the Body
to locate it and access the services it
provides.
protected void prepareForRender(IRequestCycle cycle)
AbstractComponent
AbstractComponent.render(IMarkupWriter, IRequestCycle)
to prepare the component to render.
This implementation sets JavaBeans properties from matching bound parameters. This
implementation does nothing.
prepareForRender
in class AbstractComponent
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
AbstractComponent
AbstractComponent.render(IMarkupWriter, IRequestCycle)
to actually render the component
(with any parameter values already set). This is the method that subclasses must implement.
renderComponent
in class AbstractComponent
protected void cleanupAfterRender(IRequestCycle cycle)
AbstractComponent
AbstractComponent.render(IMarkupWriter, IRequestCycle)
after the component renders. This
implementation does nothing.
cleanupAfterRender
in class AbstractComponent
public abstract java.lang.String getElement()
public abstract AssetFactory getAssetFactory()
public abstract WebResponse getResponse()
public java.lang.String getUniqueString(java.lang.String baseValue)
IScriptProcessor
getUniqueString
in interface IScriptProcessor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |