void (@NotNull Collection<? extends UsageState> states) { ThreadingAssertions.assertEventDispatchThread(); //always expand the last level group DefaultMutableTreeNode root = (DefaultMutableTreeNode)myTree.getModel().getRoot(); for (int i = root.getChildCount() - 1; i >= 0; i--) { DefaultMutableTreeNode child = (DefaultMutableTreeNode)root.getChildAt(i); if (child instanceof GroupNode) { TreePath treePath = new TreePath(child.getPath()); myTree.expandPath(treePath); } } myTree.getSelectionModel().clearSelection(); for (UsageState usageState : states) { usageState.restore(); } }