wicket
Class SharedResources

java.lang.Object
  extended bywicket.SharedResources

public class SharedResources
extends java.lang.Object

Class which holds shared resources. Resources can be shared by name. An optional scope can be given to prevent naming conflicts and a locale and/or style can be given as well.

Author:
Jonathan Locke, Johan Compagner, Gili Tzabari

Constructor Summary
(package private) SharedResources(Application application)
           
 
Method Summary
 void add(java.lang.Class scope, java.lang.String name, java.util.Locale locale, java.lang.String style, Resource resource)
           
 void add(java.lang.String name, java.util.Locale locale, Resource resource)
           
 void add(java.lang.String name, Resource resource)
           
 Resource get(java.lang.Class scope, java.lang.String name, java.util.Locale locale, java.lang.String style, boolean exact)
           
 Resource get(java.lang.String key)
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
 void onResourceRequested(java.lang.String key)
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
static java.lang.String path(Application application, java.lang.Class scope, java.lang.String path, java.util.Locale locale, java.lang.String style)
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
static java.lang.String path(java.lang.String path, java.util.Locale locale, java.lang.String style)
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
 void remove(java.lang.String key)
          Removes a shared resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedResources

SharedResources(Application application)
Method Detail

path

public static java.lang.String path(java.lang.String path,
                                    java.util.Locale locale,
                                    java.lang.String style)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. Inserts _[locale] and _[style] into path just before any extension that might exist.

Parameters:
path - The resource path
locale - The locale
style - The style (see Session)
Returns:
The localized path

path

public static java.lang.String path(Application application,
                                    java.lang.Class scope,
                                    java.lang.String path,
                                    java.util.Locale locale,
                                    java.lang.String style)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT.

Parameters:
application - The application object
scope - The scope of the resource
path - The resource path
locale - The locale
style - The style (see Session)
Returns:
The localized path

add

public final void add(java.lang.Class scope,
                      java.lang.String name,
                      java.util.Locale locale,
                      java.lang.String style,
                      Resource resource)
Parameters:
scope - Scope of resource
name - Logical name of resource
locale - The locale of the resource
style - The resource style (see Session)
resource - Resource to store

add

public final void add(java.lang.String name,
                      java.util.Locale locale,
                      Resource resource)
Parameters:
name - Logical name of resource
locale - The locale of the resource
resource - Resource to store

add

public final void add(java.lang.String name,
                      Resource resource)
Parameters:
name - Logical name of resource
resource - Resource to store

get

public final Resource get(java.lang.Class scope,
                          java.lang.String name,
                          java.util.Locale locale,
                          java.lang.String style,
                          boolean exact)
Parameters:
scope - The resource's scope
name - Name of resource to get
locale - The locale of the resource
style - The resource style (see Session)
exact - If true then only return the resource that is registerd for the given locale and style.
Returns:
The logical resource

get

public final Resource get(java.lang.String key)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT USE IT.

Parameters:
key - Shared resource key
Returns:
The resource

remove

public final void remove(java.lang.String key)
Removes a shared resource.

Parameters:
key - Shared resource key

onResourceRequested

public final void onResourceRequested(java.lang.String key)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. Called when a resource is requested.

Parameters:
key - Shared resource key


Copyright © 2004-2006 Wicket developers. All Rights Reserved.