public static void runIfSwingOrRunLater(Runnable r) {
		if (isInHeadlessMode()) {
			r.run();
			return;
		}

		if (SwingUtilities.isEventDispatchThread()) {
			r.run();
		}
		else {
			SwingUtilities.invokeLater(r);
		}
	}
Runs the given runnable now if the caller is on the Swing thread.  Otherwise, the 
runnable will be posted later.

@param r the runnable
Ghidra/Framework/Utility/src/main/java/ghidra/util/Swing.java