Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Strange thing about View.getChildren
Strange thing about View.getChildren [message #106655] Sun, 25 February 2007 04:39
Eclipse UserFriend
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
Previous Topic:programatically set editpart selection
Next Topic:Problem with Mindmap Tutorial and M5
Goto Forum:
  


Current Time: Sat Jul 12 11:50:36 EDT 2025

Powered by FUDForum. Page generated in 0.17640 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top