Class ConcatResourceBundleReference<T extends HeaderItem & IReferenceHeaderItem>
- java.lang.Object
-
- org.apache.wicket.request.resource.ResourceReference
-
- org.apache.wicket.resource.bundles.ConcatResourceBundleReference<T>
-
- Type Parameters:
T
- The type of the header items to bundle
- All Implemented Interfaces:
Serializable
,IResourceBundle
,IClusterable
public class ConcatResourceBundleReference<T extends HeaderItem & IReferenceHeaderItem> extends ResourceReference implements IResourceBundle
A resource bundle that automatically concatenates the given resources. These resources should all be of the same type (javascript or css) and all haveIStaticCacheableResource
(or subclasses). After creating the bundle, you normally have to register it in theResourceBundles
underApplication.getResourceBundles()
.ResourceBundles
has two utility methods to create instances of this class:addJavaScriptBundle
andaddCssBundle
. Dependencies are inherited from the provided resources, if the bundle does not provide all dependencies itself.- Author:
- papegaaij
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
-
-
Constructor Summary
Constructors Constructor Description ConcatResourceBundleReference(Class<?> scope, String name, List<T> resources)
Creates a newConcatResourceBundleReference
for the given resources.ConcatResourceBundleReference(Class<?> scope, String name, Locale locale, String style, String variation, List<T> resources)
Creates a newConcatResourceBundleReference
for the given resources.ConcatResourceBundleReference(Class<?> scope, String name, T... resources)
Creates a newConcatResourceBundleReference
for the given resources.ConcatResourceBundleReference(String name, T... resources)
Creates a newConcatResourceBundleReference
for the given resources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITextResourceCompressor
getCompressor()
List<HeaderItem>
getDependencies()
List<T>
getProvidedResources()
IResource
getResource()
Returns the resource.void
setCompressor(ITextResourceCompressor compressor)
-
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, of, of, toString
-
-
-
-
Constructor Detail
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(Class<?> scope, String name, List<T> resources)
Creates a newConcatResourceBundleReference
for the given resources.- Parameters:
scope
-name
-resources
-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(Class<?> scope, String name, T... resources)
Creates a newConcatResourceBundleReference
for the given resources.- Parameters:
scope
-name
-resources
-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(String name, T... resources)
Creates a newConcatResourceBundleReference
for the given resources.- Parameters:
name
-resources
-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(Class<?> scope, String name, Locale locale, String style, String variation, List<T> resources)
Creates a newConcatResourceBundleReference
for the given resources.- Parameters:
scope
- mandatory parametername
- mandatory parameterlocale
- resource localestyle
- resource stylevariation
- resource variationresources
- the resources that are concatenated
-
-
Method Detail
-
getResource
public IResource getResource()
Description copied from class:ResourceReference
Returns the resource.- Specified by:
getResource
in classResourceReference
- Returns:
- resource instance
-
getProvidedResources
public List<T> getProvidedResources()
- Specified by:
getProvidedResources
in interfaceIResourceBundle
- Returns:
- the resources that are provided (part of) this resource.
-
getDependencies
public List<HeaderItem> getDependencies()
- Overrides:
getDependencies
in classResourceReference
- Returns:
- the resources this ResourceReference depends on.
-
setCompressor
public void setCompressor(ITextResourceCompressor compressor)
-
getCompressor
public ITextResourceCompressor getCompressor()
-
-