Class ComponentSupport

java.lang.Object
com.sun.faces.facelets.tag.faces.ComponentSupport

public final class ComponentSupport extends Object
Version:
$Id$
Author:
Jacob Hookom
  • Field Details

    • MARK_CREATED

      public static final String MARK_CREATED
      See Also:
    • MARK_CHILDREN_MODIFIED

      public static final String MARK_CHILDREN_MODIFIED
      See Also:
    • REMOVED_CHILDREN

      public static final String REMOVED_CHILDREN
      See Also:
    • MARK_CREATED_REMOVED

      public static final String MARK_CREATED_REMOVED
    • COMPONENT_TO_TAG_MAP_NAME

      public static final 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:
  • Constructor Details

    • ComponentSupport

      public ComponentSupport()
  • Method Details

    • handlerIsResourceRelated

      public static boolean handlerIsResourceRelated(ComponentHandler handler)
    • isBuildingNewComponentTree

      public static boolean isBuildingNewComponentTree(FacesContext context)
    • isImplicitPanel

      public static boolean isImplicitPanel(UIComponent component)
    • finalizeForDeletion

      public static void finalizeForDeletion(UIComponent c)
      Used in conjunction with markForDeletion where any UIComponent marked will be removed.
      Parameters:
      c - UIComponent to finalize
    • setTagForComponent

      public static Tag setTagForComponent(FacesContext context, UIComponent c, Tag t)
    • getTagForComponent

      public static Tag getTagForComponent(FacesContext context, UIComponent c)
    • 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
    • findUIInstructionChildByTagId

      public static UIComponent findUIInstructionChildByTagId(FacesContext context, UIComponent parent, String id)
    • findChildByTagId

      public static UIComponent findChildByTagId(FacesContext context, UIComponent parent, String id)
      By TagId, find Child
      Parameters:
      parent - the parent UI component
      id - the id
      Returns:
      the UI component
    • addToDescendantMarkIdCache

      public static void addToDescendantMarkIdCache(UIComponent component, UIComponent otherComponent)
      Adds the mark id of the specified UIComponent otherComponent to the mark id cache of this component, including all its descendant mark ids. Changes are propagated up the component tree.
    • removeFromDescendantMarkIdCache

      public static void removeFromDescendantMarkIdCache(UIComponent component, UIComponent otherComponent)
      Removes the mark id of the specified UIComponent otherComponent from the mark id cache of this component, including all its descendant mark ids. Changes are propagated up the component tree.
    • isNotRenderingResponse

      public static boolean isNotRenderingResponse(FacesContext context)
      Returns true if the given faces context is not FacesContext.isReleased(), and its current phase ID is not PhaseId.RENDER_RESPONSE.
    • getLocale

      public static Locale getLocale(FaceletContext ctx, TagAttribute attr) throws TagAttributeException
      According to Faces 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

      public static void markForDeletion(UIComponent c)
      Marks all direct children and Facets with an attribute for deletion.
      Parameters:
      c - UIComponent to mark
      See Also:
    • encodeRecursive

      public static void encodeRecursive(FacesContext context, UIComponent viewToRender) throws IOException, FacesException
      Throws:
      IOException
      FacesException
    • removeTransient

      public static void removeTransient(UIComponent c)
    • addComponent

      public static void addComponent(FaceletContext ctx, UIComponent parent, 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 String getFacetName(UIComponent parent)
    • suppressViewModificationEvents

      public static boolean suppressViewModificationEvents(FacesContext ctx)
    • copyPassthroughAttributes

      public static void copyPassthroughAttributes(FaceletContext ctx, UIComponent c, Tag t)