Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework » ui » context » support » [javadoc | source]
org.springframework.ui.context.support
public class: ResourceBundleThemeSource [javadoc | source]
java.lang.Object
   org.springframework.ui.context.support.ResourceBundleThemeSource

All Implemented Interfaces:
    HierarchicalThemeSource

ThemeSource implementation that looks up an individual java.util.ResourceBundle per theme. The theme name gets interpreted as ResourceBundle basename, supporting a common basename prefix for all themes.
Field Summary
protected final  Log logger     
Method from org.springframework.ui.context.support.ResourceBundleThemeSource Summary:
createMessageSource,   getParentThemeSource,   getTheme,   initParent,   setBasenamePrefix,   setParentThemeSource
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.ui.context.support.ResourceBundleThemeSource Detail:
 protected MessageSource createMessageSource(String basename) 
    Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.

    Default implementation creates a ResourceBundleMessageSource. for the given basename. A subclass could create a specifically configured ReloadableResourceBundleMessageSource, for example.

 public ThemeSource getParentThemeSource() 
 public Theme getTheme(String themeName) 
    This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").

    SimpleTheme instances are cached per theme name. Use a reloadable MessageSource if themes should reflect changes to the underlying files.

 protected  void initParent(Theme theme) 
    Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.
 public  void setBasenamePrefix(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".

    Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

 public  void setParentThemeSource(ThemeSource parent)