@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;
		}
	}
Tree that shows the folders and domain files in a Project
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DataTree.java