myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1585677 - in /myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html: HtmlCheckboxRendererBase.java HtmlRadioRendererBase.java
Date Tue, 08 Apr 2014 10:24:38 GMT
Author: lu4242
Date: Tue Apr  8 10:24:38 2014
New Revision: 1585677

URL: http://svn.apache.org/r1585677
Log:
rollback changes done MYFACES-3879 because it makes the TCK fail

Modified:
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java?rev=1585677&r1=1585676&r2=1585677&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
Tue Apr  8 10:24:38 2014
@@ -42,8 +42,6 @@ import javax.faces.model.SelectItemGroup
 
 import org.apache.myfaces.shared.renderkit.JSFAttr;
 import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
-import org.apache.myfaces.shared.renderkit.html.util.SelectItemInfo;
-import org.apache.myfaces.shared.renderkit.html.util.SelectItemsUtils;
 
 public class HtmlCheckboxRendererBase extends HtmlRenderer
 {
@@ -76,7 +74,7 @@ public class HtmlCheckboxRendererBase ex
         {
             Boolean value = org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanValue(
uiComponent );
             boolean isChecked = value != null ? value.booleanValue() : false;
-            renderCheckbox(facesContext, uiComponent, EXTERNAL_TRUE_VALUE, uiComponent, false,isChecked,
true, null); 
+            renderCheckbox(facesContext, uiComponent, EXTERNAL_TRUE_VALUE, false,isChecked,
true, null); 
                 //TODO: the selectBoolean is never disabled
         }
         else if (uiComponent instanceof UISelectMany)
@@ -153,16 +151,14 @@ public class HtmlCheckboxRendererBase ex
 
         int itemNum = 0;
 
-        for (Iterator it = SelectItemsUtils.getSelectItemInfoList(
+        for (Iterator it = org.apache.myfaces.shared.renderkit.RendererUtils.getSelectItemList(
                 selectMany, facesContext)
                 .iterator(); it.hasNext();)
         {
-            SelectItemInfo selectItemInfo = (SelectItemInfo) it.next();
-            SelectItem selectItem = (SelectItem) selectItemInfo.getItem();
+            SelectItem selectItem = (SelectItem) it.next();
             
             itemNum = renderGroupOrItemCheckbox(facesContext, selectMany, 
-                                                selectItem, selectItemInfo.getComponent(),
-                                                useSubmittedValues, lookupSet, 
+                                                selectItem, useSubmittedValues, lookupSet,

                                                 converter, pageDirectionLayout, itemNum);
         }
 
@@ -202,17 +198,6 @@ public class HtmlCheckboxRendererBase ex
                                              Converter converter, boolean pageDirectionLayout,

                                              Integer itemNum) throws IOException
     {
-        return renderGroupOrItemCheckbox(facesContext, uiComponent, selectItem, null, useSubmittedValues,
lookupSet, 
-                converter, pageDirectionLayout, itemNum);
-    }
-    
-    protected int renderGroupOrItemCheckbox(FacesContext facesContext,
-                                             UIComponent uiComponent, SelectItem selectItem,

-                                             UIComponent selectItemComponent,
-                                             boolean useSubmittedValues, Set lookupSet,
-                                             Converter converter, boolean pageDirectionLayout,

-                                             Integer itemNum) throws IOException
-    {
 
         ResponseWriter writer = facesContext.getResponseWriter();
 
@@ -304,8 +289,7 @@ public class HtmlCheckboxRendererBase ex
 
             boolean disabled = selectItem.isDisabled();
 
-            String itemId = renderCheckbox(facesContext, selectMany, itemStrValue, selectItemComponent,
-                    disabled, checked, false, itemNum);
+            String itemId = renderCheckbox(facesContext, selectMany, itemStrValue, disabled,
checked, false, itemNum);
 
             // label element after the input
             boolean componentDisabled = isDisabled(facesContext, selectMany);
@@ -339,16 +323,7 @@ public class HtmlCheckboxRendererBase ex
      * @return the 'id' value of the rendered element
      */
     protected String renderCheckbox(FacesContext facesContext,
-            UIComponent uiComponent, String value,
-            boolean disabled, boolean checked, 
-            boolean renderId, Integer itemNum) throws IOException
-    {
-        return renderCheckbox(facesContext, uiComponent, value, null, disabled, checked,
renderId, itemNum);
-    }
-    
-    protected String renderCheckbox(FacesContext facesContext,
-            UIComponent uiComponent, String value, UIComponent selectItemComponent,
-            boolean disabled, boolean checked, 
+            UIComponent uiComponent, String value, boolean disabled, boolean checked, 
             boolean renderId, Integer itemNum) throws IOException
     {
         String clientId = uiComponent.getClientId(facesContext);
@@ -358,7 +333,7 @@ public class HtmlCheckboxRendererBase ex
 
         ResponseWriter writer = facesContext.getResponseWriter();
 
-        writer.startElement(HTML.INPUT_ELEM, selectItemComponent);
+        writer.startElement(HTML.INPUT_ELEM, uiComponent);
 
         if (itemId != null)
         {

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java?rev=1585677&r1=1585676&r2=1585677&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
Tue Apr  8 10:24:38 2014
@@ -40,8 +40,6 @@ import javax.faces.model.SelectItemGroup
 import org.apache.myfaces.shared.renderkit.JSFAttr;
 import org.apache.myfaces.shared.renderkit.RendererUtils;
 import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
-import org.apache.myfaces.shared.renderkit.html.util.SelectItemInfo;
-import org.apache.myfaces.shared.renderkit.html.util.SelectItemsUtils;
 
 public class HtmlRadioRendererBase
         extends HtmlRenderer
@@ -111,7 +109,7 @@ public class HtmlRadioRendererBase
         }
 
         Converter converter;
-        List<SelectItemInfo> selectItemList = SelectItemsUtils.getSelectItemInfoList(
+        List selectItemList = org.apache.myfaces.shared.renderkit.RendererUtils.getSelectItemList(
                 selectOne, facesContext);
         converter = HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, selectOne);
         
@@ -121,13 +119,12 @@ public class HtmlRadioRendererBase
 
         int itemNum = 0;
 
-        for (Iterator<SelectItemInfo> it = selectItemList.iterator(); it.hasNext();
)
+        for (Iterator it = selectItemList.iterator(); it.hasNext(); )
         {
-            SelectItemInfo selectItemInfo = (SelectItemInfo)it.next();
-            SelectItem selectItem = selectItemInfo.getItem();
+            SelectItem selectItem = (SelectItem)it.next();
 
             itemNum = renderGroupOrItemRadio(facesContext, selectOne,
-                                             selectItem, selectItemInfo.getComponent(), currentValue,
+                                             selectItem, currentValue,
                                              converter, pageDirectionLayout, itemNum);
         }
 
@@ -160,6 +157,7 @@ public class HtmlRadioRendererBase
          return (String)selectOne.getAttributes().get(JSFAttr.STYLE_CLASS_ATTR);
      }
 
+
     /**
      * Renders the given SelectItem(Group)
      * @return the itemNum for the next item
@@ -170,17 +168,6 @@ public class HtmlRadioRendererBase
                                          Converter converter, boolean pageDirectionLayout,
                                          Integer itemNum) throws IOException
     {
-        return renderGroupOrItemRadio(facesContext, uiComponent, selectItem, null, 
-                currentValue, converter, pageDirectionLayout, itemNum);
-    }
-
-    protected int renderGroupOrItemRadio(FacesContext facesContext,
-                                         UIComponent uiComponent, SelectItem selectItem,

-                                         UIComponent selectItemComponent,
-                                         Object currentValue,
-                                         Converter converter, boolean pageDirectionLayout,
-                                         Integer itemNum) throws IOException
-    {
 
         ResponseWriter writer = facesContext.getResponseWriter();
 
@@ -277,7 +264,7 @@ public class HtmlRadioRendererBase
     
             boolean itemDisabled = selectItem.isDisabled();
     
-            String itemId = renderRadio(facesContext, selectOne, itemStrValue, selectItemComponent,
itemDisabled, 
+            String itemId = renderRadio(facesContext, selectOne, itemStrValue, itemDisabled,

                     itemChecked, false, itemNum);
     
             // label element after the input
@@ -310,18 +297,6 @@ public class HtmlRadioRendererBase
         renderRadio(facesContext, (UIInput) uiComponent, value, disabled, checked, renderId,
0);
     }
 
-    
-    protected String renderRadio(FacesContext facesContext,
-                               UIInput uiComponent,
-                               String value,
-                               boolean disabled,
-                               boolean checked,
-                               boolean renderId,
-                               Integer itemNum)
-            throws IOException
-    {
-        return renderRadio(facesContext, uiComponent, value, null, disabled, checked, renderId,
itemNum);
-    }    
     /**
      * Renders the input item
      * @return the 'id' value of the rendered element
@@ -329,7 +304,6 @@ public class HtmlRadioRendererBase
     protected String renderRadio(FacesContext facesContext,
                                UIInput uiComponent,
                                String value,
-                               UIComponent selectItemComponent,
                                boolean disabled,
                                boolean checked,
                                boolean renderId,
@@ -343,7 +317,7 @@ public class HtmlRadioRendererBase
 
         ResponseWriter writer = facesContext.getResponseWriter();
 
-        writer.startElement(HTML.INPUT_ELEM, selectItemComponent);
+        writer.startElement(HTML.INPUT_ELEM, uiComponent);
 
         if (itemId != null)
         {



Mime
View raw message