|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.html.DecoratingHeaderResponse
public abstract class DecoratingHeaderResponse
This is simply a helper implementation of IHeaderResponse that really delegates all of its method calls to the IHeaderResponse that is passed into the constructor. It is defined as abstract because it's only meant to be extended and not used a la carte. You can extend it and override only the methods that you want to change the functionality of.
IHeaderResponseDecorator
,
IHeaderResponse
Constructor Summary | |
---|---|
DecoratingHeaderResponse(IHeaderResponse real)
Create a header response that simply delegates all methods to the one that is passed in here. |
Method Summary | |
---|---|
void |
close()
Mark Header rendering is completed and subsequent usage will be ignored. |
protected IHeaderResponse |
getRealResponse()
Returns the actual response being decorated for subclasses to be able to pass it off to other objects if they need to do so. |
Response |
getResponse()
Returns the response that can be used to write arbitrary text to the head section. |
boolean |
isClosed()
|
void |
markRendered(Object object)
Marks the given object as rendered. |
void |
renderCSS(CharSequence css,
String id)
Renders CSS code to the response, if the CSS has not already been rendered. |
void |
renderCSSReference(ResourceReference reference)
Writes a CSS reference, if the specified reference hasn't been rendered yet. |
void |
renderCSSReference(ResourceReference reference,
PageParameters pageParameters,
String media)
Writes a CSS reference with query parameters, if the specified reference hasn't been rendered yet. |
void |
renderCSSReference(ResourceReference reference,
PageParameters pageParameters,
String media,
String condition)
Writes a conditional IE comment with a CSS reference with query parameters, if the specified reference hasn't been rendered yet. |
void |
renderCSSReference(ResourceReference reference,
String media)
Writes a CSS reference, if the specified reference hasn't been rendered yet. |
void |
renderCSSReference(String url)
Writes a CSS reference, if the specified reference hasn't been rendered yet. |
void |
renderCSSReference(String url,
String media)
Writes a link to a CSS resource, if the specified url hasn't been rendered yet. |
void |
renderCSSReference(String url,
String media,
String condition)
Writes a conditional IE comment for a link to a CSS resource, if the specified url hasn't been rendered yet. |
void |
renderJavaScript(CharSequence javascript,
String id)
Renders javascript code to the response, if the javascript has not already been rendered. |
void |
renderJavaScriptReference(ResourceReference reference)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(ResourceReference reference,
PageParameters pageParameters,
String id)
Writes a javascript reference with query parameters, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(ResourceReference reference,
PageParameters pageParameters,
String id,
boolean defer)
Writes a javascript reference with query parameters, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(ResourceReference reference,
PageParameters pageParameters,
String id,
boolean defer,
String charset)
Writes a javascript reference with query parameters, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(ResourceReference reference,
String id)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(String url)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(String url,
String id)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(String url,
String id,
boolean defer)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderJavaScriptReference(String url,
String id,
boolean defer,
String charset)
Writes a javascript reference, if the specified reference hasn't been rendered yet. |
void |
renderOnDomReadyJavaScript(String javascript)
Renders javascript that is executed right after the DOM is built, before external resources (e.g. |
void |
renderOnEventJavaScript(String target,
String event,
String javascript)
Renders javascript that is executed after the given event happens on specified target |
void |
renderOnLoadJavaScript(String javascript)
Renders javascript that is executed after the entire page is loaded. |
void |
renderString(CharSequence string)
Renders an arbitrary string to the header. |
boolean |
wasRendered(Object object)
Returns whether the given object has been marked as rendered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecoratingHeaderResponse(IHeaderResponse real)
real
- the actual response that this class delegates to by defaultMethod Detail |
---|
protected final IHeaderResponse getRealResponse()
public void renderJavaScriptReference(ResourceReference reference)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
reference
- resource reference pointing to the javascript resourcepublic void renderJavaScriptReference(ResourceReference reference, String id)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
reference
- resource reference pointing to the javascript resourceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)public void renderJavaScriptReference(ResourceReference reference, PageParameters pageParameters, String id)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
reference
- resource reference pointing to the javascript resourcepageParameters
- the parameters for this Javascript resource referenceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)public void renderJavaScriptReference(ResourceReference reference, PageParameters pageParameters, String id, boolean defer)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
reference
- resource reference pointing to the javascript resourcepageParameters
- the parameters for this Javascript resource referenceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)defer
- specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.public void renderJavaScriptReference(ResourceReference reference, PageParameters pageParameters, String id, boolean defer, String charset)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
reference
- resource reference pointing to the javascript resourcepageParameters
- the parameters for this Javascript resource referenceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)defer
- specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.charset
- a non null value specifies the charset attribute of the script tagpublic void renderJavaScriptReference(String url)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
url
- context-relative url of the the javascript resourcepublic void renderJavaScriptReference(String url, String id)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
url
- context-relative url of the the javascript resourceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)public void renderJavaScriptReference(String url, String id, boolean defer)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
url
- context-relative url of the the javascript resourceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)defer
- specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.public void renderJavaScriptReference(String url, String id, boolean defer, String charset)
IHeaderResponse
renderJavaScriptReference
in interface IHeaderResponse
url
- context-relative url of the the javascript resourceid
- id that will be used to filter duplicate reference (it's still filtered by URL
too)defer
- specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.charset
- a non null value specifies the charset attribute of the script tagpublic void renderJavaScript(CharSequence javascript, String id)
IHeaderResponse
script
tags will be added to the output.
renderJavaScript
in interface IHeaderResponse
javascript
- javascript content to be rendered.id
- unique id for the javascript element. This can be null, however in that case the
ajax header contribution can't detect duplicate script fragments.public void renderCSSReference(ResourceReference reference)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
reference
- resource reference pointing to the CSS resourcepublic void renderCSS(CharSequence css, String id)
IHeaderResponse
renderCSS
in interface IHeaderResponse
css
- css content to be rendered.id
- unique id for the <style> element. This can be null
, however in
that case the ajax header contribution can't detect duplicate CSS fragments.public void renderCSSReference(String url)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
url
- context-relative url of the CSS resourcepublic void renderCSSReference(ResourceReference reference, String media)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
reference
- resource reference pointing to the CSS resourcemedia
- the media type for this CSS ("print", "screen", etc.)public void renderCSSReference(ResourceReference reference, PageParameters pageParameters, String media)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
reference
- resource reference pointing to the CSS resourcepageParameters
- the parameters for this CSS resource referencemedia
- the media type for this CSS ("print", "screen", etc.)public void renderCSSReference(ResourceReference reference, PageParameters pageParameters, String media, String condition)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
reference
- resource reference pointing to the CSS resourcepageParameters
- the parameters for this CSS resource referencemedia
- the media type for this CSS ("print", "screen", etc.)condition
- the condition to use for Internet Explorer conditional comments. E.g. "IE 7".public void renderCSSReference(String url, String media)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
url
- context-relative url of the CSS resourcemedia
- the media type for this CSS ("print", "screen", etc.)public void renderCSSReference(String url, String media, String condition)
IHeaderResponse
renderCSSReference
in interface IHeaderResponse
url
- context-relative url of the CSS resourcemedia
- the media type for this CSS ("print", "screen", etc.)condition
- the condition to use for Internet Explorer conditional comments. E.g. "IE 7".public void renderString(CharSequence string)
IHeaderResponse
Note: This method is kind of dangerous as users are able to write to the output whatever they like.
renderString
in interface IHeaderResponse
string
- string to be rendered to headpublic void markRendered(Object object)
IHeaderResponse
markRendered
in interface IHeaderResponse
object
- object to be marked as rendered.public boolean wasRendered(Object object)
IHeaderResponse
renderJavaScriptReference
and renderCSSReference
mark
the specified ResourceReference
as rendered.
renderJavaScript
marks List of two elements (first is javascript body
CharSequence and second is id) as rendered.
renderString
marks the whole string as rendered.
markRendered
can be used to mark an arbitrary object as rendered
wasRendered
in interface IHeaderResponse
object
- Object that is queried to be rendered
public Response getResponse()
IHeaderResponse
Note: This method is kind of dangerous as users are able to write to the output whatever they like.
getResponse
in interface IHeaderResponse
public void renderOnDomReadyJavaScript(String javascript)
IHeaderResponse
renderOnDomReadyJavaScript
in interface IHeaderResponse
public void renderOnLoadJavaScript(String javascript)
IHeaderResponse
renderOnLoadJavaScript
in interface IHeaderResponse
public void renderOnEventJavaScript(String target, String event, String javascript)
IHeaderResponse
renderOnEventJavaScript
in interface IHeaderResponse
public void close()
IHeaderResponse
close
in interface Closeable
close
in interface IHeaderResponse
public boolean isClosed()
isClosed
in interface IHeaderResponse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |