public class DelegatingThemeSource extends java.lang.Object implements HierarchicalThemeSource
Used as placeholder by UiApplicationContextUtils, if a context doesn't define its own ThemeSource. Not intended for direct use in applications.
UiApplicationContextUtils
Constructor and Description |
---|
DelegatingThemeSource() |
Modifier and Type | Method and Description |
---|---|
ThemeSource |
getParentThemeSource()
Return the parent of this ThemeSource, or
null if none. |
Theme |
getTheme(java.lang.String themeName)
Return the Theme instance for the given theme name.
|
void |
setParentThemeSource(ThemeSource parentThemeSource)
Set the parent that will be used to try to resolve theme messages
that this object can't resolve.
|
public void setParentThemeSource(@Nullable ThemeSource parentThemeSource)
HierarchicalThemeSource
setParentThemeSource
in interface HierarchicalThemeSource
parentThemeSource
- the 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.@Nullable public ThemeSource getParentThemeSource()
HierarchicalThemeSource
null
if none.getParentThemeSource
in interface HierarchicalThemeSource
@Nullable public Theme getTheme(java.lang.String themeName)
ThemeSource
The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).
getTheme
in interface ThemeSource
themeName
- the name of the themenull
if 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.AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME