com.icesoft.faces.renderkit.dom_html_basic
Class DomBasicRenderer

java.lang.Object
  extended byjavax.faces.render.Renderer
      extended bycom.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer
Direct Known Subclasses:
DomBasicInputRenderer

public abstract class DomBasicRenderer
extends javax.faces.render.Renderer


Field Summary
 java.lang.String ICESUBMIT
           
 java.lang.String ICESUBMITPARTIAL
           
 
Constructor Summary
DomBasicRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
 void encodeEnd(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
          Delegate rendering to the renderEnd(..) method after validating parameters and before maintaining the cursor position.
static void encodeParentAndChildren(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent parent)
          Recursively render the parent UIComponent instance and its children.
static javax.faces.component.UIComponent findForComponent(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
          Find the UIComponent whose id is given by the for attribute of the UIComponent parameter.
static javax.faces.component.UIForm findForm(javax.faces.component.UIComponent uiComponent)
           Given a UIComponent instance, recursively examine the heirarchy of parent NamingContainers until the UIForm is found.
static javax.faces.component.UIComponent findNamingContainer(javax.faces.component.UIComponent uiComponent)
           Given a UIComponent instance, recursively examine the heirarchy of parent UIComponents until the first NamingContainer is found.
static java.lang.String[] getExcludesArray(java.util.Set excludes)
          Retrieve the array of excluded attributes.
 java.lang.String[] getRowStyleClasses(javax.faces.component.UIComponent uiComponent)
          This method, given a component, will return an array of the component's row classes.
static boolean isStatic(javax.faces.component.UIComponent uiComponent)
          A component is static if it is disabled or readonly.
static void renderAttribute(javax.faces.component.UIComponent uiComponent, org.w3c.dom.Element targetElement, java.lang.String attrNameInComponent, java.lang.String attrNameInDom)
           Sets a non-null, non-empty-string, UIComponent property to the corresponding DOM Element
protected  void renderEnd(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.String currentValue)
          The common infrastructure of parameter validation and cursor management will be provided by the encodeEnd method and rendering is delegated to this method.
static void setPartialSubmit(javax.faces.component.UIComponent component)
           
static void setRootElementId(javax.faces.context.FacesContext facesContext, org.w3c.dom.Element rootElement, javax.faces.component.UIComponent uiComponent)
          Set the id of the root element of the DOMContext associated with the UIComponent parameter.
 void setSubmittedValue(javax.faces.component.UIComponent uiComponent, java.lang.Object value)
          This method should be overridden by renderers for components who subclass UIInput
 void validateParameters(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.Class validComponentType)
          Validates that the facesContext is not null, the uiComponent is not null, and that uiComponent is assignment-compatible with the validComponentType.
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeBegin, encodeChildren, getConvertedValue, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICESUBMITPARTIAL

public final java.lang.String ICESUBMITPARTIAL
See Also:
Constant Field Values

ICESUBMIT

public final java.lang.String ICESUBMIT
See Also:
Constant Field Values
Constructor Detail

DomBasicRenderer

public DomBasicRenderer()
Method Detail

decode

public void decode(javax.faces.context.FacesContext facesContext,
                   javax.faces.component.UIComponent uiComponent)

setSubmittedValue

public void setSubmittedValue(javax.faces.component.UIComponent uiComponent,
                              java.lang.Object value)
This method should be overridden by renderers for components who subclass UIInput

Parameters:
uiComponent -
value -

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext facesContext,
                      javax.faces.component.UIComponent uiComponent)
               throws java.io.IOException
Delegate rendering to the renderEnd(..) method after validating parameters and before maintaining the cursor position. The renderEnd method should be overridden by subclasses of this class so that the common infrastructure of parameter validation and cursor maintenance are provided here.

Throws:
java.io.IOException

renderEnd

protected void renderEnd(javax.faces.context.FacesContext facesContext,
                         javax.faces.component.UIComponent uiComponent,
                         java.lang.String currentValue)
                  throws java.io.IOException
The common infrastructure of parameter validation and cursor management will be provided by the encodeEnd method and rendering is delegated to this method. Renderers should override this method instead of encodeEnd to provide rendering at the time of execution of the encodeEnd method.

Parameters:
facesContext -
uiComponent -
currentValue -
Throws:
java.io.IOException

findForComponent

public static javax.faces.component.UIComponent findForComponent(javax.faces.context.FacesContext facesContext,
                                                                 javax.faces.component.UIComponent uiComponent)
Find the UIComponent whose id is given by the for attribute of the UIComponent parameter.

Parameters:
facesContext -
uiComponent -
Returns:
the UIComponent associated with the component id indicated by the value of the for attribute of the UIComponent parameter.

getExcludesArray

public static java.lang.String[] getExcludesArray(java.util.Set excludes)
Retrieve the array of excluded attributes. This array should be constructed in the renderer class and then passed in to the PassThruAttributeRenderer.

Returns:
a String array of excluded attributes.

encodeParentAndChildren

public static void encodeParentAndChildren(javax.faces.context.FacesContext facesContext,
                                           javax.faces.component.UIComponent parent)
                                    throws java.io.IOException
Recursively render the parent UIComponent instance and its children.

Parameters:
facesContext -
parent -
Throws:
java.io.IOException

setRootElementId

public static void setRootElementId(javax.faces.context.FacesContext facesContext,
                                    org.w3c.dom.Element rootElement,
                                    javax.faces.component.UIComponent uiComponent)
Set the id of the root element of the DOMContext associated with the UIComponent parameter.

Parameters:
facesContext -
rootElement -
uiComponent -

renderAttribute

public static void renderAttribute(javax.faces.component.UIComponent uiComponent,
                                   org.w3c.dom.Element targetElement,
                                   java.lang.String attrNameInComponent,
                                   java.lang.String attrNameInDom)

Sets a non-null, non-empty-string, UIComponent property to the corresponding DOM Element

Parameters:
uiComponent - the source of the attribute value
targetElement - the DOM Element that will receive the attribute
attrNameInComponent - the property name in the UIComponent object
attrNameInDom - the attribute name in the DOM Element

validateParameters

public void validateParameters(javax.faces.context.FacesContext facesContext,
                               javax.faces.component.UIComponent uiComponent,
                               java.lang.Class validComponentType)
Validates that the facesContext is not null, the uiComponent is not null, and that uiComponent is assignment-compatible with the validComponentType. Pass a null parameter for validComponentType to avoid any type checking.

Parameters:
facesContext -
uiComponent -
validComponentType -
Throws:
java.lang.NullPointerException - if either of the facesContext or the uiComponent parameters are null, IllegalArgumentException if the validComponentType is not null and the uiComponent is not assignable to the given type.

isStatic

public static boolean isStatic(javax.faces.component.UIComponent uiComponent)
A component is static if it is disabled or readonly.

Parameters:
uiComponent -
Returns:
true if the component is disabled or readonly

findNamingContainer

public static javax.faces.component.UIComponent findNamingContainer(javax.faces.component.UIComponent uiComponent)

Given a UIComponent instance, recursively examine the heirarchy of parent UIComponents until the first NamingContainer is found.

Parameters:
uiComponent -
Returns:
the nearest parent NamingContainer or null if none exist.

findForm

public static javax.faces.component.UIForm findForm(javax.faces.component.UIComponent uiComponent)

Given a UIComponent instance, recursively examine the heirarchy of parent NamingContainers until the UIForm is found.

Parameters:
uiComponent - the UIComponent instance
Returns:
uiForm the UIForm instance

getRowStyleClasses

public java.lang.String[] getRowStyleClasses(javax.faces.component.UIComponent uiComponent)
This method, given a component, will return an array of the component's row classes.

Parameters:
uiComponent -
Returns:
a String array of row classes defined in a tag attribute or defined by default, depending on the component. Can be a zero-length array

setPartialSubmit

public static void setPartialSubmit(javax.faces.component.UIComponent component)