@Override
	protected void programChanged(Program program) {
		if (program == null) {
			getMenuBarData().setMenuItemName("&Close");
			setDescription("Close Program");
		}
		else {
			String progName = program.getDomainFile().getName();
			getMenuBarData().setMenuItemNamePlain("Close '%s'".formatted(progName));
			getMenuBarData().setMnemonic('C');
			setDescription("<html>Close '%s'".formatted(HTMLUtilities.escapeHTML(progName)));
		}
	}
Action class for the "Close Program" action
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/CloseProgramAction.java