|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.Resource
wicket.markup.html.WebResource
wicket.markup.html.PackageResource
public class PackageResource
Represents a localizable static resource.
Use like eg:
PackageResource IMG_UNKNOWN = PackageResource.get(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.
| Nested Class Summary | |
|---|---|
static class |
PackageResource.PackageResourceBlockedException
Exception thrown when the creation of a package resource is not allowed. |
| Field Summary | |
|---|---|
static java.util.regex.Pattern |
EXTENSION_CSS
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static java.util.regex.Pattern |
EXTENSION_JS
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
| Fields inherited from interface wicket.IResourceListener |
|---|
INTERFACE |
| Constructor Summary | |
|---|---|
protected |
PackageResource(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
Hidden constructor. |
| Method Summary | |
|---|---|
static void |
bind(Application application,
java.lang.Class scope,
java.util.regex.Pattern pattern)
Deprecated. Since Wicket 1.2.1 this method is effectively a no-op. package resources are automatically
tried and bound as shared resources so that they don't have
to be pre-registered anymore. Will be removed in 2.0 |
static void |
bind(Application application,
java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
Deprecated. Since Wicket 1.2.1 this method is effectively a no-op. package resources are automatically
tried and bound as shared resources so that they don't have
to be pre-registered anymore. Will be removed in 2.0 |
static void |
bind(Application application,
java.lang.Class scope,
java.lang.String name)
Binds a resource to the given application object. |
static void |
bind(Application application,
java.lang.Class scope,
java.lang.String name,
java.util.Locale locale)
Binds a resource to the given application object. |
static void |
bind(Application application,
java.lang.Class scope,
java.lang.String name,
java.util.Locale locale,
java.lang.String style)
Binds a resource to the given application object. |
static boolean |
exists(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
Gets whether a resource for a given set of criteria exists. |
static PackageResource[] |
get(java.lang.Class scope,
java.util.regex.Pattern pattern)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static PackageResource[] |
get(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static PackageResource |
get(java.lang.Class scope,
java.lang.String path)
Gets a non-localized resource for a given set of criteria. |
static PackageResource |
get(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
Gets the resource for a given set of criteria. |
java.lang.String |
getAbsolutePath()
Gets the absolute path of the resource. |
java.util.Locale |
getLocale()
Gets the locale. |
java.lang.String |
getPath()
Gets the path this resource was created with. |
IResourceStream |
getResourceStream()
|
java.lang.Class |
getScope()
Gets the scoping class, used for class loading and to determine the package. |
java.lang.String |
getStyle()
Gets the style. |
| Methods inherited from class wicket.markup.html.WebResource |
|---|
configureResponse, setHeaders |
| Methods inherited from class wicket.Resource |
|---|
getParameters, invalidate, isCacheable, onResourceRequested, setCacheable, setParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.regex.Pattern EXTENSION_CSS
public static final java.util.regex.Pattern EXTENSION_JS
| Constructor Detail |
|---|
protected PackageResource(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
scope - This argument will be used to get the class loader for loading
the package resource, and to determine what package it is inpath - The path to the resourcelocale - The locale of the resourcestyle - The style of the resource| Method Detail |
|---|
public static void bind(Application application,
java.lang.Class scope,
java.util.regex.Pattern pattern)
package resources are automatically
tried and bound as shared resources so that they don't have
to be pre-registered anymore. Will be removed in 2.0
application - The application to bind to.scope - The scope of the resource.pattern - A regular expression to match against the contents of the
package of the provided scope class (eg ".\*\.js"
will add all the files with extension "js" from that
package).
public static void bind(Application application,
java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
package resources are automatically
tried and bound as shared resources so that they don't have
to be pre-registered anymore. Will be removed in 2.0
application - The application to bind to.scope - The scope of the resource.pattern - A regular expression to match against the contents of the
package of the provided scope class (eg ".\*\.js"
will add all the files with extension "js" from that
package).recurse - Whether this method should recurse into sub packages
public static void bind(Application application,
java.lang.Class scope,
java.lang.String name)
application - The application to bind to.scope - The scope of the resource.name - The name of the resource (like "myfile.js")
public static void bind(Application application,
java.lang.Class scope,
java.lang.String name,
java.util.Locale locale)
application - The application to bind to.scope - The scope of the resource.name - The name of the resource (like "myfile.js")locale - The locale of the resource.
public static void bind(Application application,
java.lang.Class scope,
java.lang.String name,
java.util.Locale locale,
java.lang.String style)
application - The application to bind to.scope - The scope of the resource.name - The name of the resource (like "myfile.js")locale - The locale of the resource.style - The style of the resource.
public static boolean exists(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
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)
public static PackageResource[] get(java.lang.Class scope,
java.util.regex.Pattern pattern)
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 calling class/ the class in which you
call this methodpattern - Regexp pattern to match resources
public static PackageResource[] get(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
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 calling class/ the class in which you
call this methodpattern - Regexp pattern to match resourcesrecurse - Whether this method should recurse into sub packages
public static PackageResource get(java.lang.Class scope,
java.lang.String path)
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 calling class/ the class in which you
call this methodpath - The path to the resource
public static PackageResource get(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
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)
public final java.lang.String getAbsolutePath()
public final java.util.Locale getLocale()
public final java.lang.String getPath()
public IResourceStream getResourceStream()
getResourceStream in class Resourcepublic final java.lang.Class getScope()
public final java.lang.String getStyle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||