public final class UIUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
getNextParent(Component c,
Class<T> type) |
static <T,C extends Component> |
lookupComponentTree(Component parent,
ComponentTreeVisitor<T,C> visitor,
Class<C> type)
Walks through the
parent 's component tree hierarchy. |
static <T> T |
lookupComponentTree(Component parent,
ComponentTreeVisitor<T,Component> visitor)
Shortcut for
lookupComponentTree(parent,visitor,null) . |
public static <T> T lookupComponentTree(Component parent, ComponentTreeVisitor<T,Component> visitor)
lookupComponentTree(parent,visitor,null)
.T
- The return typeparent
- The root of the component tree to visitvisitor
- the ComponentTreeVisitor
ComponentTreeVisitor}
public static <T,C extends Component> T lookupComponentTree(Component parent, ComponentTreeVisitor<T,C> visitor, Class<C> type)
parent
's component tree hierarchy.
For every child in the tree hierarchy, which fits the type
parameter (or type is null
), the visitor
's
ComponentTreeVisitor.visit(Component)
is invoked.
If the visit
method returns a value != null
,
the visitation ends and that value is returned.
T
- The return typeC
- The component type to visitparent
- The root of the component tree to visitvisitor
- the ComponentTreeVisitor
type
- The component type class to visitComponentTreeVisitor}