myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r891522 [9/28] - in /myfaces/trinidad/branches/trinidad-2.0.x: ./ trinidad-api/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ trinidad-api/src/main/java/org/ap...
Date Thu, 17 Dec 2009 02:33:11 GMT
Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImageRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImageRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImageRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,19 +27,20 @@
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
 import org.apache.myfaces.trinidad.component.core.output.CoreImage;
-
 import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidadinternal.renderkit.core.CoreRendererUtils;
 
+
 public class ImageRenderer extends XhtmlRenderer
 {
   public ImageRenderer()
   {
     super(CoreImage.TYPE);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _imageMapTypeKey = type.findKey("imageMapType");
@@ -55,78 +56,89 @@
 
   @Override
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext    arc,
-    UIComponent         comp,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      comp,
+    FacesBean        bean
+    ) throws IOException
   {
-    if (canSkipRendering(context, arc, comp))
+    if (canSkipRendering(context, rc, comp))
       return;
 
     ResponseWriter rw = context.getResponseWriter();
     rw.startElement("img", comp);
-    renderId(context, arc, comp, rw);
-    renderAllAttributes(context, arc, bean);
+    renderId(context, rc, comp, rw);
+    renderAllAttributes(context, rc, comp, bean);
     rw.endElement("img");
   }
 
   @Override
   protected void renderAllAttributes(
-    FacesContext        context,
-    RenderingContext arc,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
     ResponseWriter rw = context.getResponseWriter();
 
-    super.renderAllAttributes(context, arc, bean);
+    super.renderAllAttributes(context, rc, component, bean);
 
-    renderEncodedResourceURI(context, "src", getSource(bean));
-    renderEncodedActionURI(context, "longdesc", getLongDescURL(bean));
+    renderEncodedResourceURI(context, "src", getSource(component, bean));
+    renderEncodedActionURI(context, "longdesc", getLongDescURL(component, bean));
 
-    _renderImageMap(bean, rw);
+    _renderImageMap(component, bean, rw);
   }
 
   @Override
   protected void renderShortDescAttribute(
-    FacesContext        context,
-    RenderingContext arc,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
-    String shortDesc = getShortDesc(bean);
+    String shortDesc = getShortDesc(component, bean);
     if (shortDesc != null)
     {
-      OutputUtils.renderAltAndTooltipForImage(context, arc,
+      OutputUtils.renderAltAndTooltipForImage(context, rc,
                                               shortDesc);
     }
   }
 
-  protected String getImageMapType(FacesBean bean)
+  protected String getImageMapType(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_imageMapTypeKey));
   }
 
-  protected String getLongDescURL(FacesBean bean)
+  protected String getLongDescURL(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toActionUri(FacesContext.getCurrentInstance(),bean.getProperty(_longDescURLKey));
   }
 
-  protected String getSource(FacesBean bean)
+  protected String getSource(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toResourceUri(FacesContext.getCurrentInstance(),bean.getProperty(_sourceKey));
   }
 
   protected void renderId(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         comp,
-    ResponseWriter      writer
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      comp,
+    ResponseWriter   writer
     ) throws IOException
   {
     super.renderId(context, comp);
 
     // only output the name if the agent supports it
     if (shouldRenderId(context, comp)
-        && CoreRendererUtils.supportsNameIdentification(arc))
+        && CoreRendererUtils.supportsNameIdentification(rc))
     {
       String clientId = getClientId(context, comp);
       writer.writeAttribute("name", clientId, null);
@@ -134,10 +146,12 @@
   }
 
   private void _renderImageMap(
-    FacesBean           bean,
-    ResponseWriter      writer) throws IOException
+    UIComponent    component,
+    FacesBean      bean,
+    ResponseWriter writer
+    ) throws IOException
   {
-    String mType = getImageMapType(bean);
+    String mType = getImageMapType(component, bean);
     if (CoreImage.IMAGE_MAP_TYPE_SERVER.equals(mType))
       writer.writeAttribute("ismap", Boolean.TRUE, "imageMapType");
   }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImportScriptRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImportScriptRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImportScriptRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ImportScriptRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,11 +25,10 @@
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
-
 import org.apache.myfaces.trinidad.component.core.CoreImportScript;
-
 import org.apache.myfaces.trinidad.context.RenderingContext;
 
+
 /**
  *
  */
@@ -41,7 +40,8 @@
   }
 
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     _namesKey = type.findKey("names");
   }
@@ -54,10 +54,11 @@
 
   @Override
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext    rc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
     Object names = bean.getProperty(_namesKey);
     if (names instanceof Object[])
@@ -73,4 +74,4 @@
   }
 
   private PropertyKey _namesKey;
-}
+}
\ No newline at end of file

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputColorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputColorRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputColorRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputColorRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,7 @@
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputColor;
@@ -27,49 +28,54 @@
 
 public class InputColorRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputColorRenderer()
   {
     super(CoreInputColor.TYPE);
-  }  
+  }
 
-  protected InputColorRenderer(FacesBean.Type type)
+  protected InputColorRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputColor = new SimpleInputColorRenderer(type);
   }
 
   @Override
-  protected String getRootStyleClass(FacesBean bean)  
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputColor";
-  }  
-    
+  }
+
   @Override
   protected FormInputRenderer getFormInputRenderer()
   {
     return _simpleInputColor;
   }
-  
+
   @Override
   protected String getLabelFor(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean)
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean)
   {
-    if (_isCompact(bean))
+    if (_isCompact(component, bean))
       return null;
-    return super.getLabelFor(context, arc, component, bean);
+    return super.getLabelFor(context, rc, component, bean);
   }
-  
-  private boolean _isCompact(FacesBean bean)
+
+  private boolean _isCompact(
+    UIComponent component,
+    FacesBean   bean)
   {
     FacesBean.Type type = CoreInputColor.TYPE;
     PropertyKey compactKey = type.findKey("compact");

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputDateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputDateRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputDateRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputDateRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,24 +18,28 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
+import javax.faces.component.UIComponent;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputDate;
 
+
 public class InputDateRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputDateRenderer()
   {
     super(CoreInputDate.TYPE);
-  }  
-  
-  protected InputDateRenderer(FacesBean.Type type)
+  }
+
+  protected InputDateRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputDate = new SimpleInputDateRenderer(type);
@@ -48,10 +52,12 @@
   }
 
   @Override
-  protected String getRootStyleClass(FacesBean bean)  
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputDate";
-  }  
+  }
 
   private SimpleInputDateRenderer _simpleInputDate;
 }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputFileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputFileRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputFileRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputFileRenderer.java Thu Dec 17 02:33:05 2009
@@ -31,19 +31,20 @@
 
 public class InputFileRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputFileRenderer()
   {
     super(CoreInputFile.TYPE);
   }
 
-  protected InputFileRenderer(FacesBean.Type type)
+  protected InputFileRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
 
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputFile = new SimpleInputFileRenderer(type);
@@ -71,7 +72,9 @@
   }
 
   @Override
-  protected String getRootStyleClass(FacesBean bean)
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputFile";
   }
@@ -88,7 +91,9 @@
    * @return false, since inputFile does not support the readOnly attribute
    */
   @Override
-  protected boolean isReadOnly(FacesBean bean)
+  protected boolean isReadOnly(
+    UIComponent component,
+    FacesBean   bean)
   {
     return false;
   }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputHiddenRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputHiddenRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputHiddenRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputHiddenRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,17 +26,17 @@
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputHidden;
-
 import org.apache.myfaces.trinidad.context.FormData;
 import org.apache.myfaces.trinidad.context.RenderingContext;
 
+
 public class InputHiddenRenderer extends EditableValueRenderer
 {
   public InputHiddenRenderer()
   {
     super(CoreInputHidden.TYPE);
   }
-  
+
   @Override
   protected boolean wasSubmitted(
     FacesContext context,
@@ -53,13 +53,14 @@
 
   @Override
   protected final void encodeAll(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
     String id = getClientId(context, component);
-    if (canSkipRendering(arc, id))
+    if (canSkipRendering(rc, id))
       return;
 
     ResponseWriter rw = context.getResponseWriter();
@@ -72,7 +73,7 @@
                       "value");
     rw.endElement("input");
 
-    FormData fd = arc.getFormData();
+    FormData fd = rc.getFormData();
     if (fd != null)
       fd.addRenderedValue(id);
 

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,43 +19,47 @@
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
 import java.io.IOException;
+
 import java.util.List;
 
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-
 import javax.faces.context.ResponseWriter;
-import org.apache.myfaces.trinidad.bean.FacesBean;
 
+import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
 import org.apache.myfaces.trinidad.context.FormData;
 import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidadinternal.util.MessageUtils;
 
+
 public abstract class InputLabelAndMessageRenderer extends LabelAndMessageRenderer
 {
-
-  protected InputLabelAndMessageRenderer(FacesBean.Type type)
+  protected InputLabelAndMessageRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleKey   = type.findKey("simple");
     _disabledKey   = type.findKey("disabled");
     _readOnlyKey   = type.findKey("readOnly");
-  }  
-  
+  }
+
   @Override
-  public void decode(FacesContext context, UIComponent component)
+  public void decode(
+    FacesContext context,
+    UIComponent  component)
   {
      getFormInputRenderer().decode(context, component);
   }
-  
+
   @Override
   public Object getConvertedValue(
     FacesContext context,
@@ -69,43 +73,42 @@
 
   @Override
   protected String getLabelFor(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean)
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean)
   {
-      
-    if (!getFormInputRenderer().renderAsElement(context, arc, bean))
+    if (!getFormInputRenderer().renderAsElement(context, rc, component, bean))
       return null;
 
-    return __getCachedClientId(arc);
+    return __getCachedClientId(rc);
   }
 
-
   @Override
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext    arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
-    if (getSimple(bean))
+    if (getSimple(component, bean))
     {
       String clientId = component.getClientId(context);
       // If we're a leaf component, see if we can skip our rendering
-      if (isLeafRenderer() && canSkipRendering(arc, clientId))
+      if (isLeafRenderer() && canSkipRendering(rc, clientId))
         return;
 
-      String saved = arc.getCurrentClientId();
-      arc.setCurrentClientId(clientId);
-      
-      // add the label to FormData so that it can be used in 
+      String saved = rc.getCurrentClientId();
+      rc.setCurrentClientId(clientId);
+
+      // add the label to FormData so that it can be used in
       // client side validation error messages.
-      String value = getLabel(bean);
-      FormData fd = arc.getFormData();
+      String value = getLabel(component, bean);
+      FormData fd = rc.getFormData();
       if (fd != null)
-        fd.addLabel(clientId, value); 
-      
+        fd.addLabel(clientId, value);
+
       FacesMessage msg = MessageUtils.getFacesMessage(context, clientId);
       if (msg != null)
       {
@@ -115,38 +118,42 @@
         writer.writeAttribute("name", anchor, null);
         writer.endElement("a");
       }
-      
-      delegateRenderer(context, arc, component, bean, getFormInputRenderer());
-      arc.setCurrentClientId(saved);
+
+      delegateRenderer(context, rc, component, bean, getFormInputRenderer());
+      rc.setCurrentClientId(saved);
     }
     else
     {
-      super.encodeAll(context, arc, component, bean);
+      super.encodeAll(context, rc, component, bean);
     }
   }
-  
+
   /**
-   * If it's known that the field content is not editable, return false. 
+   * If it's known that the field content is not editable, return false.
    * Otherwise, assume it is editable and return true
    */
   @Override
-  protected boolean isContentEditable(FacesBean bean)
+  protected boolean isContentEditable(
+    UIComponent component,
+    FacesBean   bean)
   {
-    return !getFormInputRenderer().getReadOnly(
-                                   FacesContext.getCurrentInstance(), bean);  
+    return !getFormInputRenderer().getReadOnly(FacesContext.getCurrentInstance(), component, bean);
   }
- 
+
   @Override
   protected void renderFieldCellContents(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
-  {
-    delegateRenderer(context, arc, component, bean, getFormInputRenderer());
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
+  {
+    delegateRenderer(context, rc, component, bean, getFormInputRenderer());
   }
- 
-  protected boolean getSimple(FacesBean bean)
+
+  protected boolean getSimple(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_simpleKey);
     if (o == null)
@@ -154,48 +161,49 @@
 
     return !Boolean.FALSE.equals(o);
   }
-   
+
   /**
    * Render the styles and style classes that should go on the root dom element.
    * (called from LabelAndMessageRenderer, the superclass)
    * @param context
-   * @param arc
+   * @param rc
    * @param component
    * @param bean
    * @throws IOException
-   */  
+   */
   @Override
   protected void renderRootDomElementStyles(
   FacesContext     context,
-  RenderingContext arc,
+  RenderingContext rc,
   UIComponent      component,
-  FacesBean        bean) throws IOException
+  FacesBean        bean
+    ) throws IOException
   {
-    // get the style classes that I want to render on the root dom element here.  
-    String styleClass         = getStyleClass(bean);
-    String contentStyleClass  = getRootStyleClass(bean);
+    // get the style classes that I want to render on the root dom element here.
+    String styleClass         = getStyleClass(component, bean);
+    String contentStyleClass  = getRootStyleClass(component, bean);
     String disabledStyleClass = null;
     String readOnlyStyleClass = null;
     String requiredStyleClass = null;
-   
-    // readOnly takes precedence over disabled for the state.  
+
+    // readOnly takes precedence over disabled for the state.
     // -= Simon =- Why?
-    if(isReadOnly(bean))
-    { // FIXME: Unlike FormInputRenderer, this isReadOnly does not check  
+    if(isReadOnly(component, bean))
+    { // FIXME: Unlike FormInputRenderer, this isReadOnly does not check
       //        if the specified value binding is writable. Inconsistent,
       //        what behavior should we keep?
       readOnlyStyleClass = SkinSelectors.STATE_READ_ONLY;
     }
-    else if (isDisabled(bean))
+    else if (isDisabled(component, bean))
     {
       disabledStyleClass = SkinSelectors.STATE_DISABLED;
     }
-   
-    if(labelShowRequired(bean))
+
+    if(labelShowRequired(component, bean))
     {
       requiredStyleClass = SkinSelectors.STATE_REQUIRED;
     }
-   
+
     List<String> parsedStyleClasses =
       OutputUtils.parseStyleClassList(styleClass);
     int userStyleClassCount;
@@ -224,11 +232,13 @@
     styleClasses[i++] = readOnlyStyleClass;
     styleClasses[i++] = requiredStyleClass;
 
-    renderStyleClasses(context, arc, styleClasses);
-    renderInlineStyle(context, arc, bean);  
+    renderStyleClasses(context, rc, styleClasses);
+    renderInlineStyle(context, rc, component, bean);
   }
-    
-  protected boolean isDisabled(FacesBean bean)
+
+  protected boolean isDisabled(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_disabledKey);
     if (o == null)
@@ -236,8 +246,10 @@
 
     return !Boolean.FALSE.equals(o);
   }
-  
-  protected boolean isReadOnly(FacesBean bean)
+
+  protected boolean isReadOnly(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_readOnlyKey);
     if (o == null)
@@ -245,16 +257,15 @@
 
     return !Boolean.FALSE.equals(o);
   }
-   
+
   /**
    * @todo Default shortDesc to label when inside the data area
    * of the table (and for screenReaderMode + radio buttons?!?)
    */
   abstract protected FormInputRenderer getFormInputRenderer();
-  
 
   private PropertyKey   _simpleKey;
-  
+
   private PropertyKey   _disabledKey;
   private PropertyKey   _readOnlyKey;
 }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputListOfValuesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputListOfValuesRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputListOfValuesRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputListOfValuesRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,36 +18,41 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
+import javax.faces.component.UIComponent;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputListOfValues;
 
+
 public class InputListOfValuesRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputListOfValuesRenderer()
   {
     super(CoreInputListOfValues.TYPE);
-  }  
+  }
 
-  protected InputListOfValuesRenderer(FacesBean.Type type)
+  protected InputListOfValuesRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputListOfValues = new SimpleInputListOfValuesRenderer(type);
   }
 
-
   @Override
-  protected String getRootStyleClass(FacesBean bean)  
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputListOfValues";
-  } 
- 
+  }
+
   @Override
   protected FormInputRenderer getFormInputRenderer()
   {

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputNumberSpinboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputNumberSpinboxRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputNumberSpinboxRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputNumberSpinboxRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,38 +18,45 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
+import javax.faces.component.UIComponent;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputNumberSpinbox;
 
+
 public class InputNumberSpinboxRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputNumberSpinboxRenderer()
   {
     super(CoreInputNumberSpinbox.TYPE);
   }
 
-  protected InputNumberSpinboxRenderer(FacesBean.Type type)
+  protected InputNumberSpinboxRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputNumberSpinbox = new SimpleInputNumberSpinboxRenderer(type);
   }
 
-
   @Override
-  protected String getRootStyleClass(FacesBean bean)
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputNumberSpinbox";
   }
 
   @Override
-  protected String getDefaultLabelValign(FacesBean bean)
+  protected String getDefaultLabelValign(
+    UIComponent component,
+    FacesBean   bean)
   {
     return null;
   }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputTextRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputTextRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputTextRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputTextRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,39 +18,47 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
+import javax.faces.component.UIComponent;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.component.core.input.CoreInputText;
 
+
 public class InputTextRenderer extends InputLabelAndMessageRenderer
 {
-
   public InputTextRenderer()
   {
     super(CoreInputText.TYPE);
-  } 
+  }
 
-  protected InputTextRenderer(FacesBean.Type type)
+  protected InputTextRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _simpleInputText = new SimpleInputTextRenderer(type);
   }
 
   @Override
-  protected String getRootStyleClass(FacesBean bean)  
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return "af|inputText";
-  } 
-  
+  }
+
   @Override
-  protected String getDefaultLabelValign(FacesBean bean)
+  protected String getDefaultLabelValign(
+    UIComponent component,
+    FacesBean   bean)
   {
-    if (_simpleInputText.isTextArea(bean))
+    if (_simpleInputText.isTextArea(component, bean))
       return "top";
 
     return null;
@@ -61,6 +69,6 @@
   {
     return _simpleInputText;
   }
- 
+
   private SimpleInputTextRenderer _simpleInputText;
 }

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,6 +19,7 @@
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
 import java.io.IOException;
+
 import java.util.Map;
 
 import javax.faces.component.UIComponent;
@@ -44,7 +45,8 @@
   static public final String INLINE_MESSAGE_DEFAULT_GAP = "12";
   static public final String INLINE_MESSAGE_PDA_GAP     = "2";
 
-  public LabelAndMessageRenderer(FacesBean.Type type)
+  public LabelAndMessageRenderer(
+    FacesBean.Type type)
   {
     super(type);
   }
@@ -56,7 +58,8 @@
   }
 
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
 
@@ -68,8 +71,9 @@
     _label = new Label(type, false);
     _labelInTable = new Label(type, true);
   }
-  
-  private boolean _needsTableTag(UIComponent component)
+
+  private boolean _needsTableTag(
+    UIComponent component)
   {
     // Find the first content-generating parent
     UIComponent parent = XhtmlUtils.getStructuralParent(component);
@@ -91,7 +95,9 @@
     return true;
   }
 
-  private boolean _isParentPanelForm(FacesContext context, UIComponent component)
+  private boolean _isParentPanelForm(
+    FacesContext context,
+    UIComponent  component)
   {
     if (PanelFormLayoutRenderer.__isInPanelFormLayout(context, component))
     {
@@ -143,7 +149,7 @@
     // For narrow-screen PDAs, always render the Label above fields.
     if (supportsNarrowScreen(RenderingContext.getCurrentInstance()))
       return false;
-          
+
     if (needsPanelFormLayout)
     {
       Map requestMap = context.getExternalContext().getRequestMap();
@@ -160,8 +166,8 @@
     FacesContext     context,
     RenderingContext rc,
     UIComponent      component,
-    FacesBean        bean)
-    throws IOException
+    FacesBean        bean
+    ) throws IOException
   {
     // do nothing for now
   }
@@ -193,11 +199,11 @@
     FacesContext     context,
     RenderingContext rc,
     UIComponent      component,
-    FacesBean        bean)
-    throws IOException
+    FacesBean        bean
+    ) throws IOException
   {
     String clientId = component.getClientId(context);
-    
+
     // If we're a leaf component, see if we can skip our rendering
     if (isLeafRenderer() && canSkipRendering(rc, clientId))
     {
@@ -213,9 +219,9 @@
 
     boolean isInTable = _isInTable();
 
-    if (hasOwnLabel(bean) || isInTable)
+    if (hasOwnLabel(component, bean) || isInTable)
     {
-      String value = getLabel(bean);
+      String value = getLabel(component, bean);
       FormData fd = rc.getFormData();
       if (fd != null)
         fd.addLabel(clientId, value);
@@ -237,9 +243,9 @@
         rw.endElement("div");
         _renderMessageCellContents(context, rc, component, bean);
       }
-      
+
       // In the case of narrow-screen PDAs, to reduce the component's width,
-      // End facet is always rendered below. 
+      // End facet is always rendered below.
       renderEndFacetForNarrowPDA(context, rc, component, true);
     }
     else
@@ -259,7 +265,7 @@
         rw.startElement("table", component);
         // =-=AEW THIS DOESN'T SEEM RIGHT - IT SHOULD GO ON THE INPUT FIELD
         // ONLY, RIGHT?  Matching UIX 2.2 behavior here.
-        rw.writeAttribute("title", getShortDesc(bean), "title");
+        rw.writeAttribute("title", getShortDesc(component, bean), "title");
         if (!isDesktop(rc))
         {
           // On PDA browsers label and message pair is always
@@ -290,12 +296,12 @@
         //rw.startElement("table", component);
         //OutputUtils.renderLayoutTableAttributes(context, rc, "0", null);
         //rw.startElement("tbody", component);
-        //rw.startElement("tr", component); 
+        //rw.startElement("tr", component);
         //renderRootDomElementStyles(context, rc, component, bean);
 
-        // Basically, we're screwed unless we specify panelForm to keep a 
+        // Basically, we're screwed unless we specify panelForm to keep a
         // class-less container opened to receive the rootDomStyles.
-        // Even if this is the case we need a way to detect if a new 
+        // Even if this is the case we need a way to detect if a new
         // element get opened from encodeBetweenLabelAndFieldCells call.
         // Since the above option is so ugly, I'll assume that.
         // FIXME: That's too strongly coupled to my taste. Even being stuck
@@ -303,7 +309,7 @@
         renderRootDomElementStyles(context, rc, component, bean);
       }
 
-      boolean labelExists = (getLabel(bean) != null);
+      boolean labelExists = (getLabel(component, bean) != null);
 
       _renderLabelCell(context, rc, component, bean, labelExists);
 
@@ -332,7 +338,7 @@
         }
         else
         {
-          rw.writeAttribute("width", hspaceObject, null);              
+          rw.writeAttribute("width", hspaceObject, null);
         }
         rw.endElement("td");
       }
@@ -364,11 +370,11 @@
           rw.endElement("tr");
         }
       }
-      
+
       // In the case of narrow-screen PDAs, to reduce the component's width,
       // End facet is always rendered below.
       renderEndFacetForNarrowPDA(context, rc, component, false);
-      
+
       if (needsTableTag)
       {
         rw.endElement("table");
@@ -379,11 +385,13 @@
   }
 
   // subclasses should override this
-  protected String getRootStyleClass(FacesBean bean)
+  protected String getRootStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     return null;
   }
-  
+
   /**
    * @todo Get cell alignment from skin property.
    */
@@ -392,31 +400,31 @@
     RenderingContext rc,
     UIComponent      component,
     FacesBean        bean,
-    boolean          labelExists)
-    throws IOException
+    boolean          labelExists
+    ) throws IOException
   {
     ResponseWriter rw = context.getResponseWriter();
     rw.startElement("td", null);
-    
+
     // render labelStyleClass and defaultStyleClass.
     renderStyleClasses(context, rc, new String[]
       {
-        getLabelStyleClass(bean),
+        getLabelStyleClass(component, bean),
         _getDefaultLabelStyleClass(rc, SkinSelectors.AF_LABEL_TEXT_STYLE_CLASS)
       });
 
-    String labelInlineStyle = getLabelInlineStyleKey(bean);
-   
-    // In the case of narrow-screen PDAs, the Label is rendered above fields. 
-    // So Label should be left aligned to be in align with fields below. 
+    String labelInlineStyle = getLabelInlineStyleKey(component, bean);
+
+    // In the case of narrow-screen PDAs, the Label is rendered above fields.
+    // So Label should be left aligned to be in align with fields below.
     if (supportsNarrowScreen(rc))
     {
       labelInlineStyle = labelInlineStyle + ";text-align: left;";
     }
-    
+
     rw.writeAttribute("style", labelInlineStyle, null);
 
-    String valign = getDefaultLabelValign(bean);
+    String valign = getDefaultLabelValign(component, bean);
 
     rw.writeAttribute("valign", valign, null);
     if (isDesktop(rc))
@@ -446,8 +454,8 @@
     FacesBean        bean,
     boolean          labelExists,
     boolean          needsPanelFormLayout,
-    boolean          isInline)
-    throws IOException
+    boolean          isInline
+    ) throws IOException
   {
     ResponseWriter rw = context.getResponseWriter();
     rw.startElement("td", null);
@@ -499,20 +507,25 @@
     rw.endElement("td");
   }
 
-  static String __getCachedClientId(RenderingContext rc)
+  static String __getCachedClientId(
+    RenderingContext rc)
   {
     String clientId = rc.getCurrentClientId();
     assert(clientId != null);
     return clientId;
   }
 
-  protected String getFieldCellContentsStyleClass(FacesBean bean)
+  protected String getFieldCellContentsStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     // Override if you want a "af_panelLabelAndMessage_content" style class
     return null;
   }
 
-  protected String getFooterContentsStyleClass(FacesBean bean)
+  protected String getFooterContentsStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
     // Override if you want a style class for the footer container
     return null;
@@ -559,7 +572,9 @@
     return true;
   }
 
-  protected String getDefaultLabelValign(FacesBean bean)
+  protected String getDefaultLabelValign(
+    UIComponent component,
+    FacesBean   bean)
   {
     return null;
   }
@@ -568,8 +583,8 @@
     FacesContext     context,
     RenderingContext rc,
     UIComponent      component,
-    FacesBean        bean)
-    throws IOException;
+    FacesBean        bean
+    ) throws IOException;
 
   /**
    * Renders footer contents if isFooterPresent() is true.
@@ -583,8 +598,8 @@
     FacesContext     context,
     RenderingContext rc,
     UIComponent      component,
-    FacesBean        bean)
-    throws IOException
+    FacesBean        bean
+    ) throws IOException
   {
     // render nothing by default
   }
@@ -593,7 +608,9 @@
    * If it's known that the field content is not editable, return false.
    * Otherwise, assume it is editable and return true
    */
-  protected boolean isContentEditable(FacesBean bean)
+  protected boolean isContentEditable(
+    UIComponent component,
+    FacesBean   bean)
   {
     return true;
   }
@@ -608,16 +625,20 @@
    * has its own internal label - and that therefore there
    * shouldn't be an HTML &lt;label> tag, for instance.
    */
-  protected boolean hasOwnLabel(FacesBean bean)
+  protected boolean hasOwnLabel(
+    UIComponent component,
+    FacesBean   bean)
   {
     return false;
   }
 
-  protected boolean showAccessKeyOnLabel(FacesBean bean)
+  protected boolean showAccessKeyOnLabel(
+    UIComponent component,
+    FacesBean   bean)
   {
     // By default, if we have our own label, don't show the
     // access key on the label (but that's not always true)
-    return !hasOwnLabel(bean);
+    return !hasOwnLabel(component, bean);
   }
 
   /**
@@ -630,17 +651,22 @@
     UIComponent      component,
     FacesBean        bean);
 
-  static void __setLabelWidth(RenderingContext rc, Object width)
+  static void __setLabelWidth(
+    RenderingContext rc,
+    Object           width)
   {
     rc.getProperties().put(_LABEL_CELL_WIDTH_KEY, width);
   }
 
-  static void __setFieldWidth(RenderingContext rc, Object width)
+  static void __setFieldWidth(
+    RenderingContext rc,
+    Object           width)
   {
     rc.getProperties().put(_FIELD_CELL_WIDTH_KEY, width);
   }
 
-  static void __clearProperties(RenderingContext rc)
+  static void __clearProperties(
+    RenderingContext rc)
   {
     rc.getProperties().remove(_LABEL_CELL_WIDTH_KEY);
     rc.getProperties().remove(_FIELD_CELL_WIDTH_KEY);
@@ -648,7 +674,9 @@
 
   private class Label extends OutputLabelRenderer
   {
-    public Label(FacesBean.Type type, boolean inTable)
+    public Label(
+      FacesBean.Type type,
+      boolean        inTable)
     {
       super(type);
       _inTable = inTable;
@@ -675,20 +703,22 @@
     protected void renderAllAttributes(
       FacesContext     context,
       RenderingContext rc,
-      FacesBean        bean)
-      throws IOException
+      UIComponent      component,
+      FacesBean        bean
+      ) throws IOException
     {
       // Block everything
     }
 
     @Override
-    protected String getDefaultValign(FacesBean bean)
+    protected String getDefaultValign(
+      UIComponent component,
+      FacesBean   bean)
     {
       // get the defaultLabelValign from the form component.
-      return getDefaultLabelValign(bean);
+      return getDefaultLabelValign(component, bean);
     }
 
-
     @Override
     protected String getConvertedString(
       FacesContext context,
@@ -698,7 +728,7 @@
       if (_inTable)
         return null;
 
-      return LabelAndMessageRenderer.this.getLabel(bean);
+      return LabelAndMessageRenderer.this.getLabel(component, bean);
     }
 
     /**
@@ -706,33 +736,39 @@
      * or showRequired is on.
      */
     @Override
-    protected boolean getShowRequired(FacesBean bean)
+    protected boolean getShowRequired(
+      UIComponent component,
+      FacesBean   bean)
     {
       // Inside the table, never show the required icon.
       if (_inTable)
         return false;
 
-      return (LabelAndMessageRenderer.this.labelShowRequired(bean));
+      return (LabelAndMessageRenderer.this.labelShowRequired(component, bean));
     }
 
     @Override
-    protected char getAccessKey(FacesBean bean)
+    protected char getAccessKey(
+      UIComponent component,
+      FacesBean   bean)
     {
-      if (LabelAndMessageRenderer.this.showAccessKeyOnLabel(bean))
-        return super.getAccessKey(bean);
+      if (LabelAndMessageRenderer.this.showAccessKeyOnLabel(component, bean))
+        return super.getAccessKey(component, bean);
 
       return CHAR_UNDEFINED;
     }
 
     @Override
-    protected String getShortDesc(FacesBean bean)
+    protected String getShortDesc(
+      UIComponent component,
+      FacesBean   bean)
     {
-      String shortDesc = super.getShortDesc(bean);
+      String shortDesc = super.getShortDesc(component, bean);
       // =-=AEW Apparently, we're supposed to do this
       // for screenReader selectOneRadio and selectBooleanRadio!?!
       if ((shortDesc == null) && _inTable)
       {
-        shortDesc = LabelAndMessageRenderer.this.getLabel(bean);
+        shortDesc = LabelAndMessageRenderer.this.getLabel(component, bean);
       }
 
       return shortDesc;
@@ -753,15 +789,16 @@
     @Override
     protected boolean isLabelTagNeeded(
       RenderingContext rc,
+      UIComponent      component,
       FacesBean        bean,
       String           forId,
       int              accessKeyIndex
     )
     {
-      if (LabelAndMessageRenderer.this.hasOwnLabel(bean))
+      if (LabelAndMessageRenderer.this.hasOwnLabel(component, bean))
         return false;
 
-      return super.isLabelTagNeeded(rc, bean, forId, accessKeyIndex);
+      return super.isLabelTagNeeded(rc, component, bean, forId, accessKeyIndex);
     }
 
     private final boolean _inTable;
@@ -769,7 +806,8 @@
 
   private class Message extends MessageRenderer
   {
-    public Message(FacesBean.Type type)
+    public Message(
+      FacesBean.Type type)
     {
       super(type);
     }
@@ -783,13 +821,17 @@
     }
 
     @Override
-    protected String getShortDesc(FacesBean bean)
+    protected String getShortDesc(
+      UIComponent component,
+      FacesBean   bean)
     {
       return null;
     }
 
     @Override
-    protected boolean getIndented(FacesBean bean)
+    protected boolean getIndented(
+      UIComponent component,
+      FacesBean   bean)
     {
       return LabelAndMessageRenderer.this.isIndented();
     }
@@ -798,8 +840,9 @@
     protected void renderAllAttributes(
       FacesContext     context,
       RenderingContext rc,
-      FacesBean        bean)
-      throws IOException
+      UIComponent      component,
+      FacesBean        bean
+      ) throws IOException
     {
     }
 
@@ -816,8 +859,9 @@
     }
   }
 
-
-  protected String getLabelInlineStyleKey(FacesBean bean)
+  protected String getLabelInlineStyleKey(
+    UIComponent component,
+    FacesBean   bean)
   {
     return null; // overridden by PanelLabelAndMessageRenderer
   }
@@ -825,26 +869,30 @@
   /**
    * Hook for resolving whether we should show the "required" icon.
    */
-  protected boolean labelShowRequired(FacesBean bean)
+  protected boolean labelShowRequired(
+    UIComponent component,
+    FacesBean   bean)
   {
     // If we're required (from the input side of things),
     // or showRequired is true, then show the "required" icon.
     // Unless we're read-only, in which case never show it.
-    if (getRequired(bean) || getShowRequired(bean))
+    if (getRequired(component, bean) || getShowRequired(component, bean))
     {
-      return isContentEditable(bean);
+      return isContentEditable(component, bean);
     }
 
     return false;
   }
 
-  protected boolean getShowRequired(FacesBean bean)
+  protected boolean getShowRequired(
+    UIComponent component,
+    FacesBean   bean)
   {
     if(_showRequiredKey == null)
     { // showRequired is not supporte on the element
       return false;
     }
-    
+
     Object o = bean.getProperty(_showRequiredKey);
     if (o == null)
     {
@@ -854,7 +902,9 @@
     return Boolean.TRUE.equals(o);
   }
 
-  protected boolean getRequired(FacesBean bean)
+  protected boolean getRequired(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_requiredKey);
     if (o == null)
@@ -863,8 +913,9 @@
     return Boolean.TRUE.equals(o);
   }
 
-
-  protected String getLabel(FacesBean bean)
+  protected String getLabel(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_labelKey));
   }
@@ -874,28 +925,30 @@
    * @param bean
    * @return
    */
-  protected String getLabelStyleClass(FacesBean bean)  
+  protected String getLabelStyleClass(
+    UIComponent component,
+    FacesBean   bean)
   {
-    String styleClass = getRootStyleClass(bean);
+    String styleClass = getRootStyleClass(component, bean);
     if(styleClass != null)
     {
       styleClass += _LABEL_PSEUDO_ELEMENT;
     }
-    
+
     return styleClass;
-  } 
-  
-  /* This method is responsible for rendering the End facet for narrow-screen 
-   * PDAs. In the case of narrow-screen PDAs, End facet is rendered after the 
+  }
+
+  /* This method is responsible for rendering the End facet for narrow-screen
+   * PDAs. In the case of narrow-screen PDAs, End facet is rendered after the
    * Help facet as shown below
    * +------+
-   * |Label | 
+   * |Label |
    * +------+
    * |Field |
    * +----------+
-   * |Help facet| 
+   * |Help facet|
    * +----------+
-   * |End facet | 
+   * |End facet |
    * ------------
    * @param context a <code>FacesContext</code>
    * @param arc a <code>RenderingContext</code>
@@ -904,7 +957,7 @@
    *        Facet to be rendered is in inside a table data(<TD>)
    * @throws IOException if there are problems in rendering contents
    */
-  
+
   protected void renderEndFacetForNarrowPDA(
     FacesContext     context,
     RenderingContext rc,
@@ -912,22 +965,22 @@
     boolean          insideTableData)
     throws IOException
   {
-    // Nothing by default. Applicable only for the 
+    // Nothing by default. Applicable only for the
     // components that support End facet.
   }
 
-  // If we have mapped this style (like in panelForm), 
+  // If we have mapped this style (like in panelForm),
   // then return the style, otherwise return null
   private String _getDefaultLabelStyleClass(
     RenderingContext rc,
-    String           styleClass)  
+    String           styleClass)
   {
     Map<String, String> keyMap = rc.getSkinResourceKeyMap();
     return (keyMap != null) ?
             keyMap.get(styleClass) :
             null;
   }
-  
+
   private boolean _isFormRendererType(String rendererType)
   {
     return "org.apache.myfaces.trinidad.Form".equals(rendererType) ||
@@ -936,12 +989,12 @@
         "org.apache.myfaces.trinidad.TableLayout".equals(rendererType);
   }
 
-  
+
   // THESE VALUES MUST MATCH THOSE IN INLINEMESSAGERENDERER
   // (at least for as long as both classes exist)
   static private final Object _LABEL_CELL_WIDTH_KEY = "_imLCWidth";
   static private final Object _FIELD_CELL_WIDTH_KEY = "_imFCWidth";
-  
+
   private static final String _LABEL_PSEUDO_ELEMENT = "::label";
 
   private PropertyKey   _labelKey;

Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java?rev=891522&r1=891521&r2=891522&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/MediaRenderer.java Thu Dec 17 02:33:05 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,6 +19,7 @@
 package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
 
 import java.io.IOException;
+
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Locale;
@@ -42,14 +43,14 @@
  */
 public class MediaRenderer extends XhtmlRenderer
 {
-
   public MediaRenderer()
   {
     super(CoreMedia.TYPE);
   }
-  
+
   @Override
-  protected void findTypeConstants(FacesBean.Type type)
+  protected void findTypeConstants(
+    FacesBean.Type type)
   {
     super.findTypeConstants(type);
     _sourceKey = type.findKey("source");
@@ -66,32 +67,44 @@
     _innerHeightKey = type.findKey("innerHeight");
   }
 
-  protected String getSource(FacesBean bean)
+  protected String getSource(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toResourceUri(FacesContext.getCurrentInstance(), bean.getProperty(_sourceKey));
   }
 
-  protected String getPlayer(FacesBean bean)
+  protected String getPlayer(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_playerKey));
   }
 
-  protected String getContentType(FacesBean bean)
+  protected String getContentType(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_contentTypeKey));
   }
 
-  protected String getControls(FacesBean bean)
+  protected String getControls(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_controlsKey));
   }
 
-  protected String getStandbyText(FacesBean bean)
+  protected String getStandbyText(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_standbyTextKey));
   }
 
-  protected boolean getAutostart(FacesBean bean)
+  protected boolean getAutostart(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_autostartKey);
     if (o == null)
@@ -100,8 +113,9 @@
     return Boolean.TRUE.equals(o);
   }
 
-
-  protected Number getPlayCount(FacesBean bean)
+  protected Number getPlayCount(
+    UIComponent component,
+    FacesBean   bean)
   {
     Object o = bean.getProperty(_playCountKey);
     if (o == null)
@@ -113,28 +127,34 @@
     return null;
   }
 
-  protected String getWidth(FacesBean bean)
+  protected String getWidth(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_widthKey));
   }
 
-  protected String getHeight(FacesBean bean)
+  protected String getHeight(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_heightKey));
   }
 
-
-  protected String getInnerWidth(FacesBean bean)
+  protected String getInnerWidth(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_innerWidthKey));
   }
 
-  protected String getInnerHeight(FacesBean bean)
+  protected String getInnerHeight(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(bean.getProperty(_innerHeightKey));
   }
 
-
   @Override
   public boolean getRendersChildren()
   {
@@ -143,35 +163,34 @@
 
   @Override
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext    arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
-    if (canSkipRendering(context, arc, component))
+    if (canSkipRendering(context, rc, component))
       return;
 
     // get the mime type
-    String mimeType = _getMimeType(bean);
+    String mimeType = _getMimeType(component, bean);
 
     // extract the primary cotnent type from the content mime type
     String primaryContentType = _getPrimaryContentType(mimeType);
 
-    MediaRenderer.PlayerData playerData = _getPlayerData(arc,
-                                                         bean,
-                                                         mimeType,
-                                                         primaryContentType);
+    MediaRenderer.PlayerData playerData = _getPlayerData(rc, component, bean, mimeType,
+      primaryContentType);
 
     ResponseWriter writer = context.getResponseWriter();
 
-    String  source         = getSource(bean);
-    String  contentType    = getContentType(bean);
+    String  source         = getSource(component, bean);
+    String  contentType    = getContentType(component, bean);
     String  id             = getClientId(context, component);
 
     if (_LINK_PLAYER_DATA == playerData)
     {
       _renderLink(context,
-                  arc,
+                  rc,
                   component,
                   bean,
                   id,
@@ -192,7 +211,7 @@
 
       MediaRenderer.ControlData controlData = (controlSet != null)
                                   ? controlSet.getControlData(
-                                                 getControls(bean))
+                                                 getControls(component, bean))
                                   : null;
 
       //
@@ -210,16 +229,16 @@
       }
       else
       {
-        useEmbedTag  = useEmbed(arc);
+        useEmbedTag  = useEmbed(rc);
         useObjectTag = !useEmbedTag;
       }
 
-      String width = getWidth(bean);
+      String width = getWidth(component, bean);
 
       // since current players don't add to width, treat innerWidth
       // identically to width for now
       if (width == null)
-        width = getInnerWidth(bean);
+        width = getInnerWidth(component, bean);
 
       // get whether this set of controls can be autosized.
       // embed elements can not be autosized.
@@ -253,7 +272,7 @@
         //
         // Handle looping attributes
         //
-        Number playCountValue = getPlayCount(bean);
+        Number playCountValue = getPlayCount(component, bean);
 
         if (playCountValue != null)
         {
@@ -278,7 +297,7 @@
         //
         // determine whether we should autostart
         //
-        boolean autostarts = getAutostart(bean);
+        boolean autostarts = getAutostart(component, bean);
         if (autostarts != playerData.autostartByDefault)
         {
           // only write out an autostart value, if its different than
@@ -289,19 +308,14 @@
         }
       }
 
-
-      String standbyText = getStandbyText(bean);
+      String standbyText = getStandbyText(component, bean);
 
       String height = null;
       // if image window and controls rendered separately
       if ( imageWindowControlData != null )
       {
-
-        height = _getInnerHeight( bean,
-                                  canAutosize,
-                                  primaryContentType,
-                                  controlData,
-                                  playerData );
+        height = _getInnerHeight(component, bean, canAutosize, primaryContentType, controlData,
+          playerData);
 
         // since image and controls are rendered separately, a value
         // is needed to associate them. The id will be used if it is not null,
@@ -309,7 +323,7 @@
         String wireImageToControlsParamValue = id;
 
         _render( context,
-                 arc,
+                 rc,
                  component,
                  bean,
                  contentType,
@@ -338,7 +352,7 @@
 
           height = IntegerUtils.getString(controlData.height);
           _render( context,
-                   arc,
+                   rc,
                    component,
                    bean,
                    contentType,
@@ -362,14 +376,11 @@
       // if image window and controls rendered together
       else
       {
-        height = _getHeight( bean,
-                             canAutosize,
-                             primaryContentType,
-                             controlData,
-                             playerData );
+        height = _getHeight(component, bean, canAutosize, primaryContentType, controlData,
+          playerData);
 
         _render( context,
-                 arc,
+                 rc,
                  component,
                  bean,
                  contentType,
@@ -400,7 +411,7 @@
         //        we retrieve using a pretected method
         //
         writer.startElement("noembed", component);
-        _renderLink(context, arc, component, bean, null, source, null, contentType);
+        _renderLink(context, rc, component, bean, null, source, null, contentType);
         writer.endElement("noembed");
       }
     }
@@ -411,7 +422,7 @@
    * specified.
    */
   protected Number getDefaultInnerWidth(
-    String           primaryContentType
+    String primaryContentType
     )
   {
     return _getDefaultSizeArray(primaryContentType)[_DEFAULT_INNER_WIDTH_INDEX];
@@ -423,7 +434,7 @@
    * specified.
    */
   protected Number getDefaultInnerHeight(
-    String           primaryContentType
+    String primaryContentType
     )
   {
     return _getDefaultSizeArray(primaryContentType)[_DEFAULT_INNER_HEIGHT_INDEX];
@@ -435,10 +446,10 @@
    * <object> tag to embed the viewer
    */
   protected boolean useEmbed(
-    RenderingContext arc
+    RenderingContext rc
     )
   {
-    TrinidadAgent agent = (TrinidadAgent) arc.getAgent();
+    TrinidadAgent agent = (TrinidadAgent) rc.getAgent();
 
     // =-= bts only desktop IE seems to support this
     //         Move this to capability
@@ -462,19 +473,18 @@
     return (Number[])sizeArray;
   }
 
-
   /**
    * Renders a link
    */
   private void _renderLink(
-    FacesContext context,
-    RenderingContext arc,
-    UIComponent  component,
-    FacesBean    bean,
-    String       id,
-    String       source,
-    String       iconUrl,
-    String       contentType
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean,
+    String           id,
+    String           source,
+    String           iconUrl,
+    String           contentType
     ) throws IOException
   {
     ResponseWriter writer = context.getResponseWriter();
@@ -487,7 +497,7 @@
       {
         writer.startElement("span", component);
         writer.writeAttribute("id", id, null);
-        renderAllAttributes(context, arc, bean);
+        renderAllAttributes(context, rc, component, bean);
         writer.endElement("span");
       }
     }
@@ -502,7 +512,7 @@
         // And render all the attributes here if we have
         // that ID, because that means this is the main
         // content
-        renderAllAttributes(context, arc, bean);
+        renderAllAttributes(context, rc, component, bean);
       }
 
       // link to the content
@@ -520,7 +530,7 @@
         writer.endElement("img");
       }
 
-      String shortDesc = getShortDesc(bean);
+      String shortDesc = getShortDesc(component, bean);
       if (shortDesc != null)
         writer.writeText(shortDesc, "shortDesc");
 
@@ -528,15 +538,14 @@
     }
   }
 
-
   /**
    * Renders a name value pair as a <param> element
    */
   private void _renderParamAttribute(
-    FacesContext     context,
-    String           paramName,
-    Object           paramValue,
-    boolean          isURL
+    FacesContext context,
+    String       paramName,
+    Object       paramValue,
+    boolean      isURL
     ) throws IOException
   {
     if ( paramValue != null )
@@ -559,14 +568,14 @@
     }
   }
 
-
   /**
    * Returns the constant identifying the player to use
    *
    * =-= bts Do we care about AccessibilityMode?
    */
   private MediaRenderer.PlayerData _getPlayerData(
-    RenderingContext arc,
+    RenderingContext rc,
+    UIComponent      component,
     FacesBean        bean,
     String           mimeType,
     String           primaryMimeType
@@ -574,20 +583,20 @@
   {
     PlayerData playerData = null;
     // the default player is the link player
-    TrinidadAgent agent = (TrinidadAgent) arc.getAgent();
+    TrinidadAgent agent = (TrinidadAgent) rc.getAgent();
     int agentOSInt = agent.getAgentOS();
-    
+
     // get the set of supported players for this OS
     HashSet<Object> supportedPlayers = _sSupportedOSPlayers.get(agentOSInt);
-    
+
     // are we trying to display an image?
     boolean isImage = "image".equals(primaryMimeType);
-    
+
     // check if this OS supports any non-link style players
     if (supportedPlayers != null)
     {
       // get the desired player, if any
-      String playerString = getPlayer(bean);
+      String playerString = getPlayer(component, bean);
       if (playerString != null)
       {
         if (CoreMedia.PLAYER_LINK.equals(playerString))
@@ -600,7 +609,7 @@
           if (!isImage && supportedPlayers.contains(playerString))
           {
             playerData = (PlayerData) _sPlayerData.get(playerString);
-            
+
             if (playerData != null)
             {
               if (mimeType != null)
@@ -615,7 +624,7 @@
           }
         }
       }
-      
+
       // assume that all images can be played by the browser's built-in
       // image player
       if (isImage)
@@ -628,32 +637,32 @@
             !"audio".equals(primaryMimeType))
           playerData = _LINK_PLAYER_DATA;
       }
-      
+
       //
       // guess the player based on the mime type
       //
       if (playerData == null)
       {
         Object preferredPlayer = _sPreferredMimePlayers.get(mimeType);
-        
+
         if ((preferredPlayer != null) &&
             supportedPlayers.contains(preferredPlayer))
         {
           playerData = (PlayerData) _sPlayerData.get(preferredPlayer);
         }
       }
-      
+
       //
       // guess the player based on the operating system
       //
       if (playerData == null)
       {
         Object preferredPlayer = _sPreferredOSPlayers.get(agentOSInt);
-        
+
         if (preferredPlayer != null)
         {
           playerData = (PlayerData) _sPlayerData.get(preferredPlayer);
-          
+
           // check that the format is supported by this player
           if (!playerData.isSupportedMimeType(mimeType))
           {
@@ -662,15 +671,14 @@
         }
       }
     }
-    
+
     // if all else fails, use the link player
     if (playerData == null)
       playerData = _LINK_PLAYER_DATA;
-    
+
     return playerData;
   }
 
-
   /**
    * Returns the primary content type of the result:
    * i.e. "audio", "video"
@@ -692,7 +700,6 @@
     return null;
   }
 
-
   /**
    * Returns the secondary content type of the result:
    * i.e. "quicktime", "au"
@@ -714,14 +721,15 @@
     return null;
   }
 
-
   /**
    * Returns the most likely MIME type for the content
    */
-  private String _getMimeType(FacesBean bean)
+  private String _getMimeType(
+    UIComponent component,
+    FacesBean   bean)
   {
     // try any provided content mime type first
-    String mimeType = getContentType(bean);
+    String mimeType = getContentType(component, bean);
 
     // primary mime type to force mime type to
     String primaryForced = null;
@@ -758,7 +766,7 @@
     }
 
     // try to determine the mime-type off of the source extension
-    String extension = _getSourceExtension(bean);
+    String extension = _getSourceExtension(component, bean);
 
     if (extension != null)
     {
@@ -781,13 +789,14 @@
     return mimeType;
   }
 
-
   /**
    * Returns the lowercase extension of any source URL
    */
-  private String _getSourceExtension(FacesBean bean)
+  private String _getSourceExtension(
+    UIComponent component,
+    FacesBean   bean)
   {
-    String sourceURLString = getSource(bean);
+    String sourceURLString = getSource(component, bean);
 
     if (sourceURLString != null)
     {
@@ -816,7 +825,7 @@
     {
       int contentLength = contents.length;
 
-      HashSet<Object> set = 
+      HashSet<Object> set =
         new HashSet<Object>((int)(contentLength * 1.5));
 
       for (int i = 0; i < contentLength; i++)
@@ -843,7 +852,7 @@
     {
       int contentLength = contents.length;
 
-      HashMap<Object, Object> map = 
+      HashMap<Object, Object> map =
         new HashMap<Object, Object>((int)(contentLength * 0.75));
 
       for (int i = 0; i < contentLength; i += 2)
@@ -859,23 +868,18 @@
     }
   }
 
-
   // get the height of the image window
   private String _getInnerHeight(
-    FacesBean        bean,
-    boolean          canAutosize,
-    String           primaryContentType,
-    ControlData      controlData,
-    PlayerData       playerData
+    UIComponent component,
+    FacesBean   bean,
+    boolean     canAutosize,
+    String      primaryContentType,
+    ControlData controlData,
+    PlayerData  playerData
     )
   {
     // get the height without checking min
-    String height = _getHeightNoMin(bean,
-                                    canAutosize,
-                                    primaryContentType,
-                                    controlData);
-
-
+    String height = _getHeightNoMin(component, bean, canAutosize, primaryContentType, controlData);
 
     boolean useMinHeight = (height == null);
 
@@ -914,18 +918,19 @@
   // determine the height without checking the min height
   //
   private String _getHeightNoMin(
-    FacesBean        bean,
-    boolean          canAutosize,
-    String           primaryContentType,
-    ControlData      controlData
+    UIComponent component,
+    FacesBean   bean,
+    boolean     canAutosize,
+    String      primaryContentType,
+    ControlData controlData
     )
   {
-    String height = getHeight(bean);
+    String height = getHeight(component, bean);
     // compute default height for players that don't autosize
     if (height == null)
     {
       // get the inner height from the attribute
-      String innerHeight = getInnerHeight(bean);
+      String innerHeight = getInnerHeight(component, bean);
       if (!canAutosize && (innerHeight == null))
       {
         // get the default inner height
@@ -965,19 +970,16 @@
   // determine the height including the controls
   //
   private String _getHeight(
-    FacesBean        bean,
-    boolean          canAutosize,
-    String           primaryContentType,
-    ControlData      controlData,
-    PlayerData       playerData
+    UIComponent component,
+    FacesBean   bean,
+    boolean     canAutosize,
+    String      primaryContentType,
+    ControlData controlData,
+    PlayerData  playerData
     )
   {
-
     // get the height
-    String height = _getHeightNoMin(bean,
-                                    canAutosize,
-                                    primaryContentType,
-                                    controlData);
+    String height = _getHeightNoMin(component, bean, canAutosize, primaryContentType, controlData);
 
     //
     // apply minimum player size to height
@@ -1042,7 +1044,7 @@
 
   private void _render(
     FacesContext     context,
-    RenderingContext  arc,
+    RenderingContext rc,
     UIComponent      component,
     FacesBean        bean,
     String           contentType,
@@ -1061,7 +1063,7 @@
     boolean          useObjectTag,
     boolean          isImage,
     boolean          isNotMainID
-    )throws IOException
+    ) throws IOException
   {
     String elementName = (isImage)
                              ? "img"
@@ -1076,7 +1078,7 @@
 
     // start the element
     writer.startElement(elementName, component);
-    renderAllAttributes(context, arc, bean);
+    renderAllAttributes(context, rc, component, bean);
 
     writer.writeAttribute("width", width, null);
     writer.writeAttribute("height", height, null);
@@ -1219,15 +1221,13 @@
       // =-=bts I feel that our backup rendering should be an icon that
       //        we retrieve using a pretected method
       //
-      _renderLink(context, arc, component, bean, null, source, null, contentType);
+      _renderLink(context, rc, component, bean, null, source, null, contentType);
     }
 
     // close the element
     writer.endElement(elementName);
   }
 
-
-
   //
   // known mime types
   //
@@ -1284,7 +1284,6 @@
     "video/x-msvideo",        _AVI_MIME_TYPE,
   };
 
-
   /**
    * Maintains attribute and size information for a particular control
    * configuration.
@@ -1491,7 +1490,6 @@
     private final HashSet<Object> _unsupportedMimeTypes;
   }
 
-
   // Real Player Class ID
   private static final String _RP_CLASS_ID =
                                   "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA";
@@ -1761,7 +1759,6 @@
   private static final Number _REAL_ALL_WIDTH  = Integer.valueOf(375);
   private static final int    _REAL_ALL_HEIGHT = 100;
 
-
  // null control data
   private static final MediaRenderer.ControlData _NULL_CONTROL_DATA =
      new MediaRenderer.ControlData(null,
@@ -1769,8 +1766,6 @@
                      0,
                      0);
 
-
-
   // control data for showing image window on Real Player
   private static final MediaRenderer.ControlData _REAL_VIDEO_IMAGE_WINDOW_CONTROL_DATA =
      new MediaRenderer.ControlData(new String[]
@@ -1782,8 +1777,6 @@
                      0,
                      0);
 
-
-
   private static final MediaRenderer.ControlData _REAL_MINIMAL_CONTROL_DATA =
   new MediaRenderer.ControlData(new String[]
                                {
@@ -1793,7 +1786,6 @@
                                _REAL_MINIMAL_HEIGHT,
                                _REAL_MINIMAL_WIDTH);
 
-
   // control data for showing typical controls on Real Player
   private static final MediaRenderer.ControlData _REAL_TYPICAL_CONTROL_DATA =
      new MediaRenderer.ControlData(new String[]{"controls", "ControlPanel"},
@@ -1801,8 +1793,6 @@
                      _REAL_TYPICAL_HEIGHT,
                      _REAL_TYPICAL_WIDTH);
 
-
-
   // control data for showing all controls on Real Player
   private static final MediaRenderer.ControlData _REAL_ALL_CONTROL_DATA =
      new MediaRenderer.ControlData(new String[]{"controls", "All"},
@@ -1816,7 +1806,6 @@
                      0,
                      0);
 
-
   private static final MediaRenderer.PlayerData _REAL_PLAYER_DATA =
     new MediaRenderer.PlayerData(
     CoreMedia.PLAYER_REAL,                      // player type
@@ -1938,8 +1927,6 @@
     "xwd",  _X_WINDOW_DUMP_MIME_TYPE,
   };
 
-
-
   // Preferred Players for MimeTypes
   private static final Object[] _PREFERRED_MIME_PLAYERS = new Object[]
   {
@@ -1983,7 +1970,7 @@
   // Supported players on each OS, in prference order
   private static final Object[] _SUPPORTED_OS_PLAYERS = new Object[]
   {
-    _WINDOWS_OS, new Object[]{CoreMedia.PLAYER_WINDOWS,  
+    _WINDOWS_OS, new Object[]{CoreMedia.PLAYER_WINDOWS,
                               CoreMedia.PLAYER_QUICKTIME,
                               CoreMedia.PLAYER_REAL},
     _MAC_OS,     new Object[]{CoreMedia.PLAYER_QUICKTIME,



Mime
View raw message