|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.PackageResource
public class PackageResource
Represents a localizable static resource.
Use like eg:
MyPackageResource IMG_UNKNOWN = new MyPackageResource(EditPage.class, "questionmark.gif");where the static resource references image 'questionmark.gif' from the the package that EditPage is in to get a package resource. Access to resources can be granted or denied via a
IPackageResourceGuard
. Please see
IResourceSettings.getPackageResourceGuard()
as well.
Nested Class Summary | |
---|---|
static class |
PackageResource.PackageResourceBlockedException
Exception thrown when the creation of a package resource is not allowed. |
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource |
---|
AbstractResource.ResourceResponse, AbstractResource.WriteCallback |
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource |
---|
IResource.Attributes |
Constructor Summary | |
---|---|
protected |
PackageResource(Class<?> scope,
String name,
Locale locale,
String style,
String variation)
Hidden constructor. |
Method Summary | |
---|---|
static boolean |
exists(Class<?> scope,
String path,
Locale locale,
String style,
String variation)
Gets whether a resource for a given set of criteria exists. |
protected IResourceStream |
getResourceStream()
locate resource stream for current resource |
Class<?> |
getScope()
Gets the scoping class, used for class loading and to determine the package. |
String |
getStyle()
Gets the style. |
protected AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
creates a new resource response based on the request attributes |
String |
toString()
|
Methods inherited from class org.apache.wicket.request.resource.AbstractResource |
---|
configureCache, respond |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected PackageResource(Class<?> scope, String name, Locale locale, String style, String variation)
scope
- This argument will be used to get the class loader for loading the package
resource, and to determine what package it is inname
- The relative path to the resourcelocale
- The locale of the resourcestyle
- The style of the resourcevariation
- The component's variation (of the style)Method Detail |
---|
public final Class<?> getScope()
public final String getStyle()
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
newResourceResponse
in class AbstractResource
attributes
- current request attributes from client
protected IResourceStream getResourceStream()
null
if not foundpublic static boolean exists(Class<?> scope, String path, Locale locale, String style, String variation)
scope
- This argument will be used to get the class loader for loading the package
resource, and to determine what package it is in. Typically this is the class in
which you call this methodpath
- The path to the resourcelocale
- The locale of the resourcestyle
- The style of the resource (see Session
)variation
- The component's variation (of the style)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |