|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.Resource
A Resource is something that implements IResourceListener and provides a getResource() method which returns the raw IResource to be rendered back to the client browser.
Resources themselves do not currently have URLs. Instead, they are referred to by components that have URLs.
Resources can be shared throughout an application by adding them to Application with addResource(Class scope, String name) or addResource(String name). A resource added in such a way is a named resource and is accessible throughout the application via Application.getResource(Class scope, String name) or Application.getResource(String name). The ResourceReference class enables easy access to such resources in a way that is light on clusters.
While resources can be shared between components, it is important to emphasize that components cannot be shared among containers. For example, you can create a button image resource with new DefaultButtonImageResource(...) and store that in the Application with addResource(). You can then assign that logical resource via ResourceReference to several ImageButton components. While the button image resource can be shared between components like this, the ImageButton components in this example are like all other components in Wicket and cannot be shared.
| Field Summary | |
protected IResourceStream |
resourceStream
The actual raw resource this class is rendering |
| Constructor Summary | |
protected |
Resource()
Constructor |
| Method Summary | |
abstract IResourceStream |
getResourceStream()
|
protected void |
invalidate()
Sets any loaded resource to null, thus forcing a reload on the next request. |
boolean |
isCacheable()
|
void |
onResourceRequested()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
setCacheable(boolean cacheable)
Should this resource be cacheable, so will it set the last modified and the some cache headers in the response. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected IResourceStream resourceStream
| Constructor Detail |
protected Resource()
| Method Detail |
public abstract IResourceStream getResourceStream()
public boolean isCacheable()
public final void onResourceRequested()
onResourceRequested in interface IResourceListenerpublic final void setCacheable(boolean cacheable)
cacheable - boolean if the lastmodified and cache headers must be set.protected void invalidate()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||