com.sun.webui.theme
Class ThemeManager

java.lang.Object
  extended by com.sun.webui.theme.ThemeManager

public class ThemeManager
extends java.lang.Object

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.webui.jsf.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.webui.DefaultTheme.


Field Summary
static java.lang.String THEME_MANAGER
          The context attribute name used to place/retrieve the ThemeManager.
 
Method Summary
 java.lang.String getDefaultThemeName()
          Use this method to retrieve the name of the default Theme for the locale.
 com.sun.webui.theme.JarTheme getTheme(java.lang.String name, java.util.Locale locale)
          Retrieve a Theme instance for a Theme and for a specified locale.
 java.lang.String toString()
          String representation of this class
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

THEME_MANAGER

public static final java.lang.String THEME_MANAGER
The context attribute name used to place/retrieve the ThemeManager.

See Also:
Constant Field Values
Method Detail

getTheme

public com.sun.webui.theme.JarTheme 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.

Parameters:
name - The for which this Theme was created
locale - The locale for which the Theme instance is needed
Returns:
The Theme for the locale

getDefaultThemeName

public java.lang.String getDefaultThemeName()
Use this method to retrieve the name of the default Theme for the locale.

Returns:
The default Theme's name

toString

public java.lang.String toString()
String representation of this class

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this class


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.