myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r709840 - /myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
Date Sun, 02 Nov 2008 04:22:40 GMT
Author: lu4242
Date: Sat Nov  1 21:22:40 2008
New Revision: 709840

URL: http://svn.apache.org/viewvc?rev=709840&view=rev
Log:
MYFACES-2030 Implement getComponentFamilies and getRendererTypes on HtmlRenderKitImpl

Modified:
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java?rev=709840&r1=709839&r2=709840&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
(original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
Sat Nov  1 21:22:40 2008
@@ -22,7 +22,10 @@
 import java.io.OutputStream;
 import java.io.Writer;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 
 import javax.faces.context.ResponseStream;
 import javax.faces.context.ResponseWriter;
@@ -49,6 +52,7 @@
 
     private Map<String, Renderer> _renderers;
     private ResponseStateManager _responseStateManager;
+    private Map<String,Set<String>> _families;
 
     // ~ Constructors -------------------------------------------------------------------------------
 
@@ -56,6 +60,7 @@
     {
         _renderers = new HashMap<String, Renderer>();
         _responseStateManager = new HtmlResponseStateManager();
+        _families = new HashMap<String, Set<String> >();
     }
 
     // ~ Methods ------------------------------------------------------------------------------------
@@ -113,6 +118,17 @@
                     + " renderer class = " + renderer.getClass().getName());
         }
 
+        if (_families.get(componentFamily) == null)
+        {
+            Set<String> rendererTypes = new HashSet<String>();
+            rendererTypes.add(rendererType);
+            _families.put(componentFamily, rendererTypes);
+        }
+        else
+        {
+            _families.get(componentFamily).add(rendererType);
+        }
+        
         _renderers.put(rendererKey, renderer);
 
         if (log.isTraceEnabled())
@@ -125,6 +141,24 @@
     {
         return _responseStateManager;
     }
+    
+    /**
+     * @since JSF 2.0
+     */
+    @Override
+    public Iterator<String> getComponentFamilies()
+    {
+        return _families.keySet().iterator();
+    }
+    
+    /**
+     * @since JSF 2.0
+     */
+    @Override
+    public Iterator<String> getRendererTypes(String componentFamily)
+    {
+        return _families.get(componentFamily).iterator();
+    }
 
     @Override
     public ResponseWriter createResponseWriter(Writer writer, String contentTypeListString,
String characterEncoding)



Mime
View raw message