incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r523515 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: skin/ style/xml/ style/xml/parse/
Date Thu, 29 Mar 2007 00:19:14 GMT
Author: jwaldman
Date: Wed Mar 28 17:19:12 2007
New Revision: 523515

URL: http://svn.apache.org/viewvc?view=rev&rev=523515
Log:
remove CompoundPropertyNode.java and CompoundPropertyNodeParser.java
and the references to it. This was not being used and not having it simplifies the code.

Removed:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNodeParser.java
Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java?view=diff&rev=523515&r1=523514&r2=523515
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
Wed Mar 28 17:19:12 2007
@@ -642,7 +642,6 @@
       new StyleNode(name,
                     selector,
                     propertyArray,
-                    null,
                     includeStyleNodes.toArray(new IncludeStyleNode[0]),
                     null,
                     inhibitedProperties);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java?view=diff&rev=523515&r1=523514&r2=523515
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
Wed Mar 28 17:19:12 2007
@@ -43,7 +43,6 @@
 import org.apache.myfaces.trinidadinternal.style.xml.parse.ColorNode;
 import org.apache.myfaces.trinidadinternal.style.xml.parse.ColorSchemeNode;
 import org.apache.myfaces.trinidadinternal.style.xml.parse.IncludePropertyNode;
-import org.apache.myfaces.trinidadinternal.style.xml.parse.CompoundPropertyNode;
 import org.apache.myfaces.trinidadinternal.style.xml.parse.PropertyNode;
 import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleNode;
 import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument;
@@ -208,9 +207,6 @@
       _registerFactory(manager, PropertyNode.class, "PropertyNode");
       _registerFactory(manager, ColorNode.class, "ColorNode");
       _registerFactory(manager, ColorSchemeNode.class, "ColorSchemeNode");
-      _registerFactory(manager,
-                       CompoundPropertyNode.class,
-                       "CompoundPropertyNode");
       _registerFactory(manager,
                        IncludePropertyNode.class,
                        "IncludePropertyNode");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java?view=diff&rev=523515&r1=523514&r2=523515
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
Wed Mar 28 17:19:12 2007
@@ -43,7 +43,6 @@
     this(style._name,
          style._selector,
          properties,
-         style._compoundProperties,
          style._includedStyles,
          style._includedProperties,
          null);
@@ -56,7 +55,6 @@
     String                 name,
     String                 selector,
     PropertyNode[]         properties,
-    CompoundPropertyNode[] compoundProperties,
     IncludeStyleNode[]     includedStyles,
     IncludePropertyNode[]  includedProperties,
     Set<String>            inhibitedProperties
@@ -65,7 +63,6 @@
     this(name,
          selector,
          properties,
-         compoundProperties,
          includedStyles,
          includedProperties,
          inhibitedProperties,
@@ -79,7 +76,6 @@
     String                 name,
     String                 selector,
     PropertyNode[]         properties,
-    CompoundPropertyNode[] compoundProperties,
     IncludeStyleNode[]     includedStyles,
     IncludePropertyNode[]  includedProperties,
     Set<String>            inhibitedProperties,
@@ -97,15 +93,6 @@
       System.arraycopy(properties, 0, _properties, 0, properties.length);
     }
 
-    if (compoundProperties != null)
-    {
-      _compoundProperties =
-        new CompoundPropertyNode[compoundProperties.length];
-      System.arraycopy(compoundProperties, 0,
-                       _compoundProperties, 0,
-                       compoundProperties.length);
-    }
-
     if (includedStyles != null)
     {
       _includedStyles = new IncludeStyleNode[includedStyles.length];
@@ -168,8 +155,6 @@
   {
     if (_properties != null && _properties.length > 0)
       return false;
-    if (_compoundProperties != null && _compoundProperties.length > 0)
-      return false;
     if (_includedStyles != null && _includedStyles.length > 0)
       return false;
     if (_includedProperties != null && _includedProperties.length > 0)
@@ -192,20 +177,6 @@
   }
 
   /**
-   * Returns an Iterator containing Strings and IncludePropertyNodes.
-   */
-  public Iterator<CompoundPropertyNode> getCompoundProperties()
-  {
-    if (_compoundProperties == null) 
-    {
-      List<CompoundPropertyNode> list = Collections.emptyList();
-      return list.iterator();
-    }
-    else
-      return (Arrays.asList(_compoundProperties)).iterator();
-  }
-
-  /**
    * Returns an Iterator of IncludeStyleNodes.
    */
   public Iterator<IncludeStyleNode> getIncludedStyles()
@@ -281,7 +252,6 @@
   private String                 _name;
   private String                 _selector;
   private PropertyNode[]         _properties;          // The property nodes
-  private CompoundPropertyNode[] _compoundProperties;  // Compound properties
   private IncludeStyleNode[]     _includedStyles;      // Included styles
   private IncludePropertyNode[]  _includedProperties;  // Included properties
   private List<String>           _inhibitedProperties; // Inhibited properties

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java?view=diff&rev=523515&r1=523514&r2=523515
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
Wed Mar 28 17:19:12 2007
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -82,14 +82,6 @@
       _properties.copyInto(properties);
     }
 
-    CompoundPropertyNode[] compoundProperties = null;
-    if (_compoundProperties != null)
-    {
-      compoundProperties =
-        new CompoundPropertyNode[_compoundProperties.size()];
-      _compoundProperties.copyInto(compoundProperties);
-    }
-
     IncludeStyleNode[] includedStyles = null;
     if (_includedStyles != null)
     {
@@ -107,7 +99,6 @@
     return new StyleNode(_name,
                          _selector,
                          properties,
-                         compoundProperties,
                          includedStyles,
                          includedProperties,
                          null,
@@ -132,12 +123,6 @@
     {
       return context.getParser(PropertyNode.class, namespaceURI, localName);
     }
-    else if (localName.equals(COMPOUND_PROPERTY_NAME))
-    {
-      return context.getParser(CompoundPropertyNode.class,
-                               namespaceURI,
-                               localName);
-    }
     else if (localName.equals(INCLUDE_PROPERTY_NAME))
     {
       return context.getParser(IncludePropertyNode.class,
@@ -197,22 +182,6 @@
           _properties.addElement((PropertyNode)child);
       }
     }
-    else if (localName.equals(COMPOUND_PROPERTY_NAME))
-    {
-      if (!(child instanceof CompoundPropertyNode))
-      {
-        throw new IllegalArgumentException("child not instance of CompoundPropertyNode");
-      }
-
-      if (child instanceof CompoundPropertyNode)
-      {
-        if (_compoundProperties == null)
-          _compoundProperties = new Vector<CompoundPropertyNode>();
-
-        _compoundProperties.addElement((CompoundPropertyNode)child);
-      }
-
-    }
     else if (localName.equals(INCLUDE_PROPERTY_NAME))
     {
       if (!(child instanceof IncludePropertyNode))
@@ -236,7 +205,6 @@
   // -= Simon Lessard =-
   // TODO: Check if synchronization is truly required
   private Vector<PropertyNode>  _properties;
-  private Vector<CompoundPropertyNode>  _compoundProperties;
   private Vector<IncludeStyleNode>  _includedStyles;
   private Vector<IncludePropertyNode>  _includedProperties;
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java?view=diff&rev=523515&r1=523514&r2=523515
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
Wed Mar 28 17:19:12 2007
@@ -500,10 +500,8 @@
             //    into our StyleEntry.
             // 2. Resolve any included properties, and shove those properties
             //    into our StyleEntry.
-            // 3. Resolve all compound properites, and shove those properties
-            //    into the StyleEntry
-            // 4. Remove all properties that were inhibited.
-            // 5. Shove all properties from the matching StyleNode into our
+            // 3. Remove all properties that were inhibited.
+            // 4. Shove all properties from the matching StyleNode into our
             //    StyleEntry, overwriting included values
             // -= Simon Lessard =-
             // FIXME: That sequence looks buggy. If more than 1 matching node 
@@ -593,80 +591,7 @@
               }
             }
 
-            // 3. Add compound properties
-            Iterator<CompoundPropertyNode> compoundProperties = 
-              node.getCompoundProperties();
-            
-            if (compoundProperties != null)
-            {
-              while (compoundProperties.hasNext())
-              {
-                CompoundPropertyNode compoundProperty = compoundProperties.next();
-
-                // Build up the value String for the compound property
-                StringBuffer buffer = new StringBuffer();
-                Iterator<Object> values = compoundProperty.getValues();
-                if (values != null)
-                {
-                  while (values.hasNext())
-                  {
-                    Object o = values.next();
-
-                    if (buffer.length() != 0)
-                      buffer.append(' ');
-
-                    if (o instanceof String)
-                      buffer.append((String)o);
-                    else if (o instanceof IncludePropertyNode)
-                    {
-                      IncludePropertyNode includeProperty =
-                        (IncludePropertyNode)o;
-
-                      String includeID = null;
-                      boolean includeIsNamed = false;
-
-                      if (includeProperty.getName() != null)
-                      {
-                        includeID = includeProperty.getName();
-                        includeIsNamed = true;
-                      }
-                      else
-                      {
-                        includeID = includeProperty.getSelector();
-                      }
-
-                      StyleNode resolvedStyle =
-                        _resolveStyle(context,
-                                      styleSheets,
-                                      resolvedStyles,
-                                      resolvedNamedStyles,
-                                      includesStack,
-                                      namedIncludesStack,
-                                      includeID,
-                                      includeIsNamed);
-
-                      if (resolvedStyle != null)
-                      {
-                        String value = _getPropertyValue(resolvedStyle,
-                                            includeProperty.getPropertyName());
-                        if (value != null)
-                          buffer.append(value);
-                      }
-
-                    }
-                    else
-                    {
-                      assert false;
-                    }
-                  }
-                }
-
-                entry.addProperty(new PropertyNode(compoundProperty.getName(),
-                                                   buffer.toString()));
-              }
-            }
-
-            // 4. Check inhibited properties
+            // 3. Check inhibited properties
             Iterator<String> inhibitedProperties = node.getInhibitedProperties();
             while (inhibitedProperties.hasNext())
             {
@@ -674,7 +599,7 @@
             }
             
 
-            // 5. Add non-included properties
+            // 4. Add non-included properties
             Iterator<PropertyNode> properties = node.getProperties();
             if (properties != null)
             {
@@ -890,10 +815,10 @@
 
     if (isNamed)
     {
-      return new StyleNode(key, null, nodes, null, null, null, null);
+      return new StyleNode(key, null, nodes, null, null, null);
     }
     
-    return new StyleNode(null, key, nodes, null, null, null, null);
+    return new StyleNode(null, key, nodes, null, null, null);
   }
 
   // Tests whether the value is present in the (possibly null) stack.
@@ -1147,7 +1072,7 @@
 
       // Create and return our StyleNode.  We don't need to specify
       // a name or included styles, as they have already been resolved.
-      return new StyleNode(name, selector, properties, null, null, null, null);
+      return new StyleNode(name, selector, properties, null, null, null);
     }
 
     // Tests whether a property with the specified name is
@@ -1532,7 +1457,6 @@
   // A StyleNode used as a placeholder for a style which couldn't be resolved
   private static final StyleNode _ERROR_STYLE_NODE = new StyleNode("error",
                                                                    "error",
-                                                                   null,
                                                                    null,
                                                                    null,
                                                                    null,



Mime
View raw message