com.sun.webui.theme
Interface ThemeFactory


public interface ThemeFactory

The ThemeFactory interface defines methods that return Theme instances.

A ThemeFactory also defines how theme data is provided to an application. For example a jar file may be used to bundle the various resources such image files, JavaScipt files, CSS style sheet files, ResourceBundles and/or Properties files.

A ThemeFactory implementation may also provide a default theme policy, i.e. in the presence of multiple concrete theme implementations, choose one to be the default source, if there is no request for a specific theme.


Field Summary
static java.lang.String CLASSMAPPER
          Deprecated.  
static java.lang.String COMPONENTS_SECTION
          Deprecated.  
static java.lang.String DEFAULT
          Deprecated.  
static java.lang.String FILENAME
          Deprecated.  
static java.lang.String IMAGES
          Deprecated.  
static java.lang.String JSFILES
          Deprecated.  
static java.lang.String MANIFEST
          Deprecated.  
static java.lang.String MESSAGES
          Deprecated.  
static java.lang.String NAME
          Deprecated.  
static java.lang.String PREFIX
          Deprecated.  
static java.lang.String STYLESHEETS
          Deprecated.  
static java.lang.String TEMPLATES
          Deprecated.  
static java.lang.String THEME_SECTION
          Deprecated.  
static java.lang.String THEME_VERSION
          Deprecated.  
static java.lang.String THEME_VERSION_REQUIRED
          Deprecated.  
 
Method Summary
 java.lang.String getDefaultThemeName(ThemeContext themeContext)
          Return the name of the default concrete theme this ThemeFactory implementation will choose when no theme name is explicitly requested.
 Theme getTheme(java.util.Locale locale, java.lang.String version, ThemeContext themeContext)
          Return the default Theme instance with version version for locale in the themeContext runtime environment.
 Theme getTheme(java.util.Locale locale, ThemeContext themeContext)
          Return the default Theme instance for locale in the themeContext runtime environment.
 Theme getTheme(java.lang.String themeName, java.util.Locale locale, ThemeContext themeContext)
          Return the Theme instance named themeName for locale in the themeContext runtime environment.
 Theme getTheme(java.lang.String themeName, java.lang.String version, java.util.Locale locale, ThemeContext themeContext)
          Return the Theme instance named themeName with version version for locale in the themeContext runtime environment.
 

Field Detail

MANIFEST

static final java.lang.String MANIFEST
Deprecated. 
See Also:
Constant Field Values

FILENAME

static final java.lang.String FILENAME
Deprecated. 
See Also:
Constant Field Values

COMPONENTS_SECTION

static final java.lang.String COMPONENTS_SECTION
Deprecated. 
See Also:
Constant Field Values

THEME_SECTION

static final java.lang.String THEME_SECTION
Deprecated. 
See Also:
Constant Field Values

THEME_VERSION_REQUIRED

static final java.lang.String THEME_VERSION_REQUIRED
Deprecated. 
See Also:
Constant Field Values

THEME_VERSION

static final java.lang.String THEME_VERSION
Deprecated. 
See Also:
Constant Field Values

NAME

static final java.lang.String NAME
Deprecated. 
See Also:
Constant Field Values

PREFIX

static final java.lang.String PREFIX
Deprecated. 
See Also:
Constant Field Values

DEFAULT

static final java.lang.String DEFAULT
Deprecated. 
See Also:
Constant Field Values

STYLESHEETS

static final java.lang.String STYLESHEETS
Deprecated. 
See Also:
Constant Field Values

JSFILES

static final java.lang.String JSFILES
Deprecated. 
See Also:
Constant Field Values

CLASSMAPPER

static final java.lang.String CLASSMAPPER
Deprecated. 
See Also:
Constant Field Values

IMAGES

static final java.lang.String IMAGES
Deprecated. 
See Also:
Constant Field Values

MESSAGES

static final java.lang.String MESSAGES
Deprecated. 
See Also:
Constant Field Values

TEMPLATES

static final java.lang.String TEMPLATES
Deprecated. 
See Also:
Constant Field Values
Method Detail

getTheme

Theme getTheme(java.util.Locale locale,
               ThemeContext themeContext)
Return the default Theme instance for locale in the themeContext runtime environment.

Parameters:
locale - the current Locale in effect.
themeContext - the theme runtime environment
Returns:
the name of the default theme.

getTheme

Theme getTheme(java.lang.String themeName,
               java.util.Locale locale,
               ThemeContext themeContext)
Return the Theme instance named themeName for locale in the themeContext runtime environment.

Parameters:
themeName - the name of the desired Theme instance.
locale - the current Locale in effect.
themeContext - the theme runtime environment
Returns:
the name of the default theme.

getTheme

Theme getTheme(java.util.Locale locale,
               java.lang.String version,
               ThemeContext themeContext)
Return the default Theme instance with version version for locale in the themeContext runtime environment.

Parameters:
locale - the current Locale in effect.
version - the version of the desired Theme instance.
themeContext - the theme runtime environment
Returns:
the name of the default theme.

getTheme

Theme getTheme(java.lang.String themeName,
               java.lang.String version,
               java.util.Locale locale,
               ThemeContext themeContext)
Return the Theme instance named themeName with version version for locale in the themeContext runtime environment.

Parameters:
themeName - the name of the desired Theme instance.
version - the version of the desired Theme instance.
locale - the current Locale in effect.
themeContext - the theme runtime environment
Returns:
the name of the default theme.

getDefaultThemeName

java.lang.String getDefaultThemeName(ThemeContext themeContext)
Return the name of the default concrete theme this ThemeFactory implementation will choose when no theme name is explicitly requested.

Parameters:
themeContext - the theme runtime environment
Returns:
the name of the default theme.


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