{
for (UIComponent grandKid : kid.getChildren())
{
if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
{
throw new AbortProcessingException();
}
}
}
}
};
}
else
{
// We are only visiting a subset of the tree, so figure out which rows to visit
String ourClientIdPrefix = getClientId(visitContext.getFacesContext());
int subtreeIdCount = subtreeIds.size();
// build up a set of the row keys to visit rather than iterating
// and visiting every row
Set<String> rowsToVisit;
if (subtreeIdCount > 1)
{
rowsToVisit = new HashSet<String>(subtreeIdCount);
for (String currClientId : subtreeIds)
{
String clientToken = _getClientToken(ourClientIdPrefix, currClientId);
if (clientToken != null)
{
rowsToVisit.add(clientToken);
}
}
}
else
{
String clientToken = _getClientToken(ourClientIdPrefix,
subtreeIds.iterator().next());
if (clientToken != null)
{
rowsToVisit = Collections.singleton(clientToken);
}
else
{
rowsToVisit = Collections.emptySet();
}
}
// we didn't visit any data
if (rowsToVisit.isEmpty())
return false;
// visit only the rows we need to
runner = new KeyedRunner(rowsToVisit)
{
@Override
protected void process(
UIComponent kid,
ComponentProcessingContext cpContext
) throws IOException
{
if (kid.getChildCount() > 0)
{
for (UIComponent grandKid : kid.getChildren())
{
if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
{
throw new AbortProcessingException();
}
}
}
}
};