Java Code Examples for javax.faces.component.UIComponent.getFacetCount()

The following are Jave code examples for showing how to use getFacetCount() of the javax.faces.component.UIComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: myfaces-trinidad   File: UIXCollection.java   Source Code and License Vote up 5 votes
@Override
public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
{
  if (component instanceof UIXColumn)
  {
    if (component.getFacetCount() > 0)
    {
      // visit the facet children without filtering for just UIXColumn children
      for (UIComponent facetChild : component.getFacets().values())
      {
        if (UIXComponent.visitTree(getWrapped(), facetChild, callback))
          return VisitResult.COMPLETE;
      }

      // visit the indexed children, recursively looking for more columns
      for (UIComponent child : component.getChildren())
      {
        if (UIXComponent.visitTree(this, child, callback))
          return VisitResult.COMPLETE;
      }
    }
  }

  // at this point, we either have already manually processed the UIXColumn's children, or
  // the component wasn't a UIXColumn and shouldn't be processed
  return VisitResult.REJECT;
}