Strange thing about View.getChildren [message #106655] |
Sun, 25 February 2007 04:39 |
Eclipse User |
|
|
|
Hi, dear all
Today I'm trying to get all nodes in one diagram and change their
attributes. So I recursively call "getChildren()" function and collected
every children in a list. To my surprise, the result list doesn't
contain all nodes. Many nodes are lost from this list. My code is shown
here:
private static void getChildren(List result, View parent) {
List children = parent.getChildren();
for (Iterator iter = children.iterator(); iter.hasNext();) {
View element = (View) iter.next();
result.add(element);
getChildren(result, element);
}
}
Does someone know the reason of this strange phenomenon?
Thanks a lot!
James Gan
|
|
|
Powered by
FUDForum. Page generated in 0.60995 seconds