The Theme and Woodstock Web Applications - Version @THEMEVERSION@

The Theme and Woodstock Component's Relationship at Runtime (cont.)

9 The Woodstock com.sun.webui.jsf.theme Package

9.1 The JSFThemeContext Class

9.2 The ThemeUtilities Class

9.3 The ThemeELResolver Class

9.4 The Theme Constants Classes

9.4.1 The ThemeJavascript Class

9.4.2 The ThemeImages Class

9.4.3 The ThemeTemplates Class Class

9.4.4 The ThemeStyles Class Class

9 The Woodstock com.sun.webui.jsf.theme Package

The classes in com.sun.webui.jsf.theme are implementations of com.sun.webui.theme interfaces or convenience classes to encapsulate commonly executed theme related code used by components or renderers or applications.

9.1 The JSFThemeContext Class

The JSFThemeContext is a subclass of and encapsulates the dependence on JSF and the servlet environment from the components. It is responsible for instantiating a ThemeContext instance if there is no instance available in the environment. It uses JSF interfaces to obtain the current locale and it sets the default ThemeFactory class and ClassLoader.

For more detailed information see JSFThemeContext javadoc.

9.2 The ThemeUtilities Class

The ThemeUtilities is class of convenience methods intended to be used by the Woodstock components to obtain a Theme instance, and other common tasks like getting an ImageComponent.

It does implement some policies. It caches the Theme instance as a request attribute under the assumption that the theme will not change during the request. At this point in the development changing themes in a request is not practical.

There was also a need to support legacy code that used a session attribute to store the theme name. This was intended to allow a controlling layer like an IDE to change the theme name. But that functionality now is provided by ThemeContext but legacy code has not been updated to use ThemeContext. This session attribute will prevent dynamically changing the active theme for an application at runtime, unless the session attribute is changed to reflect the theme change.

Note that this class is not intended for public use by web applications, but is intended solely for use by Woodstock components.

For more detailed information see ThemeUtilities javadoc.

9.3 The ThemeELResolver Class

The ThemeELResolver is a JSF property resolver and is configured in the faces-config.xml file in the webui-jsf.jar. This resolver can be used by application's to obtain theme resources using a value expression. The recognized variables are:

<webuijsf:markup tag="div" styleClass="#{themeStyles.CONTENT_MARGIN}">

For more detailed information see ThemeELResolver javadoc.

9.4 The Theme Constants Classes

The theme constants classes define public final constant String properties for literal string keys that define theme resources in the theme ResourceBundle Properties files.

9.4.1 The ThemeJavascript Class

The ThemeJavascript class defines constants for keys defined in the javascript.properties file.

The Javascript properties define files that must be loaded in every page, browser dependent files, name space prefixes and properties to control the Javascript client theme.

For more detailed information see ThemeJavascript javadoc.

9.4.2 The ThemeImages Class

The ThemeImages class defines constants for keys defined in the images.properties file.

The properties defined in images.properties define the image file path, dimensions, "ALT" and "TITLE" attribute text. The "ALT" and "TITLE" properties can refer to keys defined in messages.properties to support localized text. This reduces the need for locale variants for the image.properties file.

For more detailed information see ThemeImages javadoc.

9.4.3 The ThemeTemplates Class Class

The ThemeTemplates class defines constants for keys defined in the templates.properties file.

The properties defined in templates.properties define an html file that contains the markup for a Woodstock component that is implemented as a Javascript "widget". These components utilize "widget" renderers and not the HTML renderers used by other components.

For more detailed information see ThemeTemplates javadoc.

9.4.4 The ThemeStyles Class Class

The ThemeStyles class defines constants for keys defined in the styles.properties file. It also defines constants for the properties defined in the stylesheets.properties file.

The properties defined in styles.properties map a CSS selector defined in the style sheets to a logical name. This file is also called on occasion the "CLASSMAPPER".

For more detailed information see ThemeStyles javadoc.