|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.SharedResources
public class SharedResources
Class which holds shared resources. Resources can be shared by name. An optional scope can be given to prevent naming conflicts and a locale and/or style can be given as well.
Unlike component hosted resources, shared resources have stable URLs, which makes them suitable
for indexing by web crawlers and caching by web browsers. As they are also not synchronised on
the Session
, they can be loaded asynchronously, which is important with images and
resources such as JavaScript and CSS.
Constructor Summary | |
---|---|
SharedResources(ResourceReferenceRegistry registry)
Construct. |
Method Summary | |
---|---|
void |
add(Class<?> scope,
String name,
Locale locale,
String style,
String variation,
IResource resource)
Adds a resource. |
void |
add(String name,
IResource resource)
Adds a resource. |
void |
add(String name,
Locale locale,
IResource resource)
Adds a resource. |
ResourceReference |
get(Class<?> scope,
String name,
Locale locale,
String style,
String variation,
boolean strict)
Resolves a ResourceReference for a shared resource. |
ResourceReference |
get(String name)
Resolves a ResourceReference for a shared resource by using
Application as a scope and null for
locale, style and variation. |
ResourceReference |
remove(ResourceReference.Key key)
Removes a resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SharedResources(ResourceReferenceRegistry registry)
registry
- Method Detail |
---|
public final void add(Class<?> scope, String name, Locale locale, String style, String variation, IResource resource)
scope
- Scope of resourcename
- Logical name of resourcelocale
- The locale of the resourcestyle
- The resource style (see Session
)variation
- The component specific variation of the styleresource
- Resource to storepublic final void add(String name, Locale locale, IResource resource)
name
- Logical name of resourcelocale
- The locale of the resourceresource
- Resource to storepublic final void add(String name, IResource resource)
name
- Logical name of resourceresource
- Resource to storepublic final ResourceReference get(String name)
ResourceReference
for a shared resource by using
Application
as a scope and null
for
locale, style and variation.
name
- Logical name of resourcepublic ResourceReference get(Class<?> scope, String name, Locale locale, String style, String variation, boolean strict)
ResourceReference
for a shared resource.
scope
- Scope of resourcename
- Logical name of resourcelocale
- The locale of the resourcestyle
- The resource style (see Session
)variation
- The component specific variation of the stylestrict
- If true, "weaker" combination of scope, name, locale etc. are not tested
public final ResourceReference remove(ResourceReference.Key key)
key
- the resource reference's identifier
ResourceReference
. null
if there was no registration for
this ResourceReference.Key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |