org.apache.wicket.resource.aggregation
Class AbstractDependencyRespectingResourceAggregatingHeaderResponse<R extends ResourceReferenceCollection,K>
java.lang.Object
org.apache.wicket.markup.html.DecoratingHeaderResponse
org.apache.wicket.resource.aggregation.AbstractResourceAggregatingHeaderResponse<R,K>
org.apache.wicket.resource.aggregation.AbstractDependencyRespectingResourceAggregatingHeaderResponse<R,K>
- Type Parameters:
R
- the type of ResourceReferenceCollection returned by
#newResourceReferenceCollection()
and passed to all the methods that take a
ResourceReferenceCollection. You will typically just use ResourceReferenceCollection
for this param, unless you are returning a specific type of
ResourceReferenceCollection from your subclass.K
- the class of the key that you will create from
AbstractResourceAggregatingHeaderResponse.newGroupingKey(ResourceReferenceAndStringData)
- All Implemented Interfaces:
- Closeable, IHeaderResponse
public abstract class AbstractDependencyRespectingResourceAggregatingHeaderResponse<R extends ResourceReferenceCollection,K>
- extends AbstractResourceAggregatingHeaderResponse<R,K>
An implementation of AbstractResourceAggregatingHeaderResponse that renders references in the
correct order if they are AbstractResourceDependentResourceReference
references, ensuring
that dependencies are rendered in the proper order before their parent (even if they do not
appear in the same group as the parent of the dependencies).
- Author:
- Jeremy Thomerson
Methods inherited from class org.apache.wicket.resource.aggregation.AbstractResourceAggregatingHeaderResponse |
close, getGroupingKeyComparator, newGroupingKey, newResourceReferenceCollection, onAllCollectionsRendered, render, renderCSS, renderCSSReference, renderCSSReference, renderCSSReference, renderCSSReference, renderCSSReference, renderCSSReference, renderCSSReference, renderIfNotAlreadyRendered, renderJavaScript, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderJavaScriptReference, renderOnDomReadyJavaScript, renderOnEventJavaScript, renderOnLoadJavaScript, renderString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDependencyRespectingResourceAggregatingHeaderResponse
public AbstractDependencyRespectingResourceAggregatingHeaderResponse(IHeaderResponse real)
- Construct.
- Parameters:
real
- the header response we decorate
renderCollection
protected void renderCollection(Set<ResourceReferenceAndStringData> alreadyRendered,
K key,
R coll)
- Description copied from class:
AbstractResourceAggregatingHeaderResponse
- When the entire hierarchy has been traversed and
AbstractResourceAggregatingHeaderResponse.close()
is called, we loop through
the grouped collections and render them in this method. This method is typically overridden
to render your collection how you want to render them.
For instance, if you want to aggregate your groups into a single HTTP request, you can
override this method, create the URL to your aggregation servlet (or IResource
), and
then call getRealResponse().renderJavaScriptReference(yourUrl), or the appropriate
method to render the URL for a group of CSS references.
- Overrides:
renderCollection
in class AbstractResourceAggregatingHeaderResponse<R extends ResourceReferenceCollection,K>
- Parameters:
alreadyRendered
- a set of resource references that have already been rendered in other groupskey
- they grouping key for this groupcoll
- the collection of resource references to render
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.