void () { Pair<ElementNode, List<ElementNode>> pair = storeSelection(); Enumeration<TreeNode> children = getRootNodeChildren(); while (children.hasMoreElements()) { ParentNode classNode = (ParentNode)children.nextElement(); sortNode(classNode, myComparator); myTreeModel.nodeStructureChanged(classNode); } restoreSelection(pair); }