org.apache.myfaces.trinidadinternal.style
Interface StyleProvider

All Known Implementing Classes:
FileSystemStyleCache, SkinStyleProvider

public interface StyleProvider

The StyleProvider API is used to access context-dependent style information. Style information is exposed in two ways - as CSS style sheet URIs (via getStyleSheetURI()), or as Style objects (via getStyles()). Both methods take a StyleContext object, which describes the target end user environment. In addition to providing access to style-related information, the StyleProvider also provides access to Icons which are defined within style sheets via the getIcons() API.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/StyleProvider.java#0 $) $Date: 10-nov-2005.18:57:58 $
See Also:
StyleContext, Styles, org.apache.myfaces.trinidad.Style

Method Summary
 java.lang.String getContentStyleType(StyleContext context)
          Returns the mime type (for example, "text/css") of the styles defined by the StyleProvider.
 java.util.concurrent.ConcurrentMap<java.lang.String,org.apache.myfaces.trinidad.skin.Icon> getIcons(StyleContext context)
          Returns a map of icon names to Icon instances.
 java.util.Map<java.lang.String,java.lang.String> getShortStyleClasses(StyleContext context)
          Returns a Map which maps style class names to equivalent shorter names.
 java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getSkinProperties(StyleContext context)
          Returns a map of skin property keys to skin property Object instances.
 org.apache.myfaces.trinidad.style.Styles getStyles(StyleContext context)
          Return the Styles object that is attached to this StyleProvider.
 java.util.List<java.lang.String> getStyleSheetURIs(StyleContext context)
          Returns the URI of the CSS style sheet to use for the end user environment specified via the StyleContext.
 

Method Detail

getContentStyleType

java.lang.String getContentStyleType(StyleContext context)
Returns the mime type (for example, "text/css") of the styles defined by the StyleProvider.


getShortStyleClasses

java.util.Map<java.lang.String,java.lang.String> getShortStyleClasses(StyleContext context)
Returns a Map which maps style class names to equivalent shorter names.

Parameters:
context - The StyleContext
Returns:
A Map which maps the full style class names to the shorter equivalents.

getStyleSheetURIs

java.util.List<java.lang.String> getStyleSheetURIs(StyleContext context)
Returns the URI of the CSS style sheet to use for the end user environment specified via the StyleContext.

Parameters:
context - The context which describes the end user environment for this request
Returns:
A list of CSS style sheet URIs

getStyles

org.apache.myfaces.trinidad.style.Styles getStyles(StyleContext context)
Return the Styles object that is attached to this StyleProvider. You can use the Styles object to retrieve a map of the skin selectors and their css properties, already resolved for this specific request. A skin has selectors for all agents, locales, etc., and there might be blocks for ie-only or gecko-only or rtl, etc., and the resolved styles are styles for the specific request (agent, locale, aliases are merged, etc).

Returns:

getIcons

java.util.concurrent.ConcurrentMap<java.lang.String,org.apache.myfaces.trinidad.skin.Icon> getIcons(StyleContext context)
Returns a map of icon names to Icon instances. The returned map is both mutable and threadsafe. This allows request/context-specific icons to be cached on the icon map.

Parameters:
context - The context which describes the target end user environment
Returns:
A ConcurrentMap which exposes the Icons for the specified context.

getSkinProperties

java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getSkinProperties(StyleContext context)
Returns a map of skin property keys to skin property Object instances. The returned map is both mutable and threadsafe. This allows request/context-specific skin properties to be cached on the skin property map.

Parameters:
context - The context which describes the target end user environment
Returns:
A ConcurrentMap which exposes the skin properties for the specified context.


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.