com.sun.rave.web.ui.renderer
Class TabSetRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by com.sun.rave.web.ui.renderer.AbstractRenderer
          extended by com.sun.rave.web.ui.renderer.TabSetRenderer

public class TabSetRenderer
extends AbstractRenderer

Renders a TabSet component.


Field Summary
 
Fields inherited from class com.sun.rave.web.ui.renderer.AbstractRenderer
BUNDLE, EVENTS_ATTRIBUTES, I18N_ATTRIBUTES
 
Constructor Summary
TabSetRenderer()
          Default constructor
 
Method Summary
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Encode the Tab children of this TabSet component.
 boolean getRendersChildren()
          Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render.
protected  boolean isSelected(Tab tab, java.lang.String selectedTabId)
          Recursive function that determines if the given Tab component or any one of its descendants is the selected tab.
 void renderEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter writer)
          Render the element end for the generated markup related to this component.
protected  java.util.List renderLevel(javax.faces.context.FacesContext context, TabSet tabSet, javax.faces.context.ResponseWriter writer, int level, java.util.List currentLevelTabs)
          This method renders each of the Tab components in the given level.
protected  void writeDivider(TabSet tabSet, javax.faces.context.ResponseWriter writer, java.lang.String src)
          Helper function to write a tab dividier in a table cell
 
Methods inherited from class com.sun.rave.web.ui.renderer.AbstractRenderer
addBooleanAttributes, addCoreAttributes, addIntegerAttributes, addStringAttributes, decode, encodeBegin, encodeEnd, getApplication, getAsObject, getAsString, getExternalContext, getFacesContext, getSubmittedValue, isDisabled, isPortlet, isReadOnly, renderAttributes, renderMarkup, renderStart, setSubmittedValue
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabSetRenderer

public TabSetRenderer()
Default constructor

Method Detail

getRendersChildren

public boolean getRendersChildren()

Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render. The default implementation returns false.

Overrides:
getRendersChildren in class javax.faces.render.Renderer

renderEnd

public void renderEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component,
                      javax.faces.context.ResponseWriter writer)
               throws java.io.IOException
Description copied from class: AbstractRenderer

Render the element end for the generated markup related to this component. Simple renderers that create a single markup element for this component should override this method and include a call to endElement() on the specified ResponseWriter.

The default implementation does nothing.

Overrides:
renderEnd in class AbstractRenderer
Parameters:
context - FacesContext for the current request
component - EditableValueHolder component whose submitted value is to be stored
writer - ResponseWriter to which the element start should be rendered
Throws:
java.io.IOException - if an input/output error occurs

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException

Encode the Tab children of this TabSet component.

Overrides:
encodeChildren in class AbstractRenderer
Parameters:
context - The current FacesContext
component - The current TabSet component
Throws:
java.io.IOException - if an input/output error occurs

renderLevel

protected java.util.List renderLevel(javax.faces.context.FacesContext context,
                                     TabSet tabSet,
                                     javax.faces.context.ResponseWriter writer,
                                     int level,
                                     java.util.List currentLevelTabs)
                              throws java.io.IOException
This method renders each of the Tab components in the given level.

Parameters:
context - The current FacesContext
tabSet - The current TabSet component
writer - The current ResponseWriter
level - The level (1, 2 or 3) of the Tab set to be rendered
currentLevelTabs - A List containing the Tab objects for the current level
Throws:
java.io.IOException

writeDivider

protected void writeDivider(TabSet tabSet,
                            javax.faces.context.ResponseWriter writer,
                            java.lang.String src)
                     throws java.io.IOException
Helper function to write a tab dividier in a table cell

Parameters:
tabSet - The current TabSet component
writer - The current ResponseWriter
src - The image src to use for the tab divider
Throws:
java.io.IOException

isSelected

protected boolean isSelected(Tab tab,
                             java.lang.String selectedTabId)
Recursive function that determines if the given Tab component or any one of its descendants is the selected tab.

Parameters:
tab - The Tab component to check for selection
selectedTabId - The id of the currently selected Tab