@Override
			protected boolean isAddToPopup(DockingAction action) {

				String name = action.getName();
				switch (name) {
					case "Tree Expand All":
					case "Tree Expand Node":
					case "Tree Collapse Node":
						// case "Tree Collapse All": // this action seems ok
						return false;
					default:
						return true;
				}

			}
A variable used to restrict open-ended operations, like expanding all nodes or filtering.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java