com.interface21.ui.context.support
Class ResourceBundleThemeSource

java.lang.Object
  |
  +--com.interface21.ui.context.support.ResourceBundleThemeSource
All Implemented Interfaces:
NestingThemeSource, ThemeSource

public class ResourceBundleThemeSource
extends java.lang.Object
implements NestingThemeSource

ThemeSource implementation that looks up an individual ResourceBundle per theme. The theme name gets interpreted as ResourceBundle basename, supporting a common basename prefix for all themes.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
setBasenamePrefix(java.lang.String)

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
ResourceBundleThemeSource()
           
 
Method Summary
 Theme getTheme(java.lang.String themeName)
          Return the Theme instance for the given theme name.
protected  void initParent(Theme theme)
          Initialize the MessageSource of the given theme with the one from the respective parent of this ThemeSource.
 void setBasenamePrefix(java.lang.String basenamePrefix)
          Set the prefix that gets applied to the ResourceBundle basenames, i.e. the theme names.
 void setParent(ThemeSource parent)
          Set the parent that will be used to try to resolve theme messages that this object can't resolve.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

ResourceBundleThemeSource

public ResourceBundleThemeSource()
Method Detail

setParent

public void setParent(ThemeSource parent)
Description copied from interface: NestingThemeSource
Set the parent that will be used to try to resolve theme messages that this object can't resolve.
Specified by:
setParent in interface NestingThemeSource
Following copied from interface: com.interface21.ui.context.NestingThemeSource
Parameters:
parent - parent ThemeSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

setBasenamePrefix

public void setBasenamePrefix(java.lang.String basenamePrefix)
Set the prefix that gets applied to the ResourceBundle basenames, i.e. the theme names. E.g.: basenamePrefix="test.", themeName="theme" -> basename="test.theme".
Parameters:
basenamePrefix - prefix for ResourceBundle basenames

getTheme

public Theme getTheme(java.lang.String themeName)
Description copied from interface: ThemeSource
Return the Theme instance for the given theme name. The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).
Specified by:
getTheme in interface ThemeSource
Following copied from interface: com.interface21.ui.context.ThemeSource
Parameters:
themeName - name of the theme
Returns:
the respective Theme, or null if none defined

initParent

protected void initParent(Theme theme)
Initialize the MessageSource of the given theme with the one from the respective parent of this ThemeSource.


Rod Johnson and Spring contributors 2001-2003.