Class SharedResourceReference
- java.lang.Object
-
- org.apache.wicket.request.resource.ResourceReference
-
- org.apache.wicket.request.resource.SharedResourceReference
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.wicket.util.io.IClusterable
public class SharedResourceReference extends ResourceReference
AResourceReferencewhich should be used to lookup aIResourcefrom the globally registered ones (also known as application shared resources). If there is no shared resource with suchkeythen it checks whether there is aPackageResourcewith thiskeyand registers it automatically if it exists.Note: Cannot be registered in
ResourceReferenceRegistrybecauseSharedResourceReferenceis just a shortcut to theresourceof anotherResourceReference- 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 SharedResourceReference(java.lang.Class<?> scope, java.lang.String name)Construct.SharedResourceReference(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation)Construct.SharedResourceReference(java.lang.String name)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeRegistered()Can be used to disable registering certain resource references inResourceReferenceRegistry.IResourcegetResource()Returns the resource.-
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, of, of, toString
-
-
-
-
Constructor Detail
-
SharedResourceReference
public SharedResourceReference(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation)Construct.- Parameters:
scope- Scope of resourcename- Logical name of resourcelocale- The locale of the resourcestyle- The resource style (seeSession)variation- The component specific variation of the style
-
SharedResourceReference
public SharedResourceReference(java.lang.Class<?> scope, java.lang.String name)Construct.- Parameters:
scope- Scope of resourcename- Logical name of resource
-
SharedResourceReference
public SharedResourceReference(java.lang.String name)
Construct.- Parameters:
name- resource name
-
-
Method Detail
-
getResource
public IResource getResource()
Description copied from class:ResourceReferenceReturns the resource.- Specified by:
getResourcein classResourceReference- Returns:
- resource instance
-
canBeRegistered
public boolean canBeRegistered()
Description copied from class:ResourceReferenceCan be used to disable registering certain resource references inResourceReferenceRegistry.- Overrides:
canBeRegisteredin classResourceReference- Returns:
trueif this reference can be registered,falseotherwise.
-
-