|
||||||||||
| 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
public abstract class 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 Rolloverand Scriptcomponents. [ Component Reference ]
| Field Summary |
|---|
| Fields inherited from class org.apache.tapestry.AbstractComponent |
|---|
_clientId |
| Constructor Summary | |
|---|---|
Body()
|
|
| Method Summary | |
|---|---|
void |
addBodyScript(IComponent target,
String script)
Adds scripting code to the main body. |
void |
addBodyScript(String script)
Adds additional scripting code to the page. |
void |
addExternalScript(IComponent target,
Resource scriptLocation)
Adds an external script. |
void |
addExternalScript(Resource scriptLocation)
Used to include a script from an outside URL (the scriptLocation is a URL, probably obtained from an asset. |
void |
addInitializationScript(IComponent target,
String script)
Adds initialization script. |
void |
addInitializationScript(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. |
abstract AssetFactory |
getAssetFactory()
Injected. |
abstract String |
getElement()
Parameter. |
abstract ComponentRenderWorker |
getEventWorker()
Injected. |
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)
Deprecated. To be removed in 4.2, use getPreloadedImageReference(IComponent, String) instead. |
abstract WebResponse |
getResponse()
Injected. |
String |
getUniqueString(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.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 String getPreloadedImageReference(IComponent target,
String URL)
tapestry_preload[7].src.
getPreloadedImageReference in interface PageRenderSupporttarget - The component url being loaded forURL - The asset URL to preloadpublic String getPreloadedImageReference(String URL)
getPreloadedImageReference(IComponent, String) instead.
Returns a reference, a string that can be used to represent the preloaded image in a JavaScript function.
getPreloadedImageReference in interface PageRenderSupportpublic void addInitializationScript(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#addInitializationScript(IComponent, String)}
public void addInitializationScript(IComponent target,
String script)
</body> tag).
addInitializationScript in interface IScriptProcessortarget - The component the script is being added for.script - The script to add.public void addBodyScript(String script)
This is typically used to add some form of JavaScript event handler to a page. For example,
the Rollovercomponent makes use of this.
Another way this is invoked is by using the Scriptcomponent.
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#addBodyScript(IComponent, String)}
public void addBodyScript(IComponent target,
String script)
Body 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 addExternalScript(Resource scriptLocation)
addExternalScript in interface IScriptProcessor#addExternalScript(IComponent, Resource)}
public void addExternalScript(IComponent target,
Resource scriptLocation)
addExternalScript in interface IScriptProcessortarget - The component the script is being added for.scriptLocation - The external script to add.protected void prepareForRender(IRequestCycle cycle)
AbstractComponentAbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render.
This implementation sets JavaBeans properties from matching bound parameters. The default
implementation of this method is empty.
prepareForRender in class AbstractComponent
protected void renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
AbstractComponentAbstractComponent.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 AbstractComponentprotected void cleanupAfterRender(IRequestCycle cycle)
AbstractComponentAbstractComponent.render(IMarkupWriter, IRequestCycle)after the component renders. This
implementation does nothing.
cleanupAfterRender in class AbstractComponentpublic abstract String getElement()
public abstract AssetFactory getAssetFactory()
public abstract WebResponse getResponse()
public abstract ComponentRenderWorker getEventWorker()
public String getUniqueString(String baseValue)
IScriptProcessor
getUniqueString in interface IScriptProcessor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||