myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r905894 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config: ./ impl/digester/ impl/digester/elements/
Date Wed, 03 Feb 2010 05:21:46 GMT
Author: lu4242
Date: Wed Feb  3 05:21:45 2010
New Revision: 905894

URL: http://svn.apache.org/viewvc?rev=905894&view=rev
Log:
MYFACES-2527 Support for decorator design pattern: RenderKit(s)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/RenderKit.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java?rev=905894&r1=905893&r2=905894&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigDispenser.java
Wed Feb  3 05:21:45 2010
@@ -222,7 +222,7 @@
     public Collection<String> getRenderKitIds();
 
     /** @return renderkit class name for given renderkit id */
-    public String getRenderKitClass(String renderKitId);
+    public Collection<String> getRenderKitClasses(String renderKitId);
 
     /**
      * @return Iterator over {@link org.apache.myfaces.config.element.ClientBehaviorRenderer
ClientBehaviorRenderer}s for the given renderKitId

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=905894&r1=905893&r2=905894&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Wed Feb  3 05:21:45 2010
@@ -1942,14 +1942,16 @@
         FacesConfigDispenser<FacesConfig> dispenser = getDispenser();
         for (String renderKitId : dispenser.getRenderKitIds())
         {
-            String renderKitClass = dispenser.getRenderKitClass(renderKitId);
+            Collection<String> renderKitClass = dispenser.getRenderKitClasses(renderKitId);
 
-            if (renderKitClass == null)
+            if (renderKitClass.isEmpty())
             {
-                renderKitClass = DEFAULT_RENDER_KIT_CLASS;
+                renderKitClass = new ArrayList<String>(1);
+                renderKitClass.add(DEFAULT_RENDER_KIT_CLASS);
             }
 
-            RenderKit renderKit = (RenderKit) ClassUtils.newInstance(renderKitClass);
+            //RenderKit renderKit = (RenderKit) ClassUtils.newInstance(renderKitClass);
+            RenderKit renderKit = (RenderKit) getApplicationObject(RenderKit.class, renderKitClass,
null);
 
             for (Renderer element : dispenser.getRenderers(renderKitId))
             {

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java?rev=905894&r1=905893&r2=905894&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
Wed Feb  3 05:21:45 2010
@@ -574,9 +574,9 @@
     /**
      * @return renderkit class name for given renderkit id
      */
-    public String getRenderKitClass(String renderKitId)
+    public Collection<String> getRenderKitClasses(String renderKitId)
     {
-        return renderKits.get(renderKitId).getRenderKitClass();
+        return renderKits.get(renderKitId).getRenderKitClasses();
     }
 
     /**

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java?rev=905894&r1=905893&r2=905894&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
Wed Feb  3 05:21:45 2010
@@ -235,7 +235,8 @@
         digester.addObjectCreate("faces-config/render-kit", RenderKit.class);
         digester.addSetNext("faces-config/render-kit", "addRenderKit");
         digester.addCallMethod("faces-config/render-kit/render-kit-id", "setId", 0);
-        digester.addCallMethod("faces-config/render-kit/render-kit-class", "setRenderKitClass",
0);
+        //digester.addCallMethod("faces-config/render-kit/render-kit-class", "setRenderKitClass",
0);
+        digester.addCallMethod("faces-config/render-kit/render-kit-class", "addRenderKitClass",
0);
         digester.addObjectCreate("faces-config/render-kit/renderer", Renderer.class);
         digester.addSetNext("faces-config/render-kit/renderer", "addRenderer");
         digester.addCallMethod("faces-config/render-kit/renderer/component-family", "setComponentFamily",
0);

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/RenderKit.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/RenderKit.java?rev=905894&r1=905893&r2=905894&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/RenderKit.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/RenderKit.java
Wed Feb  3 05:21:45 2010
@@ -28,7 +28,7 @@
 {
 
     private String id;
-    private String renderKitClass;
+    private List<String> renderKitClasses = new ArrayList<String>();
     private List<org.apache.myfaces.config.element.Renderer> renderer = new ArrayList<org.apache.myfaces.config.element.Renderer>();
     private List<org.apache.myfaces.config.element.ClientBehaviorRenderer> clientBehaviorRenderers
= new ArrayList<org.apache.myfaces.config.element.ClientBehaviorRenderer>();
     
@@ -42,14 +42,14 @@
         this.id = id;
     }
 
-    public String getRenderKitClass()
+    public List<String> getRenderKitClasses()
     {
-        return renderKitClass;
+        return renderKitClasses;
     }
-    
-    public void setRenderKitClass(String renderKitClass)
+
+    public void addRenderKitClass(String renderKitClass)
     {
-        this.renderKitClass = renderKitClass;
+        renderKitClasses.add(renderKitClass);
     }
     
     public List<org.apache.myfaces.config.element.ClientBehaviorRenderer> getClientBehaviorRenderers
()
@@ -74,6 +74,7 @@
 
     public void merge(RenderKit renderKit)
     {
+        renderKitClasses.addAll(renderKit.getRenderKitClasses());
         clientBehaviorRenderers.addAll (renderKit.getClientBehaviorRenderers());
         renderer.addAll(renderKit.getRenderer());
     }



Mime
View raw message