incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r533185 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src: main/java/org/apache/myfaces/trinidadinternal/renderkit/core/ main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/ main/java/org/apache/myfaces/trinidadinternal...
Date Fri, 27 Apr 2007 18:28:53 GMT
Author: awiner
Date: Fri Apr 27 11:28:51 2007
New Revision: 533185

URL: http://svn.apache.org/viewvc?view=rev&rev=533185
Log:
ADFFACES-469: ResponseWriter.writeText() can throw NPE if text is null - protect against this
- Also, delete unused ProductBrandingRenderer code
- And clean up some panelChoice and panelRadio renderer code
- And make TestResponseWriter throw an exception if null is passed to writeText()

Removed:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ProductBrandingRenderer.java
Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/FrameRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AccessKeyUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/HiddenLabelUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelHeaderRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputTextRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelChoiceRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelRadioRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/ShowOneListRendererBase.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/UIConstants.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ApplicationSwitcherRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/HeaderRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/MessageBoxRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageHeaderLayoutRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/TreeRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/HeaderRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/MessageBoxRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/GlobalHeaderRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestResponseWriter.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/DialogRequest.java
Fri Apr 27 11:28:51 2007
@@ -127,7 +127,8 @@
     out.writeText("},\"" , null);
     out.writeText(formName, null);
     out.writeText("\",\"", null);
-    out.writeText(_clientId, null);
+    if (_clientId != null)
+      out.writeText(_clientId, null);
     out.writeText("\",", null);
     boolean isPPR = PartialPageUtils.supportsPartialRendering(arc);
     out.writeText(isPPR ? "1" : "0", null);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/FrameRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/FrameRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/FrameRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/FrameRenderer.java
Fri Apr 27 11:28:51 2007
@@ -98,7 +98,7 @@
       renderEncodedActionURI(context, "href", source);
       if (shortDesc != null)
         writer.writeText(shortDesc, "shortDesc");
-      else
+      else if (source != null)
         writer.writeText(source, null);
 
       writer.endElement("a");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AccessKeyUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AccessKeyUtils.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AccessKeyUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AccessKeyUtils.java
Fri Apr 27 11:28:51 2007
@@ -89,7 +89,8 @@
     else
     {
       // output the text directly since we have no access key
-      writer.writeText(textValue, null);
+      if (textValue != null)
+        writer.writeText(textValue, null);
     }
   }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java
Fri Apr 27 11:28:51 2007
@@ -555,7 +555,9 @@
     String                sortOnclick) throws IOException
   {
     ResponseWriter rw = context.getResponseWriter();
-    rw.writeText(getHeaderText(getFacesBean(column)), "headerText");
+    String headerText = getHeaderText(getFacesBean(column));
+    if (headerText != null)
+      rw.writeText(headerText, "headerText");
 
     UIComponent header = getFacet(column, CoreColumn.HEADER_FACET);
     if (header != null)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/HiddenLabelUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/HiddenLabelUtils.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/HiddenLabelUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/HiddenLabelUtils.java
Fri Apr 27 11:28:51 2007
@@ -123,13 +123,16 @@
     UIComponent         component
     ) throws IOException
   {
-    ResponseWriter writer = context.getResponseWriter();
-    writer.startElement("label", component);
-    writer.writeAttribute("for", id, null);
-    XhtmlRenderer.renderStyleClass(context, arc,
-                                   SkinSelectors.HIDDEN_LABEL_STYLE_CLASS);
-    writer.writeText(text, null);
-    writer.endElement("label");
+    if (text != null)
+    {
+      ResponseWriter writer = context.getResponseWriter();
+      writer.startElement("label", component);
+      writer.writeAttribute("for", id, null);
+      XhtmlRenderer.renderStyleClass(context, arc,
+                                     SkinSelectors.HIDDEN_LABEL_STYLE_CLASS);
+      writer.writeText(text, null);
+      writer.endElement("label");
+    }
   }
 
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java
Fri Apr 27 11:28:51 2007
@@ -517,7 +517,9 @@
         writer.endElement("img");
       }
 
-      writer.writeText(getShortDesc(bean), "shortDesc");
+      String shortDesc = getShortDesc(bean);
+      if (shortDesc != null)
+        writer.writeText(shortDesc, "shortDesc");
 
       writer.endElement("a");
     }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
Fri Apr 27 11:28:51 2007
@@ -312,8 +312,9 @@
                                                 getDisclosedTipKey(),
                                                 getUndisclosedTipKey());
       }
-
-      out.writeText(titleText, null);
+      
+      if (titleText != null)
+        out.writeText(titleText, null);
       out.endElement("a");
 
       out.endElement("div"); // Ending div for an individual panel

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelHeaderRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelHeaderRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelHeaderRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelHeaderRenderer.java
Fri Apr 27 11:28:51 2007
@@ -113,7 +113,8 @@
                        SkinSelectors.AF_PANEL_HEADER_ERROR_STYLE_CLASS);
     }
     
-    writer.writeText(text, "text");
+    if (text != null)
+      writer.writeText(text, "text");
 
     if (isError)
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
Fri Apr 27 11:28:51 2007
@@ -524,7 +524,9 @@
       rw.startElement("td", null);
       renderStyleClass(context, rc, SkinSelectors.SHUTTLE_HEADER_STYLE_CLASS);
       rw.writeAttribute("valign", "bottom", null);
-      rw.writeText(getLeadingHeader(bean), "leadingHeader");
+      String leadingHeader = getLeadingHeader(bean);
+      if (leadingHeader != null)
+        rw.writeText(leadingHeader, "leadingHeader");
       rw.endElement("td");
 
       rw.startElement("td", null);
@@ -547,7 +549,9 @@
       }
     }
 
-    rw.writeText(getTrailingHeader(bean), "trailingHeader");
+    String trailingHeader = getTrailingHeader(bean);
+    if (trailingHeader != null)
+      rw.writeText(trailingHeader, "trailingHeader");
     rw.endElement("td");
     rw.endElement("tr");
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputTextRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputTextRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputTextRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputTextRenderer.java
Fri Apr 27 11:28:51 2007
@@ -439,7 +439,8 @@
       } // endif !renderAsElement
       else
       {
-        rw.writeText(textValue, "value");
+        if (textValue != null)
+          rw.writeText(textValue, "value");
       }
     }  // endif isTextArea()
     else
@@ -447,7 +448,8 @@
       // Don't render anything for disabled password fields
       if (!getSecret(bean))
       {
-        rw.writeText(textValue, "value");
+        if (textValue != null)
+          rw.writeText(textValue, "value");
       }
     }
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
Fri Apr 27 11:28:51 2007
@@ -336,7 +336,8 @@
       writer.writeAttribute(XhtmlConstants.ONCLICK_ATTRIBUTE, onclick, null);
     }
 
-    writer.writeText(text, null);
+    if (text != null)
+      writer.writeText(text, null);
 
     if (onclick != null)
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java
Fri Apr 27 11:28:51 2007
@@ -244,7 +244,8 @@
     }   
     
     renderStyleClass(context, arc, styleClass);
-    writer.writeText(text, null);
+    if (text != null)
+      writer.writeText(text, null);
     writer.endElement(XhtmlConstants.LINK_ELEMENT);
     
     writer.endElement("div");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelChoiceRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelChoiceRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelChoiceRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelChoiceRenderer.java
Fri Apr 27 11:28:51 2007
@@ -33,7 +33,6 @@
 import org.apache.myfaces.trinidad.render.RenderUtils;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
 
-import org.apache.myfaces.trinidadinternal.share.url.URLEncoder;
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
 
@@ -123,7 +122,6 @@
 
     String compId = component.getClientId(context);
 
-    URLEncoder encoder = rCtx.getURLEncoder();
     ResponseWriter out = context.getResponseWriter();
 
     // draw table to contain the select UI control
@@ -140,7 +138,7 @@
 
     out.startElement("tr", component);
 
-    renderSelectLabel(rCtx, component, out, encoder, compId);
+    renderSelectLabel(rCtx, component, out, compId);
 
     // Render filler / separator between label and select control
     renderSpacerTD(out, component, getLabelControlSeparatorSize());
@@ -194,7 +192,6 @@
       out.writeAttribute("onchange", onChangeJS, null);
     }
 
-    URLEncoder encoder = rCtx.getURLEncoder();
     // Render options now.
     ListIterator<UIComponent> children = component.getChildren().listIterator();
     while (children.hasNext())
@@ -222,10 +219,6 @@
         }
 
         String childTitle = (String) detailItem.getAttributes().get("text");
-        if (childTitle != null)
-        {
-          childTitle = encoder.encodeParameter(childTitle);
-        }
         String childClientId = child.getClientId(context);
 
         out.startElement("option", component);
@@ -235,7 +228,9 @@
           out.writeAttribute("selected", Boolean.TRUE, null);
         }
 
-        out.writeText(childTitle, null);
+        if (childTitle != null)
+          out.writeText(childTitle, null);
+
         out.endElement("option");
       }
     }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelRadioRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelRadioRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelRadioRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/CorePanelRadioRenderer.java
Fri Apr 27 11:28:51 2007
@@ -32,7 +32,6 @@
 import org.apache.myfaces.trinidad.render.RenderUtils;
 
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinSelectors;
-import org.apache.myfaces.trinidadinternal.share.url.URLEncoder;
 import org.apache.myfaces.trinidadinternal.ui.UIConstants;
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.BaseLafUtils;
@@ -62,7 +61,6 @@
 
     String compId = component.getClientId(context);
 
-    URLEncoder encoder = rCtx.getURLEncoder();
     ResponseWriter out = context.getResponseWriter();
 
     // draw table to contain the select UI control
@@ -90,7 +88,8 @@
       renderStyleClassAttribute(rCtx,
                                 SkinSelectors.AF_LABEL_TEXT_STYLE_CLASS);
 
-    out.writeText(encoder.encodeParameter(label), null);
+    if (label != null)
+      out.writeText(label, null);
 
     out.endElement("span");
     out.endElement("td");
@@ -140,8 +139,6 @@
     out.writeAttribute("cellspacing", "0", null);
     out.writeAttribute("cellpadding", "0", null);
 
-    URLEncoder encoder = rCtx.getURLEncoder();
-
     ListIterator<UIComponent> children = component.getChildren().listIterator();
     while (children.hasNext())
     {
@@ -254,7 +251,6 @@
 
       writeLabel(out,
                  detailItem,
-                 encoder,
                  (String) detailItem.getAttributes().get("text"));
 
       out.endElement("span");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/ShowOneListRendererBase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/ShowOneListRendererBase.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/ShowOneListRendererBase.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/layout/ShowOneListRendererBase.java
Fri Apr 27 11:28:51 2007
@@ -34,7 +34,6 @@
 import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinSelectors;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
-import org.apache.myfaces.trinidadinternal.share.url.URLEncoder;
 import org.apache.myfaces.trinidadinternal.ui.UIConstants;
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
@@ -311,7 +310,6 @@
   protected void renderSelectLabel(UIXRenderingContext rCtx,
                                    UIComponent component,
                                    ResponseWriter out,
-                                   URLEncoder encoder,
                                    String compId)
    throws IOException
   {
@@ -337,7 +335,6 @@
 
     writeLabel(out,
               component,
-              encoder,
               (String) component.getAttributes().get("label"));
 
     out.endElement("label");
@@ -353,10 +350,10 @@
    */
   protected void writeLabel(ResponseWriter out,
                             UIComponent component,
-                            URLEncoder encoder,
                             String label)
     throws IOException
   {
+    // AdamWiner: TODO: replace this with a call to AccessKeyUtils
     Character accessChar =
       (Character) component.getAttributes().get("accessKey");
 
@@ -364,14 +361,14 @@
     {
       if (accessChar == null)
       {
-        out.writeText(encoder.encodeParameter(label), null);
+        out.writeText(label, null);
       }
       else
       {
         int accessKeyIndex = label.indexOf(accessChar.charValue());
         if (accessKeyIndex < 0)
         {
-          out.writeText(encoder.encodeParameter(label), null);
+          out.writeText(label, null);
         }
         else
         {
@@ -379,7 +376,7 @@
           String strBefAccessKey = label.substring(0, accessKeyIndex);
           String strAfterAccessKey = label.substring(accessKeyIndex + 1,
                                                      label.length());
-          out.writeText(encoder.encodeParameter(strBefAccessKey), null);
+          out.writeText(strBefAccessKey, null);
 
           //ADFFACES-153: use default style (underline) for access key
           out.startElement ("span", null);
@@ -389,7 +386,7 @@
           out.writeText (accessChar.toString(), null);
           out.endElement ("span");
           
-          out.writeText(encoder.encodeParameter(strAfterAccessKey), null);
+          out.writeText(strAfterAccessKey, null);
         }
       }
     }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/UIConstants.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/UIConstants.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/UIConstants.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/UIConstants.java
Fri Apr 27 11:28:51 2007
@@ -446,7 +446,6 @@
   public static final String PROCESS_TRAIN_NAME = "processTrain";
   public static final String PROCESSING_NAME = "processing";
   public static final String PROCESS_STEPS_NAME = "processSteps";
-  public static final String PRODUCT_BRANDING_NAME = "productBranding";
   public static final String RAW_TEXT_NAME = "rawText";
   public static final String ROW_LAYOUT_NAME = "rowLayout";
   public static final String SCRIPT_NAME = "script";

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ApplicationSwitcherRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ApplicationSwitcherRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ApplicationSwitcherRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ApplicationSwitcherRenderer.java
Fri Apr 27 11:28:51 2007
@@ -213,7 +213,8 @@
     writer.startElement(TABLE_DATA_ELEMENT, null);
     writer.writeAttribute(ALIGN_ATTRIBUTE, RIGHT_ATTRIBUTE_VALUE, null);
     renderStyleClassAttribute(context, AF_MENU_CHOICE_LABEL_STYLE_CLASS );
-    writer.writeText(title, "title");
+    if (title != null)
+      writer.writeText(title, "title");
     writer.endElement(TABLE_DATA_ELEMENT);
 
     // add cell with space in it

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
Fri Apr 27 11:28:51 2007
@@ -264,7 +264,6 @@
     PROCESS_CHOICE_BAR_NAME,
     PROCESS_TRAIN_NAME,
     PROCESSING_NAME,
-    PRODUCT_BRANDING_NAME,
     SEPARATOR_NAME,
     SHOW_ONE_TAB_NAME,
     SIDE_BAR_NAME,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java
Fri Apr 27 11:28:51 2007
@@ -95,7 +95,8 @@
       writer.endElement(IMAGE_ELEMENT);
     }
 
-    writer.writeText(text, TEXT_ATTR.getAttributeName());
+    if (text != null)
+      writer.writeText(text, TEXT_ATTR.getAttributeName());
 
     writer.endElement(LINK_ELEMENT);
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/HeaderRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/HeaderRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/HeaderRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/HeaderRenderer.java
Fri Apr 27 11:28:51 2007
@@ -180,7 +180,8 @@
       renderStyleClassAttribute(context, AF_PANEL_HEADER_ERROR_STYLE_CLASS);
     }
     
-    writer.writeText(label, TEXT_ATTR.getAttributeName());
+    if (label != null)
+      writer.writeText(label, TEXT_ATTR.getAttributeName());
 
     if (isError)
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/MessageBoxRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/MessageBoxRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/MessageBoxRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/MessageBoxRenderer.java
Fri Apr 27 11:28:51 2007
@@ -147,7 +147,8 @@
 
     writer.startElement(DIV_ELEMENT, null);
     renderStyleClassAttribute(context, AF_MESSAGES_MESSAGE_TEXT_STYLE_CLASS);
-    writer.writeText(message, CoreMessages.MESSAGE_KEY.getName());
+    if (message != null)
+      writer.writeText(message, CoreMessages.MESSAGE_KEY.getName());
     writer.endElement(DIV_ELEMENT);
 
     if (useList)
@@ -227,7 +228,7 @@
     String text = MessageUtils.getGlobalMessage(context, summary, detail);
     if (isTextFormatted(text))
       renderFormattedText(context, text);
-    else
+    else if (text != null)
       writer.writeText(text, null);
   }
 
@@ -262,7 +263,7 @@
 
     if (isTextFormatted(summary))
       renderFormattedText(context, description);
-    else
+    else if (description != null)
       writer.writeText(description, null);
 
     return currentChild;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageHeaderLayoutRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageHeaderLayoutRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageHeaderLayoutRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/PageHeaderLayoutRenderer.java
Fri Apr 27 11:28:51 2007
@@ -155,20 +155,6 @@
       ((inContextBranding != null) || isCompact);
 
 
-    if ((productBranding != null))
-    {
-      if (inContextOrCompact)
-      {
-        // The ProductBrandingBean changes look depending upon if the
-        // inContextBranding named child exists. So, set the property
-        // on the rendering context to communicate this with the
-        // ProductBrandingRenderer
-        setRenderingProperty(context,
-                             COMPACT_PRODUCT_BRANDING_PROPERTY,
-                             Boolean.TRUE);
-      }
-    }
-
     //
     // Create the middle table, if necessary.
     // brandingCount counts corporateBranding,
@@ -705,11 +691,6 @@
     }
     return colSpan;
   }
-
-  // context property to indicate that the compact Product Branding needs to be
-  // rendered -- either because inContextBranding exists or pageLayout's
-  // chromeType is compact.
-  public static final Object COMPACT_PRODUCT_BRANDING_PROPERTY = new Object();
 
   private static final int _TAB_SPACER_SIZE = 10;
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/TreeRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/TreeRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/TreeRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/TreeRenderer.java
Fri Apr 27 11:28:51 2007
@@ -330,7 +330,8 @@
       writer.writeAttribute(ONCLICK_ATTRIBUTE, onclick, null);
     }
 
-    writer.writeText(text, null);
+    if (text != null)
+      writer.writeText(text, null);
 
     if (onclick != null)
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/HeaderRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/HeaderRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/HeaderRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/HeaderRenderer.java
Fri Apr 27 11:28:51 2007
@@ -120,7 +120,8 @@
    
         renderIcon(context, node);
 
-        writer.writeText(label, CorePanelHeader.TEXT_KEY.getName());
+        if (label != null)
+          writer.writeText(label, CorePanelHeader.TEXT_KEY.getName());
 
         if (renderStyleElements(context))
             XhtmlLafUtils.endRenderingStyleElements(context);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/MessageBoxRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/MessageBoxRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/MessageBoxRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/pda/MessageBoxRenderer.java
Fri Apr 27 11:28:51 2007
@@ -139,10 +139,10 @@
     text.setAttributeValue(TEXT_ATTR, getTranslatedString(context, messageKey) );
 
     //PH: Create BODY Styling for the entire MessageBox.
-	writer.startElement("table", null);
-	renderStyleClassAttribute(context, "af|messages::body");
-	writer.startElement("tr", null);
-	writer.startElement("td", null);
+    writer.startElement("table", null);
+    renderStyleClassAttribute(context, "af|messages::body");
+    writer.startElement("tr", null);
+    writer.startElement("td", null);
 
 
     writer.startElement("b", node.getUIComponent());
@@ -252,7 +252,7 @@
     String text = MessageUtils.getGlobalMessage(context, summary, detail);
     if (isTextFormatted(text))
       renderFormattedText(context, text);
-    else
+    else if (text != null)
       writer.writeText(text, null);
   }
 
@@ -286,7 +286,7 @@
 
     if (isTextFormatted(summary))
       renderFormattedText(context, description);
-    else
+    else if (description != null)
       writer.writeText(description, null);
 
     return currentChild;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/GlobalHeaderRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/GlobalHeaderRenderer.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/GlobalHeaderRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/GlobalHeaderRenderer.java
Fri Apr 27 11:28:51 2007
@@ -434,7 +434,7 @@
     Object           text
     ) throws IOException
   {
- context.getResponseWriter().writeText(text, null);
+    context.getResponseWriter().writeText(text, null);
   }
 
   // Gets the style class for the inner content

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestResponseWriter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestResponseWriter.java?view=diff&rev=533185&r1=533184&r2=533185
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestResponseWriter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestResponseWriter.java
Fri Apr 27 11:28:51 2007
@@ -337,6 +337,8 @@
   public void writeText(Object text, String componentPropertyName)
      throws IOException
   {
+    _checkText(text);
+
     if (text != null)
     {
       _closeStartIfNecessary();
@@ -357,6 +359,7 @@
   public void writeText(char text[], int off, int len)
         throws IOException
   {
+    _checkText(text);
     // Hardly efficient, but easier to write the one bottleneck.
     writeText(new String(text, off, len), null);
   }
@@ -486,6 +489,12 @@
     {
       XMLEscapes.writeText(_out, value.toString().toCharArray());
     }
+  }
+
+  private void _checkText(Object text)
+  {
+    if (text == null)
+      throw new NullPointerException();
   }
 
 



Mime
View raw message