incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r418880 [3/3] - in /incubator/adffaces/branches/matzew-mock-overhaul/adf-faces: adf-faces-api/src/main/java-templates/org/apache/myfaces/adf/component/ adf-faces-api/src/main/java/org/apache/myfaces/adf/component/ adf-faces-api/src/main/jav...
Date Tue, 04 Jul 2006 00:14:55 GMT
Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/FacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/FacesContextFactoryImpl.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/FacesContextFactoryImpl.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/FacesContextFactoryImpl.java Mon Jul  3 17:14:52 2006
@@ -13,212 +13,212 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.context;
-
-import java.io.IOException;
-
-import java.util.Iterator;
-
-import javax.faces.application.Application;
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.FacesContextFactory;
-import javax.faces.context.ResponseStream;
-import javax.faces.context.ResponseWriter;
-import javax.faces.lifecycle.Lifecycle;
-import javax.faces.render.RenderKit;
-
-import org.apache.myfaces.adf.logging.ADFLogger;
-import org.apache.myfaces.adf.context.AdfFacesContext;
-
-/**
- * Internal class that optimizes retrieval of the RenderKit by caching it
- * on the FacesContext, and hooks ExternalContext.dispatch()
- * to use the PageResolver.
- * <p>
- * @author The Oracle ADF Faces Team
- */
-public class FacesContextFactoryImpl
-  extends FacesContextFactory
-{
-  public FacesContextFactoryImpl(FacesContextFactory factory)
-  {
-    _factory = factory;
-  }
-
-  public FacesContext getFacesContext(Object context, Object request,
-                                      Object response, Lifecycle lifecycle)
-  {
-    return new CacheRenderKit(_factory.getFacesContext(context,
-                                                       request,
-                                                       response,
-                                                       lifecycle));
-  }
-
-  static private class CacheRenderKit extends FacesContext
-  {
-    public CacheRenderKit(FacesContext base)
-    {
-      _base = base;
-      _external = new OverrideDispatch(base.getExternalContext());
-      setCurrentInstance(this);
-    }
-
-    public Application getApplication()
-    {
-      return _base.getApplication();
-    }
-
-    public Iterator getClientIdsWithMessages()
-    {
-      return _base.getClientIdsWithMessages();
-    }
-
-    public ExternalContext getExternalContext()
-    {
-      return _external;
-    }
-
-    public FacesMessage.Severity getMaximumSeverity()
-    {
-      return _base.getMaximumSeverity();
-    }
-
-    public Iterator getMessages()
-    {
-      return _base.getMessages();
-    }
-
-    public Iterator getMessages(String clientId)
-    {
-      return _base.getMessages(clientId);
-    }
-
-    public RenderKit getRenderKit()
-    {
-      if (_kit == null)
-      {
-        _kit = _base.getRenderKit();
-      }
-      else
-      {
-        UIViewRoot root = getViewRoot();
-        if (root != null)
-        {
-          String renderKitId = root.getRenderKitId();
-          // Yes, instance equality, not .equals();  within a single
-          // request and single thread, instance equality should always
-          // be sufficient, and behavior will still be correct even
-          // if it was somehow not (we'll just spend more time re-getting the
-          // RenderKit)
-          if (renderKitId != _renderKitId)
-          {
-            _renderKitId = renderKitId;
-            _kit = _base.getRenderKit();
-          }
-        }
-      }
-
-      return _kit;
-    }
-
-    public boolean getRenderResponse()
-    {
-      return _base.getRenderResponse();
-    }
-
-    public boolean getResponseComplete()
-    {
-      return _base.getResponseComplete();
-    }
-
-    public ResponseStream getResponseStream()
-    {
-      return _base.getResponseStream();
-    }
-
-    public void setResponseStream(ResponseStream responseStream)
-    {
-      _base.setResponseStream(responseStream);
-    }
-
-    public ResponseWriter getResponseWriter()
-    {
-      return _base.getResponseWriter();
-    }
-
-    public void setResponseWriter(ResponseWriter responseWriter)
-    {
-      _base.setResponseWriter(responseWriter);
-    }
-
-    public UIViewRoot getViewRoot()
-    {
-      return _base.getViewRoot();
-    }
-
-    public void setViewRoot(UIViewRoot viewRoot)
-    {
-      _base.setViewRoot(viewRoot);
-    }
-
-    public void addMessage(String clientId, FacesMessage facesMessage)
-    {
-      _base.addMessage(clientId, facesMessage);
-    }
-
-    public void release()
-    {
-      _base.release();
-    }
-
-    public void renderResponse()
-    {
-      _base.renderResponse();
-    }
-
-    public void responseComplete()
-    {
-      _base.responseComplete();
-    }
-
-    private final FacesContext    _base;
-    private final ExternalContext _external;
-    private String    _renderKitId;
-    private RenderKit _kit;
-  }
-
-  static private class OverrideDispatch extends ExternalContextDecorator
-  {
-    public OverrideDispatch(ExternalContext decorated)
-    {
-      _decorated = decorated;
-    }
-
-    public void dispatch(String path) throws IOException
-    {
-      AdfFacesContext afc = AdfFacesContext.getCurrentInstance();
-      if (afc != null)
-      {
-        path = afc.getPageResolver().getPhysicalURI(path);
-      }
-
-      super.dispatch(path);
-    }
-
-
-    protected ExternalContext getExternalContext()
-    {
-      return _decorated;
-    }
-
-    private final ExternalContext _decorated;
-  }
-
-  private final FacesContextFactory _factory;
-
-  static private final ADFLogger _LOG =
-    ADFLogger.createADFLogger(FacesContextFactoryImpl.class);
-}
+package org.apache.myfaces.adfinternal.context;
+
+import java.io.IOException;
+
+import java.util.Iterator;
+
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.render.RenderKit;
+
+import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.context.AdfFacesContext;
+
+/**
+ * Internal class that optimizes retrieval of the RenderKit by caching it
+ * on the FacesContext, and hooks ExternalContext.dispatch()
+ * to use the PageResolver.
+ * <p>
+ * @author The Oracle ADF Faces Team
+ */
+public class FacesContextFactoryImpl
+  extends FacesContextFactory
+{
+  public FacesContextFactoryImpl(FacesContextFactory factory)
+  {
+    _factory = factory;
+  }
+
+  public FacesContext getFacesContext(Object context, Object request,
+                                      Object response, Lifecycle lifecycle)
+  {
+    return new CacheRenderKit(_factory.getFacesContext(context,
+                                                       request,
+                                                       response,
+                                                       lifecycle));
+  }
+
+  static public class CacheRenderKit extends FacesContext
+  {
+    public CacheRenderKit(FacesContext base)
+    {
+      _base = base;
+      _external = new OverrideDispatch(base.getExternalContext());
+      setCurrentInstance(this);
+    }
+
+    public Application getApplication()
+    {
+      return _base.getApplication();
+    }
+
+    public Iterator getClientIdsWithMessages()
+    {
+      return _base.getClientIdsWithMessages();
+    }
+
+    public ExternalContext getExternalContext()
+    {
+      return _external;
+    }
+
+    public FacesMessage.Severity getMaximumSeverity()
+    {
+      return _base.getMaximumSeverity();
+    }
+
+    public Iterator getMessages()
+    {
+      return _base.getMessages();
+    }
+
+    public Iterator getMessages(String clientId)
+    {
+      return _base.getMessages(clientId);
+    }
+
+    public RenderKit getRenderKit()
+    {
+      if (_kit == null)
+      {
+        _kit = _base.getRenderKit();
+      }
+      else
+      {
+        UIViewRoot root = getViewRoot();
+        if (root != null)
+        {
+          String renderKitId = root.getRenderKitId();
+          // Yes, instance equality, not .equals();  within a single
+          // request and single thread, instance equality should always
+          // be sufficient, and behavior will still be correct even
+          // if it was somehow not (we'll just spend more time re-getting the
+          // RenderKit)
+          if (renderKitId != _renderKitId)
+          {
+            _renderKitId = renderKitId;
+            _kit = _base.getRenderKit();
+          }
+        }
+      }
+
+      return _kit;
+    }
+
+    public boolean getRenderResponse()
+    {
+      return _base.getRenderResponse();
+    }
+
+    public boolean getResponseComplete()
+    {
+      return _base.getResponseComplete();
+    }
+
+    public ResponseStream getResponseStream()
+    {
+      return _base.getResponseStream();
+    }
+
+    public void setResponseStream(ResponseStream responseStream)
+    {
+      _base.setResponseStream(responseStream);
+    }
+
+    public ResponseWriter getResponseWriter()
+    {
+      return _base.getResponseWriter();
+    }
+
+    public void setResponseWriter(ResponseWriter responseWriter)
+    {
+      _base.setResponseWriter(responseWriter);
+    }
+
+    public UIViewRoot getViewRoot()
+    {
+      return _base.getViewRoot();
+    }
+
+    public void setViewRoot(UIViewRoot viewRoot)
+    {
+      _base.setViewRoot(viewRoot);
+    }
+
+    public void addMessage(String clientId, FacesMessage facesMessage)
+    {
+      _base.addMessage(clientId, facesMessage);
+    }
+
+    public void release()
+    {
+      _base.release();
+    }
+
+    public void renderResponse()
+    {
+      _base.renderResponse();
+    }
+
+    public void responseComplete()
+    {
+      _base.responseComplete();
+    }
+
+    private final FacesContext    _base;
+    private final ExternalContext _external;
+    private String    _renderKitId;
+    private RenderKit _kit;
+  }
+
+  static public class OverrideDispatch extends ExternalContextDecorator
+  {
+    public OverrideDispatch(ExternalContext decorated)
+    {
+      _decorated = decorated;
+    }
+
+    public void dispatch(String path) throws IOException
+    {
+      AdfFacesContext afc = AdfFacesContext.getCurrentInstance();
+      if (afc != null)
+      {
+        path = afc.getPageResolver().getPhysicalURI(path);
+      }
+
+      super.dispatch(path);
+    }
+
+
+    protected ExternalContext getExternalContext()
+    {
+      return _decorated;
+    }
+
+    private final ExternalContext _decorated;
+  }
+
+  private final FacesContextFactory _factory;
+
+  static private final ADFLogger _LOG =
+    ADFLogger.createADFLogger(FacesContextFactoryImpl.class);
+}

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/image/PropertyInstantiator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/image/PropertyInstantiator.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/image/PropertyInstantiator.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/image/PropertyInstantiator.java Mon Jul  3 17:14:52 2006
@@ -18,7 +18,7 @@
 
 import org.apache.myfaces.adf.logging.ADFLogger;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 /**
  * PropertyInstantiator is used by ImageType instances to implement deferred

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/renderkit/ClassRendererInstantiator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/renderkit/ClassRendererInstantiator.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/renderkit/ClassRendererInstantiator.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/renderkit/ClassRendererInstantiator.java Mon Jul  3 17:14:52 2006
@@ -17,7 +17,7 @@
 
 import org.apache.myfaces.adf.logging.ADFLogger;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import javax.faces.render.Renderer;
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/resource/CoreRenderKitResourceLoader.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/resource/CoreRenderKitResourceLoader.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/resource/CoreRenderKitResourceLoader.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/resource/CoreRenderKitResourceLoader.java Mon Jul  3 17:14:52 2006
@@ -27,7 +27,7 @@
 import org.apache.myfaces.adf.resource.RegexResourceLoader;
 import org.apache.myfaces.adf.resource.ResourceLoader;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 /**
  * A resource loader implementation which loads resources

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/expl/Coercions.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/expl/Coercions.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/expl/Coercions.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/expl/Coercions.java Mon Jul  3 17:14:52 2006
@@ -24,8 +24,7 @@
 import java.util.Date;
 import java.util.List;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
-
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adfinternal.util.IntegerUtils;
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/io/ClassResourceNameResolver.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/io/ClassResourceNameResolver.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/io/ClassResourceNameResolver.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/io/ClassResourceNameResolver.java Mon Jul  3 17:14:52 2006
@@ -18,7 +18,7 @@
 import java.io.File;
 import java.net.URL;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 /**
  * NameResolver that locates files loaded relative to a class.  Files

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/nls/LocaleContext.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/nls/LocaleContext.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/nls/LocaleContext.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/nls/LocaleContext.java Mon Jul  3 17:14:52 2006
@@ -21,8 +21,9 @@
 import java.util.ResourceBundle;
 import java.util.TimeZone;
 
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
+
 import org.apache.myfaces.adfinternal.util.nls.LocaleUtils;
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
 
 /**
  * Context for locale-specific operations and properties.  All of the properties

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/ClassParserFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/ClassParserFactory.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/ClassParserFactory.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/ClassParserFactory.java Mon Jul  3 17:14:52 2006
@@ -19,7 +19,7 @@
 import org.apache.myfaces.adf.logging.ADFLogger;
 
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 /**
  * ParserFactory that instantiates parsers for

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/beans/IntrospectionBeanDef.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/beans/IntrospectionBeanDef.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/beans/IntrospectionBeanDef.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/share/xml/beans/IntrospectionBeanDef.java Mon Jul  3 17:14:52 2006
@@ -23,8 +23,9 @@
 
 import org.xml.sax.Attributes;
 
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
+
 import org.apache.myfaces.adfinternal.util.JavaIntrospector;
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
 
 /**
  * Implementation of BeanDef that uses introspection

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSDocumentHandler.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSDocumentHandler.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSDocumentHandler.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSDocumentHandler.java Mon Jul  3 17:14:52 2006
@@ -15,131 +15,141 @@
 */
 package org.apache.myfaces.adfinternal.skin;
 
+import java.io.StringReader;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.myfaces.adfinternal.agent.AdfFacesAgent;
+import org.apache.myfaces.adfinternal.style.util.NameUtils;
 import org.apache.myfaces.adfinternal.style.util.StyleUtils;
 import org.apache.myfaces.adfinternal.style.xml.parse.PropertyNode;
+import org.apache.myfaces.adfinternal.util.IntegerUtils;
 import org.apache.myfaces.adfinternal.util.nls.LocaleUtils;
 
-/** As the Skin css file is parsed, methods in this class are called to
- * build up a SkinStyleSheetNode.
- */
+ /** As the Skin css file is parsed, methods in this class are called to
+  * build up a SkinStyleSheetNode.
+  */
 public class SkinCSSDocumentHandler
 {
- 
+
+  
   /**
    * Return the List of SkinStyleSheetNodes that was created
    *  at the end of parsing the skin css file (endDocument).
    */
   public List <SkinStyleSheetNode> getSkinStyleSheetNodes()
   {
-    return _skinStyleSheetNodes;  
+    // We now have a list of CompleteSelectorNodes.
+    // We need to group this list into stylesheet nodes by matching 
+    // the additional information, like direction.
+    // Then we create a list of SkinStyleSheetNodes.
+    return 
+      _createSkinStyleSheetNodes(_completeSelectorNodeList, _namespaceMap);
   }
-  
+   
   /**
-   * Call this at the start of parsing the skin css file.
-   */
+  * Call this at the start of parsing the skin css file.
+  */
   public void startDocument()
   {
-    _namespaceMap = new HashMap();
-    _completeSelectorNodeList = new ArrayList();
+    // do nothing
   }
-  
+   
   /**
-   * Call this at the end of parsing the skin css file.
-   */
+  * Call this at the end of parsing the skin css file.
+  */
   public void endDocument()
   {
-    // We now have a list of CompleteSelectorNodes.
-    // We need to group this list into stylesheet nodes by matching 
-    // the additional information, like direction.
-    // Then we create a list of SkinStyleSheetNodes.
-    _skinStyleSheetNodes = 
-      _createSkinStyleSheetNodes(_completeSelectorNodeList, _namespaceMap);
+    // do nothing
   }
 
   public void comment(String text)
   {
-    // ignore comments
+     // ignore comments
   }
-  
+   
   /**
-   * Call this at the beginning of parsing one set of selectors/properties.
-   * e.g., .AFDefaultFont, af|navigationPath::font 
-   * {font-family:Arial,Helvetica; font-size:small}
-   */
+  * Call this at the beginning of parsing one set of selectors/properties.
+  * e.g., .AFDefaultFont, af|navigationPath::font 
+  * {font-family:Arial,Helvetica; font-size:small}
+  */
   public void startSelector()
   {
     _inStyleRule = true;
     _propertyNodeList = new ArrayList();
   }
-  
+   
   /**
    * Call this at the end of parsing one set of selectors/properties.
    * @param selectors A List of Strings, each String is a selector.
    * e.g., given the selectors/properties:
    * .AFDefaultFont, af|navigationPath::font 
    * {font-family:Arial,Helvetica; font-size:small}
-   * The selectors are ".AFDefaultFont" and "af|navigationPath::font"
-   */
+   * The selectors in the List are 
+   * ".AFDefaultFont" and "af|navigationPath::font"
+  */
   public void endSelector(List selectors)
   {
     if (selectors == null)
       return;
+      
     int selectorNum = selectors.size();
+    
     for (int i = 0; i < selectorNum; i++)
     {
-      String selector = (String)selectors.get(i);
-      CompleteSelectorNode node =
-        _createCompleteSelectorNode(selector, _propertyNodeList);
-      _completeSelectorNodeList.add(node);
+       String selector = (String)selectors.get(i);
+       CompleteSelectorNode node =
+         _createCompleteSelectorNode(selector, 
+                                     _propertyNodeList,
+                                     _selectorAgents,
+                                     _selectorPlatforms);
+       _completeSelectorNodeList.add(node);
     }
+    // reset flags
     _inStyleRule = false;
     _propertyNodeList = null;
   }
 
-  /**
-   * Call this when a property name/value is found.
-   * e.g., given the selectors/properties:
-   * .AFDefaultFont, af|navigationPath::font 
-   * {font-family:Arial,Helvetica; font-size:small}
-   * One property name/value pair is "font-family"/"Arial,Helvetica"
-   * @param name 
-   * @param value 
-   */
+   /**
+    * Call this when a property name/value is found.
+    * e.g., given the selectors/properties:
+    * .AFDefaultFont, af|navigationPath::font 
+    * {font-family:Arial,Helvetica; font-size:small}
+    * One property name/value pair is "font-family"/"Arial,Helvetica"
+    * @param name 
+    * @param value 
+    */
   public void property(String name, String value)
   {
+
     if (_inStyleRule && (_propertyNodeList != null))
     {
       _propertyNodeList.add(new PropertyNode(name, value));
     }
   }
 
-  /**
-   * Call when you have an @ rule. This adds the @ rule to the object's
-   * namespaceMap.
-   * @param name The @rule string, which contains the entire line with the
-   * @ rule, which ends with a semicolon.
-   * e.g., @namespace af url(http:\\www.xxx.com)
-   */
-  public void atRule(String name)
+ /**
+  * Call when you have an atRule. This will do further processing.
+  * @param atRule The @rule string
+  * e.g., @namespace af url(http:\\www.xxx.com);
+  * e.g., @agent gecko { .foo {color:red}}
+  */
+  public void atRule(String atRule)
   {
     // parse the atRule further here.
-    // name will be something like:
-    // "namespace af url(asdfadfadf)"
-    if (name != null)
+    if (atRule != null)
     {
-      if (name.startsWith("@namespace"))
+      if (atRule.startsWith("@namespace"))
       {
-        // @todo deal with default namespaces that don't have prefixes??
-        String[] namespaceParts = name.split("\\s+");
+        // TODO deal with default namespaces that don't have prefixes??
+        String[] namespaceParts = atRule.split("\\s+");
         if (namespaceParts.length > 2)
         {
           String url = namespaceParts[2];
-          
+           
           // first, strip off the url( and );
           if (url.startsWith("url("))
             url = url.substring(4);
@@ -147,20 +157,76 @@
             url = url.substring(0, url.length() - 2);
           else if (url.endsWith(";"))
             url = url.substring(0, url.length() - 1);
-            
+             
           // second, strip off the starting/ending quotes if there are any                    
           url = SkinStyleSheetParserUtils.trimQuotes(url);
           _namespaceMap.put(namespaceParts[1], url);
         }
       }
+      else if (atRule.startsWith(_AT_AGENT))
+      {
+        _parseCustomAtRule(_AT_AGENT, atRule);
+      }
+      else if (atRule.startsWith(_AT_PLATFORM))
+      {
+        _parseCustomAtRule(_AT_PLATFORM, atRule);        
+      }
+      // for now, ignore other atRules in a skinning css file
+      
     }
   }
 
-  // create a CompleteSelectorNode (this is the selector, properties, and
-  // additional info, like 'rtl' direction
+  /** Get the atRule, and send its contents through the SkinCSSParser
+   * again, using the current DocumentHandler object. The start/end
+   * callbacks will be called again, but in the context of the atRule.
+   */
+  private void _parseCustomAtRule(String type, String atRule)
+  {
+    // get the @agent agents, they are deliminated by commas
+    // parse out the content
+    // save the atRule type, so the document handler code can get to it.
+    // run this through parser again
+    String content = _getAtRuleContent(atRule);
+    int[] targetTypes = _getAtRuleTargetTypes(type, atRule);
+    _setAtRuleTargetTypes(type, targetTypes);
+    
+    // use this current DocumentHandler. This way we can add to the 
+    // CompleteSelectorNode list with agent information.
+    SkinCSSParser parser = new SkinCSSParser();
+    parser.parseCSSDocument(new StringReader(content), this);
+    
+    // reset
+    _resetAtRuleTargetTypes(type);
+
+  }
+  
+  private void _setAtRuleTargetTypes(
+    String type,
+    int[]  targetTypes)
+  {
+    
+    if (type == _AT_AGENT)
+      _selectorAgents = targetTypes;
+    else if (type == _AT_PLATFORM)
+      _selectorPlatforms = targetTypes;
+  }
+  
+  private void _resetAtRuleTargetTypes(
+    String type)
+  {
+    if (type == _AT_AGENT)
+      _selectorAgents = null;
+    else if (type == _AT_PLATFORM)
+      _selectorPlatforms = null;
+  }
+  
+   // create a CompleteSelectorNode (this is the selector, properties, and
+   // additional info, like 'rtl' direction
   private CompleteSelectorNode _createCompleteSelectorNode(
     String selector, 
-    List  propertyNodeList)
+    List  propertyNodeList,
+    int[] selectorAgents,
+    int[] selectorPlatforms)
   {
     // parse the selector to see if there is a :rtl or :ltr ending.
     // if so, then set the reading direction.
@@ -174,84 +240,173 @@
     }
     else if (selector.endsWith(StyleUtils.LTR_CSS_SUFFIX))
     {
-      int length = StyleUtils.LTR_CSS_SUFFIX.length();
-      // strip off the SUFFIX  
-      selector = selector.substring(0, selector.length()-length);
-      direction = LocaleUtils.DIRECTION_LEFTTORIGHT;
+       int length = StyleUtils.LTR_CSS_SUFFIX.length();
+       // strip off the SUFFIX  
+       selector = selector.substring(0, selector.length()-length);
+       direction = LocaleUtils.DIRECTION_LEFTTORIGHT;
     }
 
     return 
-      new CompleteSelectorNode(selector, propertyNodeList, direction);
+      new CompleteSelectorNode(
+        selector, 
+        propertyNodeList, 
+        direction, 
+        selectorAgents, 
+        selectorPlatforms);
   }
 
   /**
-   * Given a List of CompleteSelectorNodes, we create a List of 
-   * SkinStyleSheetNodes. We do this by looping through each
-   * CompleteSeletcorNode and finding the SkinStyleSheetNode with matching
-   * direction attribute (someday we'll add locale, browser, etc), or 
-   * creaing a new SkinStyleSheetNode if a matching one doesn't exist.
-   * @param selectorList a list of CompleteSelectorNodes.
-   * @param namespaceMap the namespace map
-   * @return a List of SkinStyleSheetNodes
-   */
+    * Given a List of CompleteSelectorNodes (selector nodes with
+    * infor about selectors, properties, direction, agent), we create a List of 
+    * SkinStyleSheetNodes.
+    * @param selectorList a list of CompleteSelectorNodes.
+    * @param namespaceMap the namespace map
+    * @return a List of SkinStyleSheetNodes
+    */
   private List <SkinStyleSheetNode> _createSkinStyleSheetNodes(
     List <CompleteSelectorNode> selectorList, 
     Map namespaceMap)
   {  
-    List <SkinStyleSheetNode> ssNodeList = new ArrayList();
-    // to start with ssNodeList is empty
-    // for each selector node, look to see if we can find a SkinStyleSheetNode
-    // that it belongs to (by matching direction).
-    // if not, create a new ssNode, and add it to the ssNodeList, and
-    // add the selector node to the ssNode.
-    
+    List <SkinStyleSheetNode> skinStyleSheetNodes = new ArrayList();
+     
     for (CompleteSelectorNode completeSelectorNode : selectorList) 
     {
-       // we add to the ssNodeList in this method.
-        int direction = completeSelectorNode.getDirection();
-        // loop through the skinStyleSheetNodeList to find a match
-        boolean match = false;
-        for (SkinStyleSheetNode ssNode : ssNodeList) 
-        {
-            int ssNodeDirection = ssNode.getDirection();
-            if (ssNodeDirection == direction)
-            {
-              // got a match! use this one to add the selector node to.
-              ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
-              match = true;
-              break;
-            }        
-        }
-        if (!match)
-        {
-          // no matching stylesheet node found, so create a new one
-           SkinStyleSheetNode ssNode = 
-            new SkinStyleSheetNode(namespaceMap, direction);
-           ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
-           // add the ssNode to the ssNodeList
-           ssNodeList.add(ssNode);
-        }
-           
+      // we add to the ssNodeList in this method.
+      int direction = completeSelectorNode.getDirection();
+      int[] agents = completeSelectorNode.getAgents();
+      int[] platforms = completeSelectorNode.getPlatforms();
+         
+      // loop through the skinStyleSheetNodeList to find a match
+      // of direction, agents, platforms, etc.
+      boolean match = false;
+         
+      // iterate backwards, because the last node is most likely the
+      // matching stylesheetnode.
+      for (int i=skinStyleSheetNodes.size()-1; i >=0 && !match; i--)
+      {
+        SkinStyleSheetNode ssNode = skinStyleSheetNodes.get(i);
+        match = ssNode.matches(direction, agents, platforms);
+        if (match)
+          ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
+      }
+
+      if (!match)
+      {
+       // no matching stylesheet node found, so create a new one
+        SkinStyleSheetNode ssNode = 
+         new SkinStyleSheetNode(namespaceMap, direction, agents, platforms);
+        ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
+        skinStyleSheetNodes.add(ssNode);
+      }       
     }
-     
-    return ssNodeList;
-     
+    return skinStyleSheetNodes;
   }
 
   /**
-   * This Class contains a SkinSelectorPropertiesNode and a rtl direction.
-   * We will use this information when creating a SkinStyleSheetNode.
+   * 
+   * @param type type of the at rule. _AT_AGENT or _AT_PLATFORM
+   * @param atRule - the atRule string
+   * @return int[] the target types using AdfFacesAgent constants like
+   * AdfFacesAgent.APPLICATION_IEXPLORER
    */
+  private int[] _getAtRuleTargetTypes(
+    String type, 
+    String atRule)
+  {
+    // given the atRule string, get the target types --
+    // @agent ie, gecko {...} => target types are the 
+    // AdfFacesAgent constants for ie and gecko.
+    int firstSpace = atRule.indexOf(' ');
+    int openBrace = atRule.indexOf('{');
+    if (firstSpace != -1 && openBrace != -1)
+    {
+      String types = atRule.substring(firstSpace, openBrace);
+      String[] typeArray = types.split(",");
+      List <Integer> list = new ArrayList();
+      
+      if (type == _AT_AGENT)
+      {
+        for (int i=0; i < typeArray.length; i++)
+        {
+          int agentInt = NameUtils.getBrowser(typeArray[i].trim());
+          
+          if (agentInt != AdfFacesAgent.APPLICATION_UNKNOWN)
+            list.add(IntegerUtils.getInteger(agentInt));
+        }
+      }
+      else if (type == _AT_PLATFORM)
+      {
+        for (int i=0; i < typeArray.length; i++)
+        {
+          int platformInt = NameUtils.getPlatform(typeArray[i].trim());           
+
+          if (platformInt != AdfFacesAgent.OS_UNKNOWN)
+            list.add(IntegerUtils.getInteger(platformInt));
+        }          
+      }
+      return _getIntArray(list);
+   }
+   else return null;
+  }
+
+  // Copies Integers from a List of Integers into an int array
+  private int[] _getIntArray(List <Integer> integerList)
+  {
+    int count = integerList.size();
+  
+    if (count == 0)
+      return null;
+  
+    int[] array = new int[count];
+  
+    for (int i = 0; i < count; i++)
+      array[i] = integerList.get(i).intValue();
+  
+    return array;
+  }
+   
+   /**
+    * 
+    * @param atRule - the entire @rule's definition, including content.
+    * e.g., @agent ie, gecko { af|inputText::content {color:red}}
+    * @return the content as a String
+    * e.g., "af|inputText::content {color:red}"
+    */
+  private String _getAtRuleContent(String atRule)
+  {
+    int openBraceIndex = atRule.indexOf('{');
+    int endBraceIndex = atRule.lastIndexOf('}');
+    if (endBraceIndex == -1) 
+      endBraceIndex = atRule.length();
+      
+    if (openBraceIndex == -1)
+      return null;
+    else
+     return atRule.substring(openBraceIndex+1, endBraceIndex);
+   
+  }
+   
+
+   /**
+    * This Class contains a SkinSelectorPropertiesNode and a rtl direction.
+    * We will use this information when creating a SkinStyleSheetNode.
+    */
   private static class CompleteSelectorNode
   {
     public CompleteSelectorNode(
       String selectorName,
       List   propertyNodes,
-      int    direction
+      int    direction,
+      int[]  agents,
+      int[]  platforms
       )
     {
       _node = new SkinSelectorPropertiesNode(selectorName, propertyNodes);
       _direction = direction;
+      // copy the agents and platforms because these get nulled out 
+      // at the end of the @rule parsing.
+      _agents = _copyIntArray(agents);
+      _platforms = _copyIntArray(platforms);
     }
     
     public SkinSelectorPropertiesNode getSkinSelectorPropertiesNode()
@@ -264,23 +419,52 @@
       return _direction;
     }
     
+    public int[] getAgents()
+    {
+      return _agents;
+    }
+    
+    public int[] getPlatforms()
+    {
+      return _platforms;
+    }
+    
+    // Returns a copy of the int array
+    private static int[] _copyIntArray(int[] array)
+    {
+      if (array == null)
+        return null;
+    
+      int[] copy = new int[array.length];
+      System.arraycopy(array, 0, copy, 0, array.length);
+    
+      return copy;
+    }
+     
     private SkinSelectorPropertiesNode _node;
     private int _direction;  // the reading direction
-  }
-  
-  private boolean _inStyleRule = false;
- 
-  private List <SkinStyleSheetNode> _skinStyleSheetNodes = null;
-
-  private List _propertyNodeList = null;
+    private int[] _agents;
+    private int[] _platforms;
 
-  // we build this list in this document handler. We use this 
-  // list to create a list of 
-  // SkinStyleSheetNodes and SkinSelectorPropertiesNodes
-  private List <CompleteSelectorNode> _completeSelectorNodeList;
+  }
 
-  private Map _namespaceMap;
+  private static String _AT_AGENT = "@agent";
+  private static String _AT_PLATFORM = "@platform";
 
-}  
-  
+  // below are properties that we set and reset 
+  // as the methods of this documentHandler get called.
+  private boolean _inStyleRule = false;
+  private List _propertyNodeList = null;
+  // we build this list as we parse the skinning css file. We use this 
+  // list to create a list of SkinStyleSheetNodes
+  private List <CompleteSelectorNode> _completeSelectorNodeList = 
+    new ArrayList<CompleteSelectorNode>();
+  // these are the selector platform and agents of the selectors we
+  // are currently parsing in this document.
+  private int[] _selectorPlatforms = null;
+  private int[] _selectorAgents = null;
+  private Map _namespaceMap = new HashMap();
   
+}  
+   
+   

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSParser.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSParser.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinCSSParser.java Mon Jul  3 17:14:52 2006
@@ -292,12 +292,56 @@
           case '@':
             if (_type != CSSLexicalUnits.LEFT_CURLY_BRACE)
             {
+              // found @.
+              // @namespace is treated differently than other @rules.
+              // These are the formats:
+              // @namespace foo url(http://www.foo.com);
+              // @agent {
+              //    af|inputText::content{color:red; background-color:blue;}
+              // }
+              // @platform {...}
+              // If @namespace, go 'til the semi-colon
+              // Else, go until the start/end brace match.
+
               // found @. keep getting characters until we get a ; or end of file.
+              /*
               _nextChar();
+
               while ((_currentChar != -1) && (_currentChar != ';'))
               {
                 _nextChar();
               }
+              */
+              _nextChar();
+              boolean foundEnd = false;
+              // go until ; or until {} match
+              int openBraceCount = 0;
+              boolean openBraceCountStarted = false;
+              while ((_currentChar != -1))
+              {
+
+                if (_currentChar == '{')
+                  openBraceCount++;
+                if (openBraceCount == 1)
+                  openBraceCountStarted = true;
+                if (_currentChar == '}' && openBraceCountStarted)
+                {
+                  openBraceCount--;
+                  if (openBraceCountStarted && openBraceCount == 0)
+                  {
+                    foundEnd = true;
+                    break;
+                  }
+                }
+                if (_currentChar == ';' && openBraceCount==0)
+                {
+                  foundEnd = true;
+                  break;
+                }
+                _nextChar();
+
+              }
+             
   
               _type = CSSLexicalUnits.AT_KEYWORD;
               return;

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetNode.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetNode.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetNode.java Mon Jul  3 17:14:52 2006
@@ -17,6 +17,7 @@
 package org.apache.myfaces.adfinternal.skin;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -38,22 +39,28 @@
     SkinStyleSheetNode(
       List <SkinSelectorPropertiesNode> skinSelectorNodeList,
       Map  namespaceMap,
-      int  direction
+      int  direction,
+      int[] agents
       )
     {
       _skinSelectorNodeList = skinSelectorNodeList;
       _namespaceMap     = namespaceMap;
       _direction        = direction;
+      _agents           = agents;
     } 
     
   
   SkinStyleSheetNode(
     Map  namespaceMap,
-    int  direction
+    int  direction,
+    int[] agents,
+    int[] platforms
     )
   {
     _namespaceMap     = namespaceMap;
     _direction        = direction;
+    _agents           = agents;
+    _platforms        = platforms;
   }     
     
   public void add(SkinSelectorPropertiesNode node)
@@ -82,20 +89,55 @@
       return _skinSelectorNodeList;
     }
     
-    /**
-    *
-    * @return int indicating the direction
-    * LocaleUtils.DIRECTION_DEFAULT 
-    * LocaleUtils.DIRECTION_LEFTTORIGHT 
-    * LocaleUtils.DIRECTION_RIGHTTOLEFT
-    */
     public int getDirection()
     {
       return _direction;
-    }    
-
+    }
+    
+    public int[] getAgents()
+    {
+      return _agents;
+    }
+    
+    public int[] getPlatforms()
+    {
+      return _platforms;
+    }
+    
+    public boolean matches(
+      int direction, 
+      int[] agents, 
+      int[] platforms)
+    {
+      if (direction == _direction)
+      {
+        boolean agentsMatch = _intArraysEqual(agents, _agents);
+        
+        if (agentsMatch)
+        {
+          boolean platformsMatch = _intArraysEqual(platforms, _platforms);
+          if (platformsMatch)
+            return true;
+        }
+      }
+      return false;
+    }
+  
+    private boolean _intArraysEqual(
+      int[] a1, 
+      int[] a2)
+    {
+      if (a1 != null)
+        Arrays.sort(a1);
+      if (a2 != null)
+        Arrays.sort(a2);
+      return Arrays.equals(a1, a2); 
+    }
+    
     private Map  _namespaceMap;
     private List <SkinSelectorPropertiesNode> _skinSelectorNodeList;
-    private int _direction;  // reading direction
+    private int  _direction;  // reading direction
+    private int[] _agents;
+    private int[] _platforms;
 
 }

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetParserUtils.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetParserUtils.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/SkinStyleSheetParserUtils.java Mon Jul  3 17:14:52 2006
@@ -236,6 +236,23 @@
           _addIconNode(selectorName,
                        noOraPropertyList,
                        iconNodeList);
+          // log warning if the icon is defined within an @agent or @platform
+          // block that tells the user that this icon will be used 
+          // for all agents and platforms.
+          // TODO add agent and platform support for icons.
+          // This means that if an icon is defined within the @agent and/or
+          // the @platform keys, then that icon should be rendered when
+          // the rendering context matches the agent/platform.
+          if (skinSSNode.getAgents() != null ||
+              skinSSNode.getPlatforms() != null)
+          {
+            _LOG.warning("Icon '" +
+                         selectorName +
+                         "' is defined for agents and/or platforms in the skinning file." +
+                         " However that feature is not implemented yet for icons, only styles. "+ " " +
+                         "Therefore, this icon will be used " +
+                         "regardless of the request's agent or platform.");
+          }
         }
         else
         {
@@ -257,11 +274,11 @@
         StyleNode[] styleNodeArray = styleNodeList.toArray(new StyleNode[0]);
         StyleSheetNode ssNode = 
           new StyleSheetNode(styleNodeArray,
-                             null,
+                             null,/*locales, not yet supported*/
                              skinSSNode.getDirection(),
-                             null,
-                             null,
-                             null,
+                             skinSSNode.getAgents(),
+                             null,/*versions, not supported*/
+                             skinSSNode.getPlatforms(),
                              0);
         ssNodeList.add(ssNode);
       }
@@ -412,7 +429,9 @@
 
 
     Integer width = null;
+    String  widthValue = null;
     Integer height = null;
+    String  heightValue = null;
     //String  styleClass = null;
     String  uri = null;
     String  text = null;
@@ -429,17 +448,17 @@
       String propertyValue = propertyNode.getValue();
       if (propertyName.equals("width"))
       {
-        int pxPosition = propertyValue.indexOf("px");
-        if (pxPosition > -1)
-          propertyValue = propertyValue.substring(0, pxPosition);
-        width = Integer.valueOf(propertyValue);
+        // save original width value
+        // strip off px from the string and return an Integer
+        widthValue = propertyValue;
+        width = _convertPxDimensionStringToInteger(widthValue);
       }
       else if (propertyName.equals("height"))
       {
-        int pxPosition = propertyValue.indexOf("px");
-        if (pxPosition > -1)
-          propertyValue = propertyValue.substring(0, pxPosition);
-        height = Integer.valueOf(propertyValue);
+        // save original height value
+        // strip off px from the string and return an Integer
+        heightValue = propertyValue;
+        height = _convertPxDimensionStringToInteger(heightValue);
       }
       else if (propertyName.equals("content"))
       {
@@ -475,6 +494,11 @@
       {
         // don't allow styleClass from the css parsing file. We can handle
         // this when we have style includes
+        // put back the width/height properties if there were some
+        if (heightValue != null)
+         inlineStyle.setProperty("height", heightValue);
+        if (widthValue != null)
+          inlineStyle.setProperty("width", widthValue);
         icon = new TextIcon(text, text, null, inlineStyle);
       }
       else if (uri != null)
@@ -851,6 +875,23 @@
     return buffer.toString();
   }
 
+  /**
+   * Given a String that denotes a width or height css style
+   * property, return an Integer. This will strip off 'px' from
+   * the string if there is one.
+   * e.g., if propertyValue is '7px', the Integer 7 will be returned.
+   * @param propertyValue - this is a string that indicates width
+   * or height.
+   * @return Integer
+   */
+  private static Integer _convertPxDimensionStringToInteger(
+    String propertyValue)
+  {
+    int pxPosition = propertyValue.indexOf("px");
+    if (pxPosition > -1)
+      propertyValue = propertyValue.substring(0, pxPosition);
+    return Integer.valueOf(propertyValue);    
+  }
   private static class ResolvedSkinProperties
   {
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/StyleSheetNameResolver.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/StyleSheetNameResolver.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/StyleSheetNameResolver.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/skin/StyleSheetNameResolver.java Mon Jul  3 17:14:52 2006
@@ -26,7 +26,7 @@
 import javax.faces.context.FacesContext;
 import javax.servlet.ServletContext;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adf.logging.ADFLogger;
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/util/CSSGenerationUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/util/CSSGenerationUtils.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/util/CSSGenerationUtils.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/util/CSSGenerationUtils.java Mon Jul  3 17:14:52 2006
@@ -217,14 +217,16 @@
 
           // if the transformed full name is different than the shortSelector
           // then write out the shortSelector, too.
-          if ( (shortSelector != null) &&
-               (!validFullNameSelector.equals(shortSelector)) )
+          if (shortSelector != null)
           {
-            out.print(",");
             String validShortSelector =
               _getValidFullNameSelector(shortSelector);
-            if (validShortSelector != null)
+            if (!validFullNameSelector.equals(validShortSelector))
+            {
+              out.print(",");
               out.print(validShortSelector);
+  
+            }
           }
 
           // Write out a separator between matching selectors

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetDocument.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetDocument.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetDocument.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetDocument.java Mon Jul  3 17:14:52 2006
@@ -305,7 +305,7 @@
     {
       StyleSheetNode styleSheet = (StyleSheetNode)e.next();
 
-      if (styleSheet.compareVariants(locale, direction, agent,mode) > 0)
+      if (styleSheet.compareVariants(locale, direction, agent, mode) > 0)
         v.addElement(styleSheet);
     }
 
@@ -319,7 +319,8 @@
     Comparator comparator = new StyleSheetComparator(locale,
                                                      direction,
                                                      agent,
-                                                     _styleSheets,mode);
+                                                     mode,
+                                                     _styleSheets);
 
     Arrays.sort(styleSheets, comparator);
 
@@ -895,8 +896,9 @@
       Locale locale,
       int direction,
       AdfFacesAgent agent,
-      StyleSheetNode[] styleSheets,
-      int mode)
+      int mode,
+      StyleSheetNode[] styleSheets
+      )
     {
       _direction = direction;
       _locale = locale;

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetNode.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetNode.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/style/xml/parse/StyleSheetNode.java Mon Jul  3 17:14:52 2006
@@ -155,7 +155,11 @@
    * sort style sheets according to precedence.
    * @param mode 
    */
-  public int compareVariants(Locale locale, int direction, AdfFacesAgent agent, int mode)
+  public int compareVariants(
+    Locale locale, 
+    int direction, 
+    AdfFacesAgent agent, 
+    int mode)
   {
     int localeMatch = _compareLocale(locale);
     if (localeMatch == 0)

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/ClassRendererInstantiator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/ClassRendererInstantiator.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/ClassRendererInstantiator.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/ClassRendererInstantiator.java Mon Jul  3 17:14:52 2006
@@ -17,7 +17,7 @@
 
 import org.apache.myfaces.adf.logging.ADFLogger;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 import java.lang.reflect.UndeclaredThrowableException;
 
 /**

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/data/bind/ConvertBoundValue.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/data/bind/ConvertBoundValue.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/data/bind/ConvertBoundValue.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/data/bind/ConvertBoundValue.java Mon Jul  3 17:14:52 2006
@@ -15,10 +15,10 @@
  */
 package org.apache.myfaces.adfinternal.ui.data.bind;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
 import java.lang.reflect.UndeclaredThrowableException;
 
 import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adfinternal.share.expl.Coercions;
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/BaseLafUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/BaseLafUtils.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/BaseLafUtils.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/BaseLafUtils.java Mon Jul  3 17:14:52 2006
@@ -28,10 +28,10 @@
 import javax.faces.component.UIComponent;
 import javax.faces.context.ExternalContext;
 
-import org.apache.myfaces.adfinternal.util.IntegerUtils;
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+
 
 import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adfinternal.share.config.Configuration;
 import org.apache.myfaces.adfinternal.share.data.ServletRequestParameters;
@@ -53,6 +53,7 @@
 import org.apache.myfaces.adfinternal.ui.data.bind.AndBoundValue;
 import org.apache.myfaces.adfinternal.ui.data.bind.ComparisonBoundValue;
 import org.apache.myfaces.adfinternal.ui.data.bind.DefaultingBoundValue;
+import org.apache.myfaces.adfinternal.util.IntegerUtils;
 import org.apache.myfaces.adfinternal.util.nls.LocaleUtils;
 
 /**

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/ClassRendererParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/ClassRendererParser.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/ClassRendererParser.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/ClassRendererParser.java Mon Jul  3 17:14:52 2006
@@ -19,7 +19,7 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXParseException;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adf.logging.ADFLogger;
 

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/InstanceIconParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/InstanceIconParser.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/InstanceIconParser.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/xml/parse/InstanceIconParser.java Mon Jul  3 17:14:52 2006
@@ -21,9 +21,9 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationTargetException;
 
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adfinternal.share.xml.LeafNodeParser;
 import org.apache.myfaces.adfinternal.share.xml.ParseContext;

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/util/JavaIntrospector.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/util/JavaIntrospector.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/util/JavaIntrospector.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/util/JavaIntrospector.java Mon Jul  3 17:14:52 2006
@@ -40,6 +40,7 @@
 import java.util.Vector;
 
 import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 
 /**

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/AdfFacesFilterImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/AdfFacesFilterImpl.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/AdfFacesFilterImpl.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/AdfFacesFilterImpl.java Mon Jul  3 17:14:52 2006
@@ -40,6 +40,7 @@
 import org.apache.myfaces.adf.context.AdfFacesContext;
 import org.apache.myfaces.adf.context.AdfFacesContextFactory;
 import org.apache.myfaces.adf.model.UploadedFile;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 import org.apache.myfaces.adfinternal.context.AdfFacesContextFactoryImpl;
 import org.apache.myfaces.adfinternal.context.AdfFacesContextImpl;
@@ -49,7 +50,6 @@
 import org.apache.myfaces.adfinternal.skin.SkinFactory;
 import org.apache.myfaces.adfinternal.skin.SkinFactoryImpl;
 import org.apache.myfaces.adfinternal.skin.SkinUtils;
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
 
 /**
  * Actual implementation of the ADF Faces servlet filter.

Modified: incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/ConfigParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/ConfigParser.java?rev=418880&r1=418879&r2=418880&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/ConfigParser.java (original)
+++ incubator/adffaces/branches/matzew-mock-overhaul/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/webapp/ConfigParser.java Mon Jul  3 17:14:52 2006
@@ -37,7 +37,7 @@
 import javax.faces.el.ValueBinding;
 
 import org.apache.myfaces.adfinternal.context.AdfFacesContextBean;
-import org.apache.myfaces.adfinternal.util.ClassLoaderUtils;
+import org.apache.myfaces.adf.util.ClassLoaderUtils;
 
 
 



Mime
View raw message