org.apache.wicket.resource.bundles
Class ConcatResourceBundleReference<T extends HeaderItem & IReferenceHeaderItem>

java.lang.Object
  extended by org.apache.wicket.request.resource.ResourceReference
      extended by 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 have IStaticCacheableResource (or subclasses). After creating the bundle, you normally have to register it in the ResourceBundles under Application.getResourceBundles(). ResourceBundles has two utility methods to create instances of this class: addJavaScriptBundle and addCssBundle. 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.UrlAttributes
 
Constructor Summary
ConcatResourceBundleReference(Class<?> scope, String name, List<T> resources)
          Creates a new ConcatResourceBundleReference for the given resources.
ConcatResourceBundleReference(Class<?> scope, String name, Locale locale, String style, String variation, List<T> resources)
          Creates a new ConcatResourceBundleReference for the given resources.
ConcatResourceBundleReference(Class<?> scope, String name, T... resources)
          Creates a new ConcatResourceBundleReference for the given resources.
ConcatResourceBundleReference(String name, T... resources)
          Creates a new ConcatResourceBundleReference for the given resources.
 
Method Summary
 ITextResourceCompressor getCompressor()
           
 Iterable<? extends 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, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcatResourceBundleReference

public ConcatResourceBundleReference(Class<?> scope,
                                     String name,
                                     List<T> resources)
Creates a new ConcatResourceBundleReference for the given resources.

Parameters:
scope -
name -
resources -

ConcatResourceBundleReference

public ConcatResourceBundleReference(Class<?> scope,
                                     String name,
                                     T... resources)
Creates a new ConcatResourceBundleReference for the given resources.

Parameters:
scope -
name -
resources -

ConcatResourceBundleReference

public ConcatResourceBundleReference(String name,
                                     T... resources)
Creates a new ConcatResourceBundleReference 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 new ConcatResourceBundleReference for the given resources.

Parameters:
scope - mandatory parameter
name - mandatory parameter
locale - resource locale
style - resource style
variation - resource variation
resources - the resources that are concatenated
Method Detail

getResource

public IResource getResource()
Description copied from class: ResourceReference
Returns the resource.

Specified by:
getResource in class ResourceReference
Returns:
resource instance

getProvidedResources

public List<T> getProvidedResources()
Specified by:
getProvidedResources in interface IResourceBundle
Returns:
the resources that are provided (part of) this resource.

getDependencies

public Iterable<? extends HeaderItem> getDependencies()
Overrides:
getDependencies in class ResourceReference
Returns:
the resources this ResourceReference depends on.

setCompressor

public void setCompressor(ITextResourceCompressor compressor)

getCompressor

public ITextResourceCompressor getCompressor()


Copyright © 2006–2016 Apache Software Foundation. All rights reserved.