org.apache.myfaces.trinidadinternal.style.util
Class CSSGenerationUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.style.util.CSSGenerationUtils

public class CSSGenerationUtils
extends java.lang.Object

CSS-generation related utilities used when we write out our css-2 stylesheet document based on the skin's css-3 stylesheet document.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/util/CSSUtils.java#0 $) $Date: 10-nov-2005.18:58:49 $
Author:
The Oracle ADF Faces Team

Constructor Summary
CSSGenerationUtils()
           
 
Method Summary
static java.util.Iterator<java.lang.String> getNamespacedSelectors(java.lang.String selector, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> afSelectorMap)
          Called when creating the shortened styleclass map.
static void getNamespacePrefixes(java.util.Set<java.lang.String> namespacePrefixes, java.lang.String selector)
          Add to the namespacePrefixes Set any namespace prefixes found in this selector.
static java.util.Iterator<java.lang.String> getStyleClasses(java.lang.String selector)
          Returns an Iterator of all of the style class selectors included in the specified selector.
static boolean isSingleStyleClassSelector(java.lang.String selector)
          Tests whether the specified selector is a single style class selector.
static void writeCSS(StyleContext context, StyleNode[] styles, java.io.PrintWriter out, boolean compressStyles, java.util.Map<java.lang.String,java.lang.String> shortStyleClassMap, java.lang.String[] namespacePrefixArray, java.util.Map<java.lang.String,java.lang.String> afSelectorMap)
          Converts the specified set of StyleNodes to CSS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSGenerationUtils

public CSSGenerationUtils()
Method Detail

writeCSS

public static void writeCSS(StyleContext context,
                            StyleNode[] styles,
                            java.io.PrintWriter out,
                            boolean compressStyles,
                            java.util.Map<java.lang.String,java.lang.String> shortStyleClassMap,
                            java.lang.String[] namespacePrefixArray,
                            java.util.Map<java.lang.String,java.lang.String> afSelectorMap)
Converts the specified set of StyleNodes to CSS. We output either full styleclass names or compressed styleclass names.

Parameters:
context - The current StyleContext
styles - The style nodes to convert
out - The PrintWriter to write to
compressStyles - This tells us whether or not we want to output the short names.
shortStyleClassMap - A Map which maps style class names to short names.
namespacePrefixArray - an array with the namespace prefixes of our special selectors. e.g., "af|" or "tr|" .
afSelectorMap - A Map which maps the namespaced component selectors to their base names (e.g., 'af|menuPath::step' maps to 'af|menuPath A')

isSingleStyleClassSelector

public static boolean isSingleStyleClassSelector(java.lang.String selector)
Tests whether the specified selector is a single style class selector. A single style class selector is something like ".AFInstructionText". Examples that are not single style class selectors are "af|inputText" or ".AFFoo .AFBar" or ".foo:hover"


getStyleClasses

public static java.util.Iterator<java.lang.String> getStyleClasses(java.lang.String selector)
Returns an Iterator of all of the style class selectors included in the specified selector. For example, ".OraNav1Enabled" returns a single element Iterator with the string "OraNav1Enabled". "P.OraNav1Enabled SPAN.text" returns a two element Iterator with "OraNav1Enabled" and "text". .OraLink:visited returns "OraLink" .star.moon returns "star" and "moon"


getNamespacedSelectors

public static java.util.Iterator<java.lang.String> getNamespacedSelectors(java.lang.String selector,
                                                                          java.lang.String namespace,
                                                                          java.util.Map<java.lang.String,java.lang.String> afSelectorMap)
Called when creating the shortened styleclass map. Returns an Iterator of all of the component selectors that begin with the given namespace. All styleclasses and pseudo-classes are ignored and NOT returned. For example, ".OraNav1Enabled af|menuPath" returns a single element Iterator with the string "af|menuPath". "af|menuPath.OraNav1Enabled af|treeTable.text" returns a two element Iterator with "af|menuPath" and "af|treeTable". af|inputText:disabled af|inputText::content returns two "af|inputText" and "af|inputText::content". It also looks at the afSelectorMap to map any special selectors if necessary. e.g., "af|menuPath::step" maps to "af|menuPath A", so ".OraNav1Enabled af|menuPath::step" returns "af|menuPath"


getNamespacePrefixes

public static void getNamespacePrefixes(java.util.Set<java.lang.String> namespacePrefixes,
                                        java.lang.String selector)
Add to the namespacePrefixes Set any namespace prefixes found in this selector.

Parameters:
namespacePrefixes -
selector -


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.