|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.ResourceBundles
public class ResourceBundles
Contains all resource bundles that are registered in the application. Resource bundles provide a way to combine multiple resources into one, reducing the number of requests needed to load a page. The code using the resources does not need to know about the registered resources, making it possible to create resource bundles for 3rd party libraries. When a single resource from a resource bundle is requested, the bundle is rendered instead. All other resources from the bundle are marked as rendered. A specific resource can only be part of one bundle.
| Constructor Summary | |
|---|---|
ResourceBundles(ResourceReferenceRegistry registry)
Construct. |
|
| Method Summary | ||
|---|---|---|
|
addBundle(T bundle)
Adds a bundle to the registry. |
|
CssReferenceHeaderItem |
addCssBundle(Class<?> scope,
String name,
CssResourceReference... references)
Adds a css bundle that is automatically generated by concatenating the given package resources. |
|
JavaScriptReferenceHeaderItem |
addJavaScriptBundle(Class<?> scope,
String name,
JavaScriptResourceReference... references)
Adds a javascript bundle that is automatically generated by concatenating the given package resources. |
|
HeaderItem |
findBundle(HeaderItem item)
Finds a bundle that provides the given item. |
|
protected
|
newBundleResourceReference(Class<?> scope,
String name,
List<T> items)
Creates a ResourceReference that will point to the bundle with the items |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceBundles(ResourceReferenceRegistry registry)
registry - the registry that keeps all referenced resources| Method Detail |
|---|
public JavaScriptReferenceHeaderItem addJavaScriptBundle(Class<?> scope,
String name,
JavaScriptResourceReference... references)
addBundle(HeaderItem) with a
JavaScriptHeaderItem for a ConcatResourceBundleReference.
scope - The scope of the bundlename - The name of the resource. This will show up as the filename in the markup.references - The resources this bundle will consist of.
public CssReferenceHeaderItem addCssBundle(Class<?> scope,
String name,
CssResourceReference... references)
addBundle(HeaderItem) with a CssHeaderItem for
a ConcatResourceBundleReference.
scope - The scope of the bundlename - The name of the resource. This will show up as the filename in the markup.references - The resources this bundle will consist of.
protected <T extends HeaderItem & IReferenceHeaderItem> ConcatResourceBundleReference<T> newBundleResourceReference(Class<?> scope,
String name,
List<T> items)
T - The type of the header itemsscope - The scope of the bundlename - The name of the resource. This will show up as the filename in the markup.items - The HeaderItems for the resource references for the bundle
public <T extends HeaderItem> T addBundle(T bundle)
bundle - The bundle to register
IllegalArgumentException - if any of the provided resources of the given bundle is already provided by a
different bundle.public HeaderItem findBundle(HeaderItem item)
item - The item that should be provided by the bundle.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||