com.sun.faces.facelets.tag.jsf
Class ComponentSupport

java.lang.Object
  extended by com.sun.faces.facelets.tag.jsf.ComponentSupport

public final class ComponentSupport
extends java.lang.Object

Version:
$Id: ComponentSupport.java 8859 2011-02-18 07:51:05Z sheetalv $
Author:
Jacob Hookom

Field Summary
static java.lang.String COMPONENT_TO_TAG_MAP_NAME
          Key to a FacesContext scoped Map where the keys are UIComponent instances and the values are Tag instances.
static java.lang.String MARK_CREATED
           
 
Constructor Summary
ComponentSupport()
           
 
Method Summary
static void addComponent(javax.faces.view.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent, javax.faces.component.UIComponent child)
          

Add the child component to the parent.

static void encodeRecursive(javax.faces.context.FacesContext context, javax.faces.component.UIComponent viewToRender)
           
static void finalizeForDeletion(javax.faces.component.UIComponent c)
          Used in conjunction with markForDeletion where any UIComponent marked will be removed.
static javax.faces.component.UIComponent findChild(javax.faces.component.UIComponent parent, java.lang.String id)
          A lighter-weight version of UIComponent's findChild.
static javax.faces.component.UIComponent findChildByTagId(javax.faces.component.UIComponent parent, java.lang.String id)
          By TagId, find Child
static java.lang.String getFacetName(javax.faces.component.UIComponent parent)
           
static java.util.Locale getLocale(javax.faces.view.facelets.FaceletContext ctx, javax.faces.view.facelets.TagAttribute attr)
          According to JSF 1.2 tag specs, this helper method will use the TagAttribute passed in determining the Locale intended.
static boolean getMakeSureAncestorIsForm(javax.faces.view.facelets.FaceletContext ctx)
           
static boolean getNeedUniqueIds(javax.faces.view.facelets.FaceletContext ctx)
          Determines whether literal component Ids need to be make unique.
static javax.faces.view.facelets.Tag getTagForComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c)
           
static javax.faces.component.UIViewRoot getViewRoot(javax.faces.view.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent)
          Tries to walk up the parent to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for the view root.
static void markForDeletion(javax.faces.component.UIComponent c)
          Marks all direct children and Facets with an attribute for deletion.
static void removeTransient(javax.faces.component.UIComponent c)
           
static boolean setNeedUniqueIds(javax.faces.view.facelets.FaceletContext ctx, boolean needUniqueIds)
          Specifies whether literal component Ids need to be make unique.
static javax.faces.view.facelets.Tag setTagForComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, javax.faces.view.facelets.Tag t)
           
static boolean suppressViewModificationEvents(javax.faces.context.FacesContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARK_CREATED

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

COMPONENT_TO_TAG_MAP_NAME

public static final java.lang.String COMPONENT_TO_TAG_MAP_NAME
Key to a FacesContext scoped Map where the keys are UIComponent instances and the values are Tag instances.

See Also:
Constant Field Values
Constructor Detail

ComponentSupport

public ComponentSupport()
Method Detail

finalizeForDeletion

public static void finalizeForDeletion(javax.faces.component.UIComponent c)
Used in conjunction with markForDeletion where any UIComponent marked will be removed.

Parameters:
c - UIComponent to finalize

setTagForComponent

public static javax.faces.view.facelets.Tag setTagForComponent(javax.faces.context.FacesContext context,
                                                               javax.faces.component.UIComponent c,
                                                               javax.faces.view.facelets.Tag t)

getTagForComponent

public static javax.faces.view.facelets.Tag getTagForComponent(javax.faces.context.FacesContext context,
                                                               javax.faces.component.UIComponent c)

findChild

public static javax.faces.component.UIComponent findChild(javax.faces.component.UIComponent parent,
                                                          java.lang.String id)
A lighter-weight version of UIComponent's findChild.

Parameters:
parent - parent to start searching from
id - to match to
Returns:
UIComponent found or null

findChildByTagId

public static javax.faces.component.UIComponent findChildByTagId(javax.faces.component.UIComponent parent,
                                                                 java.lang.String id)
By TagId, find Child

Parameters:
parent -
id -
Returns:

getLocale

public static java.util.Locale getLocale(javax.faces.view.facelets.FaceletContext ctx,
                                         javax.faces.view.facelets.TagAttribute attr)
                                  throws javax.faces.view.facelets.TagAttributeException
According to JSF 1.2 tag specs, this helper method will use the TagAttribute passed in determining the Locale intended.

Parameters:
ctx - FaceletContext to evaluate from
attr - TagAttribute representing a Locale
Returns:
Locale found
Throws:
javax.faces.view.facelets.TagAttributeException - if the Locale cannot be determined

getViewRoot

public static javax.faces.component.UIViewRoot getViewRoot(javax.faces.view.facelets.FaceletContext ctx,
                                                           javax.faces.component.UIComponent parent)
Tries to walk up the parent to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for the view root.

Parameters:
ctx - FaceletContext
parent - UIComponent to search from
Returns:
UIViewRoot instance for this evaluation

markForDeletion

public static void markForDeletion(javax.faces.component.UIComponent c)
Marks all direct children and Facets with an attribute for deletion.

Parameters:
c - UIComponent to mark
See Also:
finalizeForDeletion(UIComponent)

encodeRecursive

public static void encodeRecursive(javax.faces.context.FacesContext context,
                                   javax.faces.component.UIComponent viewToRender)
                            throws java.io.IOException,
                                   javax.faces.FacesException
Throws:
java.io.IOException
javax.faces.FacesException

removeTransient

public static void removeTransient(javax.faces.component.UIComponent c)

getMakeSureAncestorIsForm

public static boolean getMakeSureAncestorIsForm(javax.faces.view.facelets.FaceletContext ctx)

addComponent

public static void addComponent(javax.faces.view.facelets.FaceletContext ctx,
                                javax.faces.component.UIComponent parent,
                                javax.faces.component.UIComponent child)

Add the child component to the parent. If the parent is a facet, check to see whether the facet is already defined. If it is, wrap the existing component in a panel group, if it's not already, then add the child to the panel group. If the facet does not yet exist, make the child the facet.


getFacetName

public static java.lang.String getFacetName(javax.faces.component.UIComponent parent)

suppressViewModificationEvents

public static boolean suppressViewModificationEvents(javax.faces.context.FacesContext ctx)

setNeedUniqueIds

public static final boolean setNeedUniqueIds(javax.faces.view.facelets.FaceletContext ctx,
                                             boolean needUniqueIds)
Specifies whether literal component Ids need to be make unique. This method is normally called by the tag handlers executing their child handlers repeatedly.

Parameters:
ctx - Facelet context
needUniqueIds - true if literal Ids have to be made unique, false otherwise
Returns:
the old value of the needUniqueIds flag
See Also:
getNeedUniqueIds

getNeedUniqueIds

public static boolean getNeedUniqueIds(javax.faces.view.facelets.FaceletContext ctx)
Determines whether literal component Ids need to be make unique.

Parameters:
ctx - Facelet context
Returns:
true if the literal Ids need to be made unique, false otherwise
See Also:
setNeedUniqueIds


Copyright © 2011 Oracle America, Inc. All Rights Reserved.