|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache
public class FileSystemStyleCache
The FileSystemStyleCache is a StyleProvider implementation which caches generated CSS style sheets on the file system. A FileSystemStyleCache object is for one Skin. The FileSystemStyleCache instance contains Entry objects for a Skin: one Entry object per unique generated CSS style sheet (e.g., gecko and ie will most likely have different generated CSS style sheets for the same Skin because these browsers tend to need different css rules). Note that StyleProviders are responsible for providing access both to style information (eg. getStyleSheetURI(), getStyles()) as well as to icons registered via style sheets (see getIcons()).
StyleProvider,
SkinStyleProvider| Constructor Summary | |
|---|---|
protected |
FileSystemStyleCache(java.lang.String target)
Creates a FileSystemStyleCache. |
| Method Summary | |
|---|---|
org.apache.myfaces.trinidad.style.Style |
_convertStyleNodeToStyle(StyleNode styleNode,
java.util.Map<org.apache.myfaces.trinidad.style.Style,org.apache.myfaces.trinidad.style.Style> reusableStyleMap)
Given a StyleNode object, which is an internal API that denotes a Style object with additional information like includedSelectors, create a simple public Style object which will be used in the SelectorStyleMap. |
protected StyleSheetDocument |
createStyleSheetDocument(StyleContext context)
Creates the StyleSheetDocument for this StyleProvider. |
java.lang.String |
getContentStyleType(StyleContext context)
Returns the mime type for the styles provided by this FileSystemStyleCache - "text/css". |
java.util.concurrent.ConcurrentMap<java.lang.String,org.apache.myfaces.trinidad.skin.Icon> |
getIcons(StyleContext context)
Implementation of StyleProvider.getIcons() |
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)
Implementation of StyleProvider.getSkinProperties() |
org.apache.myfaces.trinidad.style.Styles |
getStyles(StyleContext context)
Implementation of StyleProvider.getStyles(). |
java.util.List<java.lang.String> |
getStyleSheetURIs(StyleContext context)
Implementation of StyleCache.getStyleSheetURI(). |
protected java.lang.String |
getTargetStyleSheetName(StyleContext context,
StyleSheetDocument document)
Returns the name to use for the generated style sheet file . |
protected boolean |
hasSourceDocumentChanged(StyleContext context)
Tests whether the source style sheet files have been modified since the last call to createStyleSheetDocument(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected FileSystemStyleCache(java.lang.String target)
target - The path of the target directory. Generated
CSS files are stored in this directory. If the directory
does not exist and can not be created, an IllegalArgumentException
is thrown.- the subclass| Method Detail |
|---|
public java.lang.String getContentStyleType(StyleContext context)
getContentStyleType in interface StyleProviderpublic java.util.List<java.lang.String> getStyleSheetURIs(StyleContext context)
getStyleSheetURIs in interface StyleProvidercontext - The context which describes the end user
environment for this request
public org.apache.myfaces.trinidad.style.Styles getStyles(StyleContext context)
getStyles in interface StyleProviderpublic java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getSkinProperties(StyleContext context)
getSkinProperties in interface StyleProvidercontext - The context which describes the target end user
environment
public java.util.concurrent.ConcurrentMap<java.lang.String,org.apache.myfaces.trinidad.skin.Icon> getIcons(StyleContext context)
getIcons in interface StyleProvidercontext - The context which describes the target end user
environment
public java.util.Map<java.lang.String,java.lang.String> getShortStyleClasses(StyleContext context)
FileSystemStyleCache automatically generates short versions of every style class that is found the the underlying XSS document. FileSystemStyleCache clients can reduce the size of generated content by using this method to obtain short versions of any rendered style classes.
Note: The returned Map uses String keys to represent the full class names. However, the short style class values may not necessarily be type java.lang.String. Clients must avoid explicitly casting the values contained in the Map to type String. Instead, such values should be passed directly to the ResponseWriter API to be rendered. Or, if the String representation is required, toString() should be called on the value.
getShortStyleClasses in interface StyleProvidercontext - The StyleContext
protected StyleSheetDocument createStyleSheetDocument(StyleContext context)
context - The StyleContext
(not needed here, but is needed in subclass)
org.apache.myfaces.trinidadinternal.skin.SkinStyleProvider#createStyleSheetDocument(context)protected boolean hasSourceDocumentChanged(StyleContext context)
protected java.lang.String getTargetStyleSheetName(StyleContext context,
StyleSheetDocument document)
context - The StyleContextdocument - The StyleSheetDocument which provides the styles
public org.apache.myfaces.trinidad.style.Style _convertStyleNodeToStyle(StyleNode styleNode,
java.util.Map<org.apache.myfaces.trinidad.style.Style,org.apache.myfaces.trinidad.style.Style> reusableStyleMap)
styleNode - reusableStyleMap - A Map