void (Module module) { DefaultMutableTreeNode root = (DefaultMutableTreeNode)myRightTree.getModel().getRoot(); root.removeAllChildren(); Set<List<Module>> cycles = GraphAlgorithms.getInstance().findCycles(myModuleGraph, module); int index = 1; for (List<Module> modules : cycles) { DefaultMutableTreeNode cycle = new DefaultMutableTreeNode(CodeInsightBundle.message("module.dependencies.cycle.node.text", index++)); root.add(cycle); cycle.add(new DefaultMutableTreeNode(new MyUserObject(false, module))); for (Module moduleInCycle : modules) { cycle.add(new DefaultMutableTreeNode(new MyUserObject(false, moduleInCycle))); } } ((DefaultTreeModel)myRightTree.getModel()).reload(); TreeUtil.expandAll(myRightTree); }