// Ensure that inserted nodes are expanded.
// Note that we add the listener before any other listener can be added.
// This is because the JTree adds its own listeners to update itself on model change, but any added nodes will be
// collapsed by default. The model listeners are notified in *reverse* order from the order in which they are added,
// meaning that if we add this listener first, it will be notified last, after any new nodes have appeared.
argumentTreeModel.addTreeModelListener(new TreeModelListener() {
public void treeNodesChanged(TreeModelEvent e) {
expandAll(e.getTreePath(), true);
}