com.sun.facelets.tag.jsf
Class ComponentSupport

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

public final class ComponentSupport
extends Object

Version:
$Id: ComponentSupport.java,v 1.7 2006/12/01 07:01:59 jhook Exp $
Author:
Jacob Hookom

Field Summary
static String MARK_CREATED
           
 
Constructor Summary
ComponentSupport()
           
 
Method Summary
static void encodeRecursive(FacesContext context, UIComponent viewToRender)
           
static void finalizeForDeletion(UIComponent c)
          Used in conjunction with markForDeletion where any UIComponent marked will be removed.
static UIComponent findChild(UIComponent parent, String id)
          A lighter-weight version of UIComponent's findChild.
static UIComponent findChildByTagId(UIComponent parent, String id)
          By TagId, find Child
static Locale getLocale(FaceletContext ctx, TagAttribute attr)
          According to JSF 1.2 tag specs, this helper method will use the TagAttribute passed in determining the Locale intended.
static UIViewRoot getViewRoot(FaceletContext ctx, 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 boolean isNew(UIComponent component)
          Determine if the passed component is not null and if it's new to the tree.
static void markForDeletion(UIComponent c)
          Marks all direct children and Facets with an attribute for deletion.
static void removeTransient(UIComponent c)
           
 
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 String MARK_CREATED
See Also:
Constant Field Values
Constructor Detail

ComponentSupport

public ComponentSupport()
Method Detail

finalizeForDeletion

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

Parameters:
c - UIComponent to finalize

findChild

public static final UIComponent findChild(UIComponent parent,
                                          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 final UIComponent findChildByTagId(UIComponent parent,
                                                 String id)
By TagId, find Child

Parameters:
parent -
id -
Returns:

getLocale

public static final Locale getLocale(FaceletContext ctx,
                                     TagAttribute attr)
                              throws 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:
TagAttributeException - if the Locale cannot be determined

getViewRoot

public static final UIViewRoot getViewRoot(FaceletContext ctx,
                                           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 final void markForDeletion(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 final void encodeRecursive(FacesContext context,
                                         UIComponent viewToRender)
                                  throws IOException,
                                         FacesException
Throws:
IOException
FacesException

removeTransient

public static void removeTransient(UIComponent c)

isNew

public static final boolean isNew(UIComponent component)
Determine if the passed component is not null and if it's new to the tree. This operation can be used for determining if attributes should be wired to the component.

Parameters:
component - the component you wish to modify
Returns:
true if it's new


Copyright © 2005 All Rights Reserved.