public static synchronized void install(PluginTool tool) {

		if (installed) {
			return;
		}
		installed = true;

		if (Platform.CURRENT_PLATFORM.getOperatingSystem() != OperatingSystem.MAC_OS_X) {
			return;
		}

		Desktop.getDesktop().setQuitHandler((evt, response) -> {
			response.cancelQuit(); // allow our tool to quit the application instead of the OS
			tool.close();
		});
	}
Applies a quit handler which will close the given tool.

@param tool The tool to close, which should result in the desired quit behavior.
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginToolMacQuitHandler.java