|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.theme.ThemeManager
public class ThemeManager
The ThemeManager manages the locale specific versions of each Theme. The ThemeManager is created by the ThemeConfigurationListener and placed in an application parameter of the same name as the theme itself.
Components do not need to interact
with the ThemeManager directly - use
com.sun.rave.web.ui.util.ThemeUtilities
instead.
To specify a default theme, set it in a context
init parameter in the deployment descriptor. Use
the parameter name com.sun.rave.web.ui.DefaultTheme
.
Field Summary | |
---|---|
static java.lang.String |
THEME_MANAGER
The context attribute name used to place/retrieve the ThemeManager. |
Constructor Summary | |
---|---|
protected |
ThemeManager()
Constructor for the ThemeManager |
Method Summary | |
---|---|
protected void |
addThemeMap(java.lang.String name,
java.util.Map themeMap)
This method adds a named Theme to the ThemeManager. |
java.lang.String |
getDefaultThemeName()
Use this method to retrieve the name of the default Theme for the locale. |
Theme |
getTheme(java.lang.String name,
java.util.Locale locale)
Retrieve a Theme instance for a Theme and for a specified locale. |
protected void |
setDefaultLocale(java.util.Locale defaultLocale)
Use this method to specify the default locale for the web application |
protected void |
setDefaultThemeName(java.lang.String name)
Use this method to specify the default theme for the web application |
java.lang.String |
toString()
String representation of this class |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String THEME_MANAGER
Constructor Detail |
---|
protected ThemeManager()
Method Detail |
---|
protected void addThemeMap(java.lang.String name, java.util.Map themeMap)
name
- The name for which this Theme was createdthemeMap
- The mapObject of themespublic Theme getTheme(java.lang.String name, java.util.Locale locale)
Retrieve a Theme instance for a Theme and for a specified locale.
If no Theme instances can be found for the specified name, the method uses the name of the default theme instead. If no default theme has been specified, any available theme name will be used. If none is found, a ThemeConfigurationException is thrown.
If no Theme instance can be found for the locale, the default locale
from the faces-config.xml
file is used. If no default theme
was specified, any theme instance will be used. If no theme instances
are found, a ThemeConfigurationException is thrown.
name
- The for which this Theme was createdlocale
- The locale for which the Theme instance is needed
protected void setDefaultThemeName(java.lang.String name)
name
- The name of the default Themeprotected void setDefaultLocale(java.util.Locale defaultLocale)
defaultLocale
- The defaultLocalepublic java.lang.String getDefaultThemeName()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |