|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.iterator.AbstractHierarchyIterator<N,I> org.apache.wicket.util.iterator.AbstractHierarchyIteratorWithFilter<Component,Component> org.apache.wicket.util.iterator.ComponentHierarchyIterator
public class ComponentHierarchyIterator
Iterator over the complete Component hierarchy. The implementation is parent first, meaning that first the parent gets returned upon next() and only than it's children.
A fluent or builder type of API is provided to configure the iterator with filters.
Constructor Summary | |
---|---|
ComponentHierarchyIterator(Component component)
Construct. |
|
ComponentHierarchyIterator(Component component,
Class<?> clazz)
Convenience Constructor |
|
ComponentHierarchyIterator(Component component,
Class<?> clazz,
boolean visible,
boolean enabled)
Convenience Constructor |
Method Summary | |
---|---|
ComponentHierarchyIterator |
addFilter(IteratorFilter<Component> filter)
Add a filter (fluent API) |
ComponentHierarchyIterator |
addTraverseFilters(IteratorFilter<Component> filter)
Add a filter to the traversal filter list (fluent API). |
ComponentHierarchyIterator |
filterByClass(Class<?> clazz)
Ignore components which don't implement (instanceof) the class provided. |
ComponentHierarchyIterator |
filterById(String match)
Ignore all components which don't match the id (regex). |
ComponentHierarchyIterator |
filterByVisibility()
Ignore all Components which not visible. |
ComponentHierarchyIterator |
filterEnabled()
Ignore all Components which not enabled (disabled) in the hierarchy |
ComponentHierarchyIterator |
filterLeavesOnly()
Add a filter which returns only leaf components. |
protected boolean |
hasChildren(Component elem)
Only MarkupContainer's might have children |
protected Iterator<Component> |
newIterator(Component node)
The component must be a MarkupContainer to contain children |
Methods inherited from class org.apache.wicket.util.iterator.AbstractHierarchyIteratorWithFilter |
---|
getFilters, getFirst, getTraverseFilters, onFilter, onTraversalFilter, replaceFilterSet, toList |
Methods inherited from class org.apache.wicket.util.iterator.AbstractHierarchyIterator |
---|
dontGoDeeper, hasNext, iterator, next, remove, setChildFirst, skipRemainingSiblings, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComponentHierarchyIterator(Component component)
component
- Iterate over the containers childrenpublic ComponentHierarchyIterator(Component component, Class<?> clazz, boolean visible, boolean enabled)
component
- Iterate over the containers childrenclazz
- Add filter by classvisible
- Add filter by visibilityenabled
- Add filter by "enabled"public ComponentHierarchyIterator(Component component, Class<?> clazz)
component
- Iterate over the containers childrenclazz
- Add filter by classMethod Detail |
---|
protected Iterator<Component> newIterator(Component node)
newIterator
in class AbstractHierarchyIterator<Component,Component>
protected boolean hasChildren(Component elem)
hasChildren
in class AbstractHierarchyIterator<Component,Component>
public final ComponentHierarchyIterator filterLeavesOnly()
public ComponentHierarchyIterator filterByClass(Class<?> clazz)
clazz
-
public ComponentHierarchyIterator filterByVisibility()
public ComponentHierarchyIterator filterEnabled()
public ComponentHierarchyIterator filterById(String match)
match
- Regex to find Components matching
public ComponentHierarchyIterator addFilter(IteratorFilter<Component> filter)
AbstractHierarchyIteratorWithFilter
addFilter
in class AbstractHierarchyIteratorWithFilter<Component,Component>
public ComponentHierarchyIterator addTraverseFilters(IteratorFilter<Component> filter)
AbstractHierarchyIteratorWithFilter
addTraverseFilters
in class AbstractHierarchyIteratorWithFilter<Component,Component>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |