ICEfaces 1.x Compatibility Library 3.3.0
Java API Documentation

com.icesoft.faces.renderkit.dom_html_basic
Class DomBasicRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer
Direct Known Subclasses:
DomBasicInputRenderer

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


Field Summary
static java.lang.String ATTRIBUTES_THAT_ARE_SET_KEY
           
static java.lang.String ICESUBMIT
           
static java.lang.String ICESUBMITPARTIAL
           
static java.lang.String UIFORM
           
static java.lang.String WEB_UIFORM
           
static java.lang.String WEB_UIJSFFORM
           
 
Constructor Summary
DomBasicRenderer()
           
 
Method Summary
static java.lang.String combinedPassThru(java.lang.String passThru, java.lang.String renderer)
          This is a utility method for concatenating two Strings, where passThru is typically null or an empty String, and renderer is usually non-null, but can in theory be null, and we want to minimise needless new String creation.
 java.lang.String convertClientId(javax.faces.context.FacesContext context, java.lang.String clientId)
           
static java.lang.String converterGetAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.Object currentValue)
           
 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.UIComponent findForm(javax.faces.component.UIComponent uiComponent)
          

Given a UIComponent instance, recursively examine the heirarchy of parent NamingContainers until a Form 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.

protected  java.lang.String formatComponentValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.Object currentValue)
          If the parameter UIComponent instance is a ValueHolder, return the currentValue parameter.
protected  java.lang.String[] getColumnStyleClasses(javax.faces.component.UIComponent uiComponent)
           
static java.lang.String[] getExcludesArray(java.util.Set excludes)
          Retrieve the array of excluded attributes.
protected static javax.faces.component.UIComponent getFacetByName(javax.faces.component.UIComponent uiComponent, java.lang.String name)
           
protected static java.util.Map getParameterMap(javax.faces.component.UIComponent uiComponent)
          Due to the behaviour of the UIParameter class, the names in the name-value pairs of the Map returned by this method are guaranteed to be Strings
static java.lang.String getResourceURL(javax.faces.context.FacesContext context, java.lang.String path)
           
 java.lang.String[] getRowStyleClasses(javax.faces.component.UIComponent uiComponent)
          This method, given a component, will return an array of the component's row classes.
 java.lang.String[] getStyleClasses(javax.faces.component.UIComponent uiComponent, java.lang.String styleClassAttributeName)
           
 java.lang.String getValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
          Get the submitted value from the UIComponent argument.
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 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
static 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
encodeBegin, encodeChildren, getConvertedValue, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTES_THAT_ARE_SET_KEY

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

ICESUBMITPARTIAL

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

ICESUBMIT

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

WEB_UIFORM

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

UIFORM

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

WEB_UIJSFFORM

public static final java.lang.String WEB_UIJSFFORM
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)
Overrides:
decode in class javax.faces.render.Renderer

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.

Overrides:
encodeEnd in class javax.faces.render.Renderer
Throws:
java.io.IOException

getValue

public java.lang.String getValue(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UIComponent uiComponent)
Get the submitted value from the UIComponent argument. If the UIComponent is not an instance of UIInput, or its getSubmittedValue() method returns null or a non-String value, then an attempt is made to obtain the value from the UIComponent's renderer. Conversion is performed on a value obtained from the renderer.

Parameters:
facesContext -
uiComponent -
Returns:
String the submitted value

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

formatComponentValue

protected java.lang.String formatComponentValue(javax.faces.context.FacesContext facesContext,
                                                javax.faces.component.UIComponent uiComponent,
                                                java.lang.Object currentValue)
                                         throws javax.faces.convert.ConverterException
If the parameter UIComponent instance is a ValueHolder, return the currentValue parameter. If there is a converter registered with the component then use the converter to obtain a String value.

Parameters:
facesContext -
uiComponent -
currentValue -
Returns:
Throws:
javax.faces.convert.ConverterException

converterGetAsString

public static java.lang.String converterGetAsString(javax.faces.context.FacesContext facesContext,
                                                    javax.faces.component.UIComponent uiComponent,
                                                    java.lang.Object currentValue)

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

getFacetByName

protected static javax.faces.component.UIComponent getFacetByName(javax.faces.component.UIComponent uiComponent,
                                                                  java.lang.String name)

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

getParameterMap

protected static java.util.Map getParameterMap(javax.faces.component.UIComponent uiComponent)
Due to the behaviour of the UIParameter class, the names in the name-value pairs of the Map returned by this method are guaranteed to be Strings

Parameters:
uiComponent -
Returns:
Map the parameterMap

validateParameters

public static 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 or if a parent form is not found when the given UIComponent is a UIInput or UICommand, 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.UIComponent findForm(javax.faces.component.UIComponent uiComponent)

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

Parameters:
uiComponent - the UIComponent instance
Returns:
form as the UIComponent instance

getColumnStyleClasses

protected java.lang.String[] getColumnStyleClasses(javax.faces.component.UIComponent uiComponent)

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

getStyleClasses

public java.lang.String[] getStyleClasses(javax.faces.component.UIComponent uiComponent,
                                          java.lang.String styleClassAttributeName)

getResourceURL

public static java.lang.String getResourceURL(javax.faces.context.FacesContext context,
                                              java.lang.String path)

combinedPassThru

public static java.lang.String combinedPassThru(java.lang.String passThru,
                                                java.lang.String renderer)
This is a utility method for concatenating two Strings, where passThru is typically null or an empty String, and renderer is usually non-null, but can in theory be null, and we want to minimise needless new String creation.

Parameters:
passThru - The passthru attribute from the component
renderer - The Javascript that the Renderer needs to output
Returns:
A String concatenation of passThru + renderer

convertClientId

public java.lang.String convertClientId(javax.faces.context.FacesContext context,
                                        java.lang.String clientId)
Overrides:
convertClientId in class javax.faces.render.Renderer

ICEfaces 1.x Compatibility Library 3.3.0
Java API Documentation

Copyright 2013 ICEsoft Technologies Canada Corp., All Rights Reserved.