java.lang.Object
org.apache.wicket.markup.html.DecoratingHeaderResponse
org.apache.wicket.markup.head.ResourceAggregator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IHeaderResponse
ResourceAggregator
implements resource dependencies, resource bundles and sorting of
resources. During the rendering of components, all HeaderItem
s are
recorded and processed at the end.- Author:
- papegaaij
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains information about anHeaderItem
that must be rendered.static class
The location in which aHeaderItem
is added, consisting of the component/behavior that added the item, the index in the list for that component/behavior at which the item was added and the index in the request. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Mark Header rendering is completed and subsequent usage will be ignored.void
markRendered
(Object object) Overridden to keep track of the currently rendered component.protected HeaderItem
preserveCssDetails
(CssReferenceHeaderItem item, CssReferenceHeaderItem bundle) Preserves the resource reference details for CSS resource replacements.protected HeaderItem
preserveDetails
(HeaderItem item, HeaderItem bundle) Preserves the resource reference details for resource replacements.void
render
(HeaderItem item) Renders the givenHeaderItem
to the response if none of its tokens has been rendered before.boolean
wasRendered
(Object object) Overridden to keep track of the currently rendered component.Methods inherited from class org.apache.wicket.markup.html.DecoratingHeaderResponse
getRealResponse, getResponse, isClosed
-
Constructor Details
-
ResourceAggregator
Construct.- Parameters:
real
-
-
-
Method Details
-
wasRendered
Overridden to keep track of the currently rendered component.- Specified by:
wasRendered
in interfaceIHeaderResponse
- Overrides:
wasRendered
in classDecoratingHeaderResponse
- Parameters:
object
- Object that is queried to be rendered- Returns:
- Whether the object has been marked as rendered during the request
- See Also:
-
markRendered
Overridden to keep track of the currently rendered component.- Specified by:
markRendered
in interfaceIHeaderResponse
- Overrides:
markRendered
in classDecoratingHeaderResponse
- Parameters:
object
- object to be marked as rendered.- See Also:
-
render
Description copied from interface:IHeaderResponse
Renders the givenHeaderItem
to the response if none of its tokens has been rendered before.Automatically marks all item's tokens as rendered.
- Specified by:
render
in interfaceIHeaderResponse
- Overrides:
render
in classDecoratingHeaderResponse
- Parameters:
item
- The item to render.- See Also:
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIHeaderResponse
- Overrides:
close
in classDecoratingHeaderResponse
-
preserveDetails
Preserves the resource reference details for resource replacements. For example if CSS resource with media screen is replaced withWebApplication.addResourceReplacement(org.apache.wicket.request.resource.CssResourceReference, org.apache.wicket.request.resource.ResourceReference)
then the replacement will will inherit the media attribute- Parameters:
item
- The replaced header itembundle
- The bundle that represents the replacement- Returns:
- the bundle with the preserved details
-
preserveCssDetails
Preserves the resource reference details for CSS resource replacements. For example if CSS resource with media screen is replaced withWebApplication.addResourceReplacement(org.apache.wicket.request.resource.CssResourceReference, org.apache.wicket.request.resource.ResourceReference)
then the replacement will will inherit the media attribute- Parameters:
item
- The replaced header itembundle
- The bundle that represents the replacement- Returns:
- the bundle with the preserved details
-