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

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

public class AddRemoveRenderer
extends ListRendererBase

Renderer for a AddRemove component.


Field Summary
 
Fields inherited from class com.sun.rave.web.ui.renderer.ListRendererBase
SEPARATOR, STRING_ATTRIBUTES
 
Constructor Summary
AddRemoveRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Decodes the value of the component
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Overrides encodeChildren of Renderer to do nothing.
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Render the list.
protected  void renderAvailableList(AddRemove component, javax.faces.context.FacesContext context, java.lang.String[] styles)
          This is the base method for rendering a HTML select element.
protected  void renderSelectedList(AddRemove component, javax.faces.context.FacesContext context, java.lang.String[] styles)
          This is the base method for rendering a HTML select element.
 
Methods inherited from class com.sun.rave.web.ui.renderer.ListRendererBase
decode, getOnChangeJavaScript, getRendersChildren, renderHiddenValue, renderList, renderOpenEncloser
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeBegin, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddRemoveRenderer

public AddRemoveRenderer()
Method Detail

encodeEnd

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

Render the list.

Overrides:
encodeEnd in class javax.faces.render.Renderer
Parameters:
context - FacesContext for the current request
component - UIComponent to be rendered end should be rendered
Throws:
java.io.IOException - if an input/output error occurs

renderAvailableList

protected void renderAvailableList(AddRemove component,
                                   javax.faces.context.FacesContext context,
                                   java.lang.String[] styles)
                            throws java.io.IOException
This is the base method for rendering a HTML select element. This method is based on the functionality of the RI version, so it invokes a method renderSelectItems which in term invokes renderSelectItem. Currently, this renderer requires for the options to be specified using the JSF SelectItem construct, but this should be replaced with a Lockhart version, because the JSF version lacks the ability to associate an id with the list item. I'm not sure whether it should be possible to use SelectItem as well yet.

Parameters:
component - The UI Component associated with the renderer.
context - The FacesContext of the request
styles - A String array of styles used to render the component. The first item of the array is the name of the JavaScript method that handles change event. The second item is the style used when the list is enabled. The third style is the one to use when the list is disabled. The fourth item is the style to use for an item that is enabled, the fifth to use for an item that is disabled, and the sixth to use when the item is selected.
Throws:
java.io.IOException - if the renderer fails to write to the response

renderSelectedList

protected void renderSelectedList(AddRemove component,
                                  javax.faces.context.FacesContext context,
                                  java.lang.String[] styles)
                           throws java.io.IOException
This is the base method for rendering a HTML select element. This method is based on the functionality of the RI version, so it invokes a method renderSelectItems which in term invokes renderSelectItem. Currently, this renderer requires for the options to be specified using the JSF SelectItem construct, but this should be replaced with a Lockhart version, because the JSF version lacks the ability to associate an id with the list item. I'm not sure whether it should be possible to use SelectItem as well yet.

Parameters:
component - The UI Component associated with the renderer.
context - The FacesContext of the request
styles - A String array of styles used to render the component. The first item of the array is the name of the JavaScript method that handles change event. The second item is the style used when the list is enabled. The third style is the one to use when the list is disabled. The fourth item is the style to use for an item that is enabled, the fifth to use for an item that is disabled, and the sixth to use when the item is selected.
Throws:
java.io.IOException - if the renderer fails to write to the response

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Overrides encodeChildren of Renderer to do nothing. This renderer renders its own children, but not through this method.

Overrides:
encodeChildren in class ListRendererBase
Parameters:
context - The FacesContext of the request
component - The component associated with the renderer. Must be a subclass of ListSelector.
Throws:
java.io.IOException - if something goes wrong while writing the children

decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
Decodes the value of the component

Overrides:
decode in class ListRendererBase
Parameters:
context - The FacesContext of the request
component - The component instance to be decoded