com.sun.webui.theme
Class ThemeContext

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

public abstract class ThemeContext
extends java.lang.Object

ThemeContext encapsulates the runtime environment for theme. The runtime environment and dictates how information, required to locate theme resources, and make those resources available to an application, is obtained. For example:


Field Summary
static int NOVERSION
          If no version can be identified from one of the version methods, this constant is returned.
static java.lang.String SUPPORTED_LOCALES
          Deprecated.  
static java.lang.String THEME_MESSAGES
          Deprecated.  
 
Method Summary
 java.lang.ClassLoader getDefaultClassLoader()
          Return the ClassLoader that this ThemeContext should use when obtaining resources.
 java.util.Locale getDefaultLocale()
          Return the default locale for thee themes in this ThemeContext.
 java.lang.String getDefaultTheme()
          Return the the name of the default theme.
 int getDefaultThemeMajorVersion()
          Deprecated.  
 int getDefaultThemeMinorVersion()
          Deprecated.  
 java.lang.String getDefaultThemeVersion()
          Return the version of the default theme.
 java.lang.String getMessages()
          Deprecated.  
 java.lang.String getRequestContextPath()
          Return the application context path as a prefix that is prepended to theme resource path references.
 java.lang.String getResourcePath(java.lang.String path)
          Return a path used as a prefix that is prepended to a a theme resource path reference.
 java.util.Set getSupportedLocales()
          Deprecated.  
 ThemeFactory getThemeFactory()
           
 java.lang.String getThemeFactoryClassName()
          Return the class name of a ThemeFactory implementation.
 java.lang.String[] getThemeResources()
          Return bundle names of theme resources that augment a core theme.
 java.lang.String getThemeServletContext()
          Return a path prefix of a theme resource.
 void setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
          Set the ClassLoader that this ThemeContext should use when obtaining resources.
 void setDefaultLocale(java.util.Locale defaultLocale)
          Set the default locale for the themes in this ThemeContext.
 void setDefaultLocale(java.lang.String defaultLocale)
          Set the default locale for the themes in this ThemeContext.
 void setDefaultTheme(java.lang.String defaultTheme)
          Set the default theme name for this ThemeContext.
 void setDefaultThemeVersion(java.lang.String defaultThemeVersion)
          Set the version of the default theme.
 void setMessages(java.lang.String messages)
          Deprecated.  
 void setRequestContextPath(java.lang.String requestContextPath)
          Set the application context path prefix that is prepended to theme resource path references.
 void setSupportedLocales(java.util.Set supportedLocales)
          Deprecated.  
 void setThemeFactoryClassName(java.lang.String themeFactoryClassName)
          Set the class name of a ThemeFactory implementation.
 void setThemeResources(java.lang.String[] themeResources)
          Set the bundle names of theme resources that augment a core theme.
 void setThemeServletContext(java.lang.String themeServletContext)
          Set a path prefix of a theme resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THEME_MESSAGES

public static final java.lang.String THEME_MESSAGES
Deprecated. 
Identifies a theme messages bundle to override the message bundle in a theme.

See Also:
Constant Field Values

SUPPORTED_LOCALES

public static final java.lang.String SUPPORTED_LOCALES
Deprecated. 
Identifies a theme messages bundle to override the message bundle in a theme.

See Also:
Constant Field Values

NOVERSION

public static final int NOVERSION
If no version can be identified from one of the version methods, this constant is returned.

See Also:
Constant Field Values
Method Detail

getMessages

public java.lang.String getMessages()
Deprecated. 


setMessages

public void setMessages(java.lang.String messages)
Deprecated. 


getSupportedLocales

public java.util.Set getSupportedLocales()
Deprecated. 


setSupportedLocales

public void setSupportedLocales(java.util.Set supportedLocales)
Deprecated. 


getThemeFactory

public ThemeFactory getThemeFactory()

getThemeResources

public java.lang.String[] getThemeResources()
Return bundle names of theme resources that augment a core theme. These resources typically contain theme overrides and are referenced first before a default or core theme.


setThemeResources

public void setThemeResources(java.lang.String[] themeResources)
Set the bundle names of theme resources that augment a core theme. These resources typically contain theme overrides and are referenced first before a default or core theme.


getRequestContextPath

public java.lang.String getRequestContextPath()
Return the application context path as a prefix that is prepended to theme resource path references.


setRequestContextPath

public void setRequestContextPath(java.lang.String requestContextPath)
Set the application context path prefix that is prepended to theme resource path references.


getResourcePath

public java.lang.String getResourcePath(java.lang.String path)
Return a path used as a prefix that is prepended to a a theme resource path reference. This implementation returns getRequestContextPath() + getThemeServletContext().


setDefaultLocale

public void setDefaultLocale(java.util.Locale defaultLocale)
Set the default locale for the themes in this ThemeContext.


setDefaultLocale

public void setDefaultLocale(java.lang.String defaultLocale)
Set the default locale for the themes in this ThemeContext.


getDefaultLocale

public java.util.Locale getDefaultLocale()
Return the default locale for thee themes in this ThemeContext.


getDefaultClassLoader

public java.lang.ClassLoader getDefaultClassLoader()
Return the ClassLoader that this ThemeContext should use when obtaining resources.


setDefaultClassLoader

public void setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
Set the ClassLoader that this ThemeContext should use when obtaining resources.


getThemeFactoryClassName

public java.lang.String getThemeFactoryClassName()
Return the class name of a ThemeFactory implementation. This class will be used to instantiate an instance of a ThemeFactory.


setThemeFactoryClassName

public void setThemeFactoryClassName(java.lang.String themeFactoryClassName)
Set the class name of a ThemeFactory implementation. This class will be used to instantiate an instance of a ThemeFactory.


getDefaultTheme

public java.lang.String getDefaultTheme()
Return the the name of the default theme. If a requested resource cannot be found in a specified theme then the default theme will be used to obtain that resource.


setDefaultTheme

public void setDefaultTheme(java.lang.String defaultTheme)
Set the default theme name for this ThemeContext. If a requested resource cannot be found in a specified theme then the default theme will be used to obtain that resource.


getDefaultThemeVersion

public java.lang.String getDefaultThemeVersion()
Return the version of the default theme. If more than one version of the default theme exists, the theme instance with version equal to defaultThemeVersion will be used to obtain theme resources.


setDefaultThemeVersion

public void setDefaultThemeVersion(java.lang.String defaultThemeVersion)
Set the version of the default theme. If more than one version of the default theme exists, the defaultThemeVersion will be used to obtain Theme resources.


getThemeServletContext

public java.lang.String getThemeServletContext()
Return a path prefix of a theme resource. When trying to locate a specifc theme resource this prefix is prepending to the theme resource identifier to locate the resource. It is the same as the ThemeServlet's url-pattern, less any "/*" specification.


setThemeServletContext

public void setThemeServletContext(java.lang.String themeServletContext)
Set a path prefix of a theme resource. When trying to locate a specifc theme resource this prefix is prepending to the theme resource identifier to locate the resource. It is the same as the ThemeServlet's url-pattern, less any "/*" specification.


getDefaultThemeMajorVersion

public int getDefaultThemeMajorVersion()
Deprecated. 

Return the major version of the default theme version or ThemeContext.NOVERSION.


getDefaultThemeMinorVersion

public int getDefaultThemeMinorVersion()
Deprecated. 

Return the minor version of the default theme version or ThemeContext.NOVERSION.



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