Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0-beta-1
-
None
Description
Currently UIXComponent provides hooks for a component to know when the children are being visited by calling setupChildrenEncodingContext or setupChildrenVisitingContext on the component. The problem is that setupChildrenVisitingContext is protected and cannot be called from the outside.
A use case where this is very helpful is when you want to locate one component using the visitTree API and then visit all the children under that component. Currently there is no means to be able to do this with correctly having the correct setup and tear down methods called on the UIXComponent.
A static method on UIXComponent would be helpful to allow one to visit the children of a component using a new visit call from within an outer call.
Example:
@Override
public VisitResult visit(
VisitContext visitContext,
UIComponent target)
{
if (someCondition)
{
UIXComponent.visitChildren(target, visitContext, new VisitCallback()
);
return VisitResult.COMPLETE;
}
...
}