Class DelegatingThemeSource
- java.lang.Object
- org.springframework.ui.context.support.DelegatingThemeSource
- All Implemented Interfaces:
HierarchicalThemeSource,ThemeSource
public class DelegatingThemeSource extends Object implements HierarchicalThemeSource
Empty ThemeSource that delegates all calls to the parent ThemeSource. If no parent is available, it simply won't resolve any theme.Used as placeholder by UiApplicationContextUtils, if a context doesn't define its own ThemeSource. Not intended for direct use in applications.
- Since:
- 1.2.4
- Author:
- Juergen Hoeller
- See Also:
UiApplicationContextUtils
Constructor Summary
Constructors Constructor Description DelegatingThemeSource()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThemeSourcegetParentThemeSource()Return the parent of this ThemeSource, ornullif none.ThemegetTheme(String themeName)Return the Theme instance for the given theme name.voidsetParentThemeSource(ThemeSource parentThemeSource)Set the parent that will be used to try to resolve theme messages that this object can't resolve.
Constructor Detail
DelegatingThemeSource
public DelegatingThemeSource()
Method Detail
setParentThemeSource
public void setParentThemeSource(ThemeSource parentThemeSource)
Description copied from interface:HierarchicalThemeSourceSet the parent that will be used to try to resolve theme messages that this object can't resolve.- Specified by:
setParentThemeSourcein interfaceHierarchicalThemeSource- Parameters:
parentThemeSource- the parent ThemeSource that will be used to resolve messages that this object can't resolve. May benull, in which case no further resolution is possible.
getParentThemeSource
public ThemeSource getParentThemeSource()
Description copied from interface:HierarchicalThemeSourceReturn the parent of this ThemeSource, ornullif none.- Specified by:
getParentThemeSourcein interfaceHierarchicalThemeSource
getTheme
public Theme getTheme(String themeName)
Description copied from interface:ThemeSourceReturn 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:
getThemein interfaceThemeSource- Parameters:
themeName- the name of the theme- Returns:
- the corresponding Theme, or
nullif none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names. - See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME