org.apache.myfaces.view.facelets.tag.jsf
Class ComponentSupport

java.lang.Object
  extended by org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport

public final class ComponentSupport
extends Object

Version:
$Id: ComponentSupport.java 1470769 2013-04-23 01:07:54Z lu4242 $
Author:
Jacob Hookom

Field Summary
static String COMPONENT_ADDED_BY_HANDLER_MARKER
          Special myfaces core marker to indicate the component is handled by a facelet tag handler, so its creation is not handled by user programatically and PSS remove listener should not register it when a remove happens.
static String FACELET_STATE_INSTANCE
          The key under the facelet state map is stored
static String FACET_CREATED_UIPANEL_MARKER
          The UIPanel components, which are dynamically generated to serve as a container for facets with multiple non panel children, are marked with this attribute.
static String MARK_CREATED
           
 
Constructor Summary
ComponentSupport()
           
 
Method Summary
static void addFacet(FaceletContext ctx, UIComponent parent, UIComponent c, String facetName)
           
static void encodeRecursive(FacesContext context, UIComponent toRender)
           
static void finalizeForDeletion(UIComponent component)
          Deprecated. use FaceletCompositionContext.finalizeForDeletion
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 UIComponent findComponentChildOrFacetFrom(FacesContext facesContext, UIComponent parent, String expr)
           
static UIComponent findComponentChildOrFacetFrom(UIComponent parent, String id, String innerExpr)
           
static String getFindComponentExpression(FacesContext facesContext, UIComponent component)
           
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)
          Deprecated. use ComponentHandler.isNew
static void markComponentToRestoreFully(FacesContext context, UIComponent component)
           
static void markForDeletion(UIComponent component)
          Deprecated. use FaceletCompositionContext.markForDeletion
static void removeFacet(FaceletContext ctx, UIComponent parent, UIComponent c, String facetName)
           
static void removeTransient(UIComponent component)
           
static Object restoreInitialTagState(FaceletContext ctx, FaceletCompositionContext fcc, UIComponent parent, String uniqueId)
           
static void saveInitialTagState(FaceletContext ctx, FaceletCompositionContext fcc, UIComponent parent, String uniqueId, Object value)
           
 
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

FACET_CREATED_UIPANEL_MARKER

public static final String FACET_CREATED_UIPANEL_MARKER
The UIPanel components, which are dynamically generated to serve as a container for facets with multiple non panel children, are marked with this attribute. This constant is duplicate in javax.faces.webapp.UIComponentClassicTagBase

See Also:
Constant Field Values

COMPONENT_ADDED_BY_HANDLER_MARKER

public static final String COMPONENT_ADDED_BY_HANDLER_MARKER
Special myfaces core marker to indicate the component is handled by a facelet tag handler, so its creation is not handled by user programatically and PSS remove listener should not register it when a remove happens.

See Also:
Constant Field Values

FACELET_STATE_INSTANCE

public static final String FACELET_STATE_INSTANCE
The key under the facelet state map is stored

See Also:
Constant Field Values
Constructor Detail

ComponentSupport

public ComponentSupport()
Method Detail

finalizeForDeletion

@Deprecated
public static void finalizeForDeletion(UIComponent component)
Deprecated. use FaceletCompositionContext.finalizeForDeletion

Used in conjunction with markForDeletion where any UIComponent marked will be removed.

Parameters:
component - UIComponent to finalize

findChild

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

Parameters:
parent -
id -
Returns:

getLocale

public static 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 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

@Deprecated
public static void markForDeletion(UIComponent component)
Deprecated. use FaceletCompositionContext.markForDeletion

Marks all direct children and Facets with an attribute for deletion.

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

encodeRecursive

public static void encodeRecursive(FacesContext context,
                                   UIComponent toRender)
                            throws IOException,
                                   FacesException
Throws:
IOException
FacesException

removeTransient

public static void removeTransient(UIComponent component)

isNew

@Deprecated
public static boolean isNew(UIComponent component)
Deprecated. use ComponentHandler.isNew

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

addFacet

public static void addFacet(FaceletContext ctx,
                            UIComponent parent,
                            UIComponent c,
                            String facetName)

removeFacet

public static void removeFacet(FaceletContext ctx,
                               UIComponent parent,
                               UIComponent c,
                               String facetName)

markComponentToRestoreFully

public static void markComponentToRestoreFully(FacesContext context,
                                               UIComponent component)

findComponentChildOrFacetFrom

public static UIComponent findComponentChildOrFacetFrom(FacesContext facesContext,
                                                        UIComponent parent,
                                                        String expr)

findComponentChildOrFacetFrom

public static UIComponent findComponentChildOrFacetFrom(UIComponent parent,
                                                        String id,
                                                        String innerExpr)

getFindComponentExpression

public static String getFindComponentExpression(FacesContext facesContext,
                                                UIComponent component)

restoreInitialTagState

public static Object restoreInitialTagState(FaceletContext ctx,
                                            FaceletCompositionContext fcc,
                                            UIComponent parent,
                                            String uniqueId)

saveInitialTagState

public static void saveInitialTagState(FaceletContext ctx,
                                       FaceletCompositionContext fcc,
                                       UIComponent parent,
                                       String uniqueId,
                                       Object value)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.