public void collapseAll(GTreeNode node) {

		runSwingNow(() -> {
			node.fireNodeStructureChanged();
			tree.collapsePath(node.getTreePath());

			boolean nodeIsRoot = node.equals(model.getRoot());

			if (nodeIsRoot && !tree.isRootAllowedToCollapse()) {
				runTask(new GTreeExpandNodeToDepthTask(this, getJTree(), node, 1));
			}

		});
	}
A method that subclasses can use to be notified when tree state has been restored. This
method is called after a major structural tree change has happened <b>and</b> the paths that
should be opened have been opened. Thus any other nodes are closed and can be disposed, if
desired.

@param taskMonitor the TaskMonitor
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/GTree.java