|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface for resource related settings
resourcePollFrequency (defaults to no polling frequency) - Frequency at which resources should be polled for changes.
resourceFinder (classpath) - Set this to alter the search path for resources.
useDefaultOnMissingResource (defaults to true) - Set to true to return a default value if available when a required string resource is not found. If set to false then the throwExceptionOnMissingResource flag is used to determine how to behave. If no default is available then this is the same as if this flag were false
A ResourceStreamLocator - An Application's ResourceStreamLocator is used to find resources such as images or markup files. You can supply your own ResourceStreamLocator if your prefer to store your application's resources in a non-standard location (such as a different filesystem location, a particular JAR file or even a database) by overriding the getResourceLocator() method.
Resource Factories - Resource factories can be used to create resources dynamically from
specially formatted HTML tag attribute values. For more details, see IResourceFactory,
DefaultButtonImageResourceFactory and
especially LocalizedImageResource.
A Localizer The getLocalizer() method returns an object encapsulating all of the
functionality required to access localized resources. For many localization problems, even this
will not be required, as there are convenience methods available to all components:
Component.getString(String key) and
Component.getString(String key, IModel model).
stringResourceLoaders - A chain of IStringResourceLoader instances that are
searched in order to obtain string resources used during localization. By default the chain is
set up to first search for resources against a particular component (e.g. page etc.) and then
against the application.
| Method Summary | |
void |
addResourceFactory(java.lang.String name,
IResourceFactory resourceFactory)
Adds a resource factory to the list of factories to consult when generating resources automatically |
void |
addResourceFolder(java.lang.String resourceFolder)
Convenience method that sets the resource search path to a single folder. |
void |
addStringResourceLoader(IStringResourceLoader loader)
Add a string resource loader to the chain of loaders. |
boolean |
getAddLastModifiedTimeToResourceReferenceUrl()
Returns whether Wicket should add last modified time as resource reference URL parameter. |
boolean |
getDisableGZipCompression()
Whether to disable gzip compression for resources. |
Localizer |
getLocalizer()
Get the application's localizer. |
IPackageResourceGuard |
getPackageResourceGuard()
Gets the package resource guard. |
IPropertiesFactory |
getPropertiesFactory()
Get the property factory which will be used to load property files |
IResourceFactory |
getResourceFactory(java.lang.String name)
|
IResourceFinder |
getResourceFinder()
Gets the resource finder to use when searching for resources. |
Duration |
getResourcePollFrequency()
|
IResourceStreamLocator |
getResourceStreamLocator()
|
ModificationWatcher |
getResourceWatcher(boolean start)
|
java.util.List |
getStringResourceLoaders()
|
boolean |
getStripJavascriptCommentsAndWhitespace()
|
boolean |
getThrowExceptionOnMissingResource()
|
boolean |
getUseDefaultOnMissingResource()
|
void |
setAddLastModifiedTimeToResourceReferenceUrl(boolean value)
Sets whether Wicket should add last modified time as a parameter to resource reference URL (can help with browsers too aggressively caching certain resources). |
void |
setDisableGZipCompression(boolean disableGZipCompression)
Sets whether to disable gzip compression for resources. |
void |
setLocalizer(Localizer localizer)
Sets the localizer which will be used to find property values. |
void |
setPackageResourceGuard(IPackageResourceGuard packageResourceGuard)
Sets the package resource guard. |
void |
setPropertiesFactory(IPropertiesFactory factory)
Set the property factory which will be used to load property files |
void |
setResourceFinder(IResourceFinder resourceFinder)
Sets the finder to use when searching for resources. |
void |
setResourcePollFrequency(Duration resourcePollFrequency)
Sets the resource polling frequency. |
void |
setResourceStreamLocator(IResourceStreamLocator resourceStreamLocator)
Sets the resource stream locator for this application |
void |
setStripJavascriptCommentsAndWhitespace(boolean value)
Sets whether the whitespace characters and comments should be stripped for resources served through JavascriptPackageResource |
void |
setThrowExceptionOnMissingResource(boolean throwExceptionOnMissingResource)
|
void |
setUseDefaultOnMissingResource(boolean useDefaultOnMissingResource)
|
| Method Detail |
public void addResourceFactory(java.lang.String name,
IResourceFactory resourceFactory)
name - The name to give to the factoryresourceFactory - The resource factory to addpublic void addResourceFolder(java.lang.String resourceFolder)
resourceFolder - The resourceFolder to setpublic void addStringResourceLoader(IStringResourceLoader loader)
loader - The loader to be addedpublic boolean getDisableGZipCompression()
public Localizer getLocalizer()
for means of extending the way Wicket resolves keys to localized messages.public IPackageResourceGuard getPackageResourceGuard()
package resource guard.
public IPropertiesFactory getPropertiesFactory()
public IResourceFactory getResourceFactory(java.lang.String name)
name - Name of the factory to get
public IResourceFinder getResourceFinder()
setResourceFinder(IResourceFinder)public Duration getResourcePollFrequency()
setResourcePollFrequency(Duration)public IResourceStreamLocator getResourceStreamLocator()
public ModificationWatcher getResourceWatcher(boolean start)
start - boolean if the resource watcher should be started if not already started.
public java.util.List getStringResourceLoaders()
public boolean getThrowExceptionOnMissingResource()
IExceptionSettings.getThrowExceptionOnMissingResource()public boolean getUseDefaultOnMissingResource()
public void setDisableGZipCompression(boolean disableGZipCompression)
disableGZipCompression - public void setLocalizer(Localizer localizer)
localizer - public void setPackageResourceGuard(IPackageResourceGuard packageResourceGuard)
package resource guard.
packageResourceGuard - The package resource guardpublic void setPropertiesFactory(IPropertiesFactory factory)
factory - public void setResourceFinder(IResourceFinder resourceFinder)
resourceFinder - The resourceFinder to setpublic void setResourcePollFrequency(Duration resourcePollFrequency)
resourcePollFrequency - Frequency at which to poll resourcessetResourceFinder(IResourceFinder)public void setResourceStreamLocator(IResourceStreamLocator resourceStreamLocator)
resourceStreamLocator - new resource stream locatorpublic void setThrowExceptionOnMissingResource(boolean throwExceptionOnMissingResource)
throwExceptionOnMissingResource - IExceptionSettings.setThrowExceptionOnMissingResource(boolean)public void setUseDefaultOnMissingResource(boolean useDefaultOnMissingResource)
useDefaultOnMissingResource - Whether to use a default value (if available) when a missing resource is requestedpublic void setStripJavascriptCommentsAndWhitespace(boolean value)
JavascriptPackageResource
value - public boolean getStripJavascriptCommentsAndWhitespace()
JavascriptPackageResourcepublic void setAddLastModifiedTimeToResourceReferenceUrl(boolean value)
value - public boolean getAddLastModifiedTimeToResourceReferenceUrl()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||