| java.lang.Object com.sun.portal.providers.context.Theme
Theme | public class Theme (Code) | | A Theme is a collection of visual elements to be used when displaying a
desktop. For example, channel background color, font face etc.
Theme is a global setting (independent of channels) which a user can
select from a preset list or customizing to his/her perference.
The global preset list of themes is configured by the administrator and
it cannot be changed using this API. The custom theme is the theme
that each user can manipulate according to his/her perference. The
constant CUSTOM_THEME defined in this class is to refer to the custom theme.
Themes are stored as properties accessed through ProviderContext
. This class serves as a wrapper over ProviderContext
to encapsulate the implementation details of theme.
For details of the theme design and steps to configure the global
preset themes, please refer to the Desktop Customization Guide and the
Administrator's Guide.
See Also: com.sun.portal.providers.context.ProviderContext |
Field Summary | |
final public static String | CUSTOM_THEME Constant refering to the custom theme. |
Method Summary | |
public static String | getAttribute(String channel, ProviderContext pc, String theme, String name) Gets an attribute value of a theme. | public static String | getAttribute(String channel, ProviderContext pc, String theme, String name, String def) Gets an attribute value of a theme, if the attribute is not
defined, and a default value is given, then returns the default value. | public static String | getAttribute(String channel, ProviderContext pc, String name) Gets an attribute value of the selected theme. | public static Collection | getGlobal(String channel, ProviderContext pc) Gets the global list of preset theme that is available.
The list is configured by Portal admin. | public static Map | getMap(String channel, ProviderContext pc, String theme) Gets the attributes of a theme as a map.
The returned map has the attribute names as the keys and the theme
values as the values.
Parameters: ProviderContext - Parameters: theme - Theme name, either one from the preset list or CUSTOM_THEME for the custom theme. | public static String | getSelectedName(String channel, ProviderContext pc) Gets the theme name to be used for displaying desktop. | public static void | setCustomAttribute(String channel, ProviderContext pc, String name, String value) Sets an attribute value of the custom theme. | public static void | setSelectedName(String channel, ProviderContext pc, String name) Sets the theme to be used for displaying desktop. |
CUSTOM_THEME | final public static String CUSTOM_THEME(Code) | | Constant refering to the custom theme.
|
getAttribute | public static String getAttribute(String channel, ProviderContext pc, String theme, String name, String def) throws ProviderContextException(Code) | | Gets an attribute value of a theme, if the attribute is not
defined, and a default value is given, then returns the default value.
Parameters: ProviderContext - Parameters: theme - Theme name, either one from the preset list or CUSTOM_THEME for the custom theme. Parameters: name - Attribute name Parameters: def - the default value the attribute value as a String. exception: ProviderContextException - if an error occurs getting the attribute, orthe theme is not CUSTOM_THEME or one in the preset list. |
getMap | public static Map getMap(String channel, ProviderContext pc, String theme) throws ProviderContextException(Code) | | Gets the attributes of a theme as a map.
The returned map has the attribute names as the keys and the theme
values as the values.
Parameters: ProviderContext - Parameters: theme - Theme name, either one from the preset list or CUSTOM_THEME for the custom theme. The map that maps attribute names to attribute values of the theme. exception: ProviderContextException - if an error occurs in getting theattributes of the theme. |
setCustomAttribute | public static void setCustomAttribute(String channel, ProviderContext pc, String name, String value)(Code) | | Sets an attribute value of the custom theme.
This sets a value for the theme named CUSTOM_THEME
Parameters: ProviderContext - Parameters: name - Attribute name Parameters: value - Attribute value |
|
|