Groovy Freemind RecurseNode


/ Published in: Groovy
Save to your folder(s)

Groovy Freemind RecurseNode


Copy this code and paste it in your HTML
  1. def recurseNode( aNode = null, results = [] ) {
  2. if (aNode == null) { // null means return all nodes from root
  3. aNode = freemind.main.FreeMind.getFrames().find( { it.class.name.equals( 'freemind.main.FreeMind' ) } ).controller.model.rootNode;
  4. }
  5. results << aNode;
  6. if ( aNode?.children ) {
  7. aNode.children.each {
  8. recurseNode( it, results );
  9. }
  10. }
  11. return results;
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.