com.mycompany.jsf.renderer
Class TabbedRenderer

java.lang.Object
  extended byjavax.faces.render.Renderer
      extended bycom.mycompany.jsf.renderer.TabbedRenderer

public class TabbedRenderer
extends javax.faces.render.Renderer

This class is a JSF Renderer for the "javax.faces.Panel" component type. It renders a table with one row of cells made up from the "label" facets on its children, assumed to be "com.mycompany.TabLabel" components.

Version:
1.0
Author:
Hans Bergsten, Gefion Software

Constructor Summary
TabbedRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Loops over all children and calls processDecodes() on the child's "label" facet for all children with the "rendered" property set to "false" (the one with "rendered" set to "true" is decoded by the default processing).
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Ensures that only one child has "rendered" set to "true", renders an HTML table with one row and one cell per child "label" facet, with a "class" attribute for the "table" element set to the "labelAreaClass" component attribute value, and one of "selectedLabelClass" or "unselectedLabelClass" as the "class" attribute value for the "td" elements.
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Calls the appropriate encode methods for the child with the "rendered" property set to "true".
private  void encodeRecursive(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Calls the appropriate encoding methods on the component and calls itself recursively for all component children.
 boolean getRendersChildren()
          Returns "true".
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeEnd, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabbedRenderer

public TabbedRenderer()
Method Detail

getRendersChildren

public boolean getRendersChildren()
Returns "true".


decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
Loops over all children and calls processDecodes() on the child's "label" facet for all children with the "rendered" property set to "false" (the one with "rendered" set to "true" is decoded by the default processing).


encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws java.io.IOException
Ensures that only one child has "rendered" set to "true", renders an HTML table with one row and one cell per child "label" facet, with a "class" attribute for the "table" element set to the "labelAreaClass" component attribute value, and one of "selectedLabelClass" or "unselectedLabelClass" as the "class" attribute value for the "td" elements.

Throws:
java.io.IOException

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Calls the appropriate encode methods for the child with the "rendered" property set to "true".

Throws:
java.io.IOException

encodeRecursive

private void encodeRecursive(javax.faces.context.FacesContext context,
                             javax.faces.component.UIComponent component)
                      throws java.io.IOException
Calls the appropriate encoding methods on the component and calls itself recursively for all component children.

Throws:
java.io.IOException