org.apache.wicket.examples.resourcedecoration
Class GroupingAndFilteringHeaderResponse

java.lang.Object
  extended by org.apache.wicket.markup.html.DecoratingHeaderResponse
      extended by org.apache.wicket.examples.resourcedecoration.GroupingAndFilteringHeaderResponse
All Implemented Interfaces:
java.io.Closeable, IHeaderResponse

public class GroupingAndFilteringHeaderResponse
extends DecoratingHeaderResponse

An IHeaderResponse that uses grouping for the CSS resources, i.e. can load several .css files with one http request, and load the JavaScript resources at the footer of the body


Constructor Summary
GroupingAndFilteringHeaderResponse(GroupingHeaderResponse groupingHeaderResponse, JavaScriptFilteredIntoFooterHeaderResponse filteredIntoFooterHeaderResponse)
          Uses JavaScriptFilteredIntoFooterHeaderResponse for rendering all JavaScript resources and GroupingHeaderResponse for all CSS resources
 
Method Summary
 void close()
          Mark Header rendering is completed and subsequent usage will be ignored.
 void renderCSS(java.lang.CharSequence css, java.lang.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, java.lang.String media)
          Writes a CSS reference with query parameters, if the specified reference hasn't been rendered yet.
 void renderCSSReference(ResourceReference reference, java.lang.String media)
          Writes a CSS reference, if the specified reference hasn't been rendered yet.
 void renderCSSReference(java.lang.String url)
          Writes a CSS reference, if the specified reference hasn't been rendered yet.
 void renderCSSReference(java.lang.String url, java.lang.String media)
          Writes a link to a CSS resource, if the specified url hasn't been rendered yet.
 
Methods inherited from class org.apache.wicket.markup.html.DecoratingHeaderResponse
getRealResponse, getResponse, isClosed, markRendered, renderCSSReference, renderCSSReference, renderJavaScript, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderOnDomReadyJavaScript, renderOnEventJavaScript, renderOnLoadJavaScript, renderString, wasRendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupingAndFilteringHeaderResponse

public GroupingAndFilteringHeaderResponse(GroupingHeaderResponse groupingHeaderResponse,
                                          JavaScriptFilteredIntoFooterHeaderResponse filteredIntoFooterHeaderResponse)
Uses JavaScriptFilteredIntoFooterHeaderResponse for rendering all JavaScript resources and GroupingHeaderResponse for all CSS resources

Parameters:
groupingHeaderResponse -
filteredIntoFooterHeaderResponse -
Method Detail

renderCSSReference

public void renderCSSReference(ResourceReference reference)
Description copied from interface: IHeaderResponse
Writes a CSS reference, if the specified reference hasn't been rendered yet.

Specified by:
renderCSSReference in interface IHeaderResponse
Overrides:
renderCSSReference in class DecoratingHeaderResponse
Parameters:
reference - resource reference pointing to the CSS resource

renderCSSReference

public void renderCSSReference(java.lang.String url)
Description copied from interface: IHeaderResponse
Writes a CSS reference, if the specified reference hasn't been rendered yet.

Specified by:
renderCSSReference in interface IHeaderResponse
Overrides:
renderCSSReference in class DecoratingHeaderResponse
Parameters:
url - context-relative url of the CSS resource

renderCSSReference

public void renderCSSReference(ResourceReference reference,
                               java.lang.String media)
Description copied from interface: IHeaderResponse
Writes a CSS reference, if the specified reference hasn't been rendered yet.

Specified by:
renderCSSReference in interface IHeaderResponse
Overrides:
renderCSSReference in class DecoratingHeaderResponse
Parameters:
reference - resource reference pointing to the CSS resource
media - the media type for this CSS ("print", "screen", etc.)

renderCSSReference

public void renderCSSReference(ResourceReference reference,
                               PageParameters pageParameters,
                               java.lang.String media)
Description copied from interface: IHeaderResponse
Writes a CSS reference with query parameters, if the specified reference hasn't been rendered yet.

Specified by:
renderCSSReference in interface IHeaderResponse
Overrides:
renderCSSReference in class DecoratingHeaderResponse
Parameters:
reference - resource reference pointing to the CSS resource
pageParameters - the parameters for this CSS resource reference
media - the media type for this CSS ("print", "screen", etc.)

renderCSSReference

public void renderCSSReference(java.lang.String url,
                               java.lang.String media)
Description copied from interface: IHeaderResponse
Writes a link to a CSS resource, if the specified url hasn't been rendered yet.

Specified by:
renderCSSReference in interface IHeaderResponse
Overrides:
renderCSSReference in class DecoratingHeaderResponse
Parameters:
url - context-relative url of the CSS resource
media - the media type for this CSS ("print", "screen", etc.)

close

public void close()
Description copied from interface: IHeaderResponse
Mark Header rendering is completed and subsequent usage will be ignored. If some kind of buffering is used internally, this action will mark that the contents has to be flushed out.

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface IHeaderResponse
Overrides:
close in class DecoratingHeaderResponse
See Also:
DecoratingHeaderResponse.close()

renderCSS

public void renderCSS(java.lang.CharSequence css,
                      java.lang.String id)
Description copied from interface: IHeaderResponse
Renders CSS code to the response, if the CSS has not already been rendered. the necessary surrounding <style> tags will be added to the output.

Specified by:
renderCSS in interface IHeaderResponse
Overrides:
renderCSS in class DecoratingHeaderResponse
Parameters:
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.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.