void256/nifty-gui — pull request #16 by telamon (2012-03-26 00:32:21+00:00)
Title: Feature: Element.getDescendants()

Function added to Element.java:

/**
* get all children and all childrens' children.
* @return an iterator that will traverse the entire Element tree.
*/
public Iterator getDescendants()

I've worked with many other node-tree'ish implementations and realized that getting a List or Iterator of all descendants of a node was missing in nifty.
I hope I haven't missed an existing interface somewhere that already accomplishes this.

I've created a simple tree traverser using the `Iterator` interface in order to avoid pre-generating lists of elements and waste resources.

The iterator implementation is called `ElementTreeTraverser` and I've put it in `de.lessvoid.nifty.elements.tools` package.

Feel free to accept this request if you think the feature is 'nifty' enough :)
Cheers!