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:
java.io.Serializable,IResourceBundle,org.apache.wicket.util.io.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 theResourceBundlesunderApplication.getResourceBundles().ResourceBundleshas two utility methods to create instances of this class:addJavaScriptBundleandaddCssBundle. 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(java.lang.Class<?> scope, java.lang.String name, java.util.List<T> resources)Creates a newConcatResourceBundleReferencefor the given resources.ConcatResourceBundleReference(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation, java.util.List<T> resources)Creates a newConcatResourceBundleReferencefor the given resources.ConcatResourceBundleReference(java.lang.Class<?> scope, java.lang.String name, T... resources)Creates a newConcatResourceBundleReferencefor the given resources.ConcatResourceBundleReference(java.lang.String name, T... resources)Creates a newConcatResourceBundleReferencefor the given resources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITextResourceCompressorgetCompressor()java.util.List<HeaderItem>getDependencies()java.util.List<T>getProvidedResources()IResourcegetResource()Returns the resource.voidsetCompressor(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(java.lang.Class<?> scope, java.lang.String name, java.util.List<T> resources)Creates a newConcatResourceBundleReferencefor the given resources.- Parameters:
scope-name-resources-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(java.lang.Class<?> scope, java.lang.String name, T... resources)Creates a newConcatResourceBundleReferencefor the given resources.- Parameters:
scope-name-resources-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(java.lang.String name, T... resources)Creates a newConcatResourceBundleReferencefor the given resources.- Parameters:
name-resources-
-
ConcatResourceBundleReference
public ConcatResourceBundleReference(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation, java.util.List<T> resources)Creates a newConcatResourceBundleReferencefor 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:ResourceReferenceReturns the resource.- Specified by:
getResourcein classResourceReference- Returns:
- resource instance
-
getProvidedResources
public java.util.List<T> getProvidedResources()
- Specified by:
getProvidedResourcesin interfaceIResourceBundle- Returns:
- the resources that are provided (part of) this resource.
-
getDependencies
public java.util.List<HeaderItem> getDependencies()
- Overrides:
getDependenciesin classResourceReference- Returns:
- the resources this ResourceReference depends on.
-
setCompressor
public void setCompressor(ITextResourceCompressor compressor)
-
getCompressor
public ITextResourceCompressor getCompressor()
-
-