You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2010/08/06 05:04:19 UTC

svn commit: r982857 - in /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: skin/SkinStyleSheetParserUtils.java style/util/StyleUtils.java style/xml/parse/StyleSheetDocument.java

Author: jwaldman
Date: Fri Aug  6 03:04:18 2010
New Revision: 982857

URL: http://svn.apache.org/viewvc?rev=982857&view=rev
Log:
revert my previous checkin temporarily. It might have broken the ADF Faces tests.

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java?rev=982857&r1=982856&r2=982857&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java Fri Aug  6 03:04:18 2010
@@ -153,7 +153,6 @@ class SkinStyleSheetParserUtils
     return in.substring(firstCharIndex, length);
   }
 
-
   /**
    * Given a List of SkinStyleSheetNode, create StyleSheetEntry.
    * A StyleSheetEntry is an object that contains:
@@ -213,7 +212,7 @@ class SkinStyleSheetParserUtils
         List<PropertyNode> noTrPropertyList =
           resolvedProperties.getNoTrPropertyList();
 
-        if (StyleUtils.isIcon(selectorName))
+        if (_isIcon(selectorName))
         {
           // knock off the '.' if it is the first character.
           if (selectorName.charAt(0) == '.')
@@ -530,22 +529,6 @@ class SkinStyleSheetParserUtils
     // really an icon. But we don't want to hurt the person that didn't abide by the -icon rule
     // because this wasn't an enforced rule.
     //
-    // if the trRuleRefList is not empty, create IncludeStyleNodes.
-    List<IncludeStyleNode> includeStyleNodes = new ArrayList<IncludeStyleNode>();
-
-    for(String value : trRuleRefList)
-    {
-      // parse the value, which will be of this form:
-      // -tr-rule-ref: selector(".AFBaseFont:alias") selector(".Foo")
-      // where you have more than one selector in an -tr-rule-ref definition
-      // or -tr-rule-ref: selector(".AFBaseFont:alias")
-      // where you have only one selector in an -tr-rule-ref definition.
-      // I want each selector value to be an IncludeStyleNode.
-
-      _addIncludeStyleNodes(value, includeStyleNodes);
-
-    }
-
     if (selectorName != null)
     {
       // Create a styleNode that we will add to the IconNode.
@@ -553,7 +536,7 @@ class SkinStyleSheetParserUtils
         new StyleNode(null,
                       selectorName,
                       propertyNodeArray,
-                      includeStyleNodes.toArray(new IncludeStyleNode[0]),
+                      null, // TODO includeStyleNodes.toArray(new IncludeStyleNode[0]), TRINIDAD-17
                       null, //TODO jmw includePropertyNodes
                       inhibitedProperties
                       );
@@ -928,6 +911,25 @@ class SkinStyleSheetParserUtils
     return builder.toString();
     
   }
+
+  // returns true if the selectorName indicates that it is an icon.
+  private static boolean _isIcon(String selectorName)
+  {
+    if (selectorName == null)
+      return false;
+    // =-=jmw There is no good way to tell if this is an icon.
+    // for now, I look at the selector name.
+    // we do have some styles that have -icon- in the name, but it's
+    // not at the end which is how icons are determined.
+    // our icon names look like .AFWarningIcon:alias
+    // AFErrorIconStyle is a style.
+    // This supports pseudo-classes on icon definitions (e.g.,
+    // foo-icon:hover- or FooIcon:alias:hover)
+    // -icon: is a condition because it could be -icon:hover.
+    return  (selectorName.endsWith("-icon")  ||
+            (selectorName.indexOf("-icon:") > -1) ||
+            selectorName.indexOf("Icon:alias") > -1);
+  }
   
   private static class ResolvedSkinProperties
   {

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java?rev=982857&r1=982856&r2=982857&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java Fri Aug  6 03:04:18 2010
@@ -50,26 +50,6 @@ public class StyleUtils
 
     return selector;
   }
-  
-  
-  // returns true if the selectorName indicates that it is an icon.
-  public static boolean isIcon(String selectorName)
-  {
-    if (selectorName == null)
-      return false;
-    // =-=jmw There is no good way to tell if this is an icon.
-    // for now, I look at the selector name.
-    // we do have some styles that have -icon- in the name, but it's
-    // not at the end which is how icons are determined.
-    // our icon names look like .AFWarningIcon:alias
-    // AFErrorIconStyle is a style.
-    // This supports pseudo-classes on icon definitions (e.g.,
-    // foo-icon:hover- or FooIcon:alias:hover)
-    // -icon: is a condition because it could be -icon:hover.
-    return  (selectorName.endsWith("-icon")  ||
-            (selectorName.indexOf("-icon:") > -1) ||
-            selectorName.indexOf("Icon:alias") > -1);
-  }
 
   static private final String _DOUBLE_COLON = "::";
 }

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java?rev=982857&r1=982856&r2=982857&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java Fri Aug  6 03:04:18 2010
@@ -53,7 +53,6 @@ import org.apache.myfaces.trinidadintern
 import org.apache.myfaces.trinidadinternal.style.util.CSSUtils;
 import org.apache.myfaces.trinidadinternal.style.util.ModeUtils;
 import org.apache.myfaces.trinidadinternal.style.util.NameUtils;
-import org.apache.myfaces.trinidadinternal.style.util.StyleUtils;
 import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 
 
@@ -741,7 +740,7 @@ public class StyleSheetDocument
         }
       }        
     }
-    _resolveStyleWork(context, id, forIconNode, styleSheets, resolvedStyles, resolvedNamedStyles,  
+    _resolveStyleWork(context, forIconNode, styleSheets, resolvedStyles, resolvedNamedStyles,  
                       includesStack, namedIncludesStack, entry, nodeList);
     
     // Pop the include stack
@@ -787,7 +786,6 @@ public class StyleSheetDocument
 
   private void _resolveStyleWork(
     StyleContext context,
-    String       id,
     boolean      forIconNode,
     StyleSheetList styleSheets,
     Map<String, StyleNode> resolvedStyles,
@@ -852,22 +850,6 @@ public class StyleSheetDocument
 
           if (resolvedNode != null)
             _addIncludedProperties(entry, resolvedNode);
-          else 
-          {
-            // Fortunately this is an uncommon usecase
-            // af|foo::some-icon {content: url(); width:16px; height:16px} 
-            // // In SkinStyleSheetParserUtils, we are not sure if this is an icon or style 
-            // // since there is no explicit 'content' attr. So we create both an Icon and a Style.
-            // af|bar::some-icon {-tr-rule-ref: selector("af|foo");} 
-            if (_LOG.isFinest() && !forIconNode && StyleUtils.isIcon(includeID) && 
-                StyleUtils.isIcon(id))
-            {
-                _LOG.finest(id + " is being written to the CSS file " +
-                  "even though it is likely a Skin Icon Object, not a style.");
-  
-
-            }
-          }
         }