public static void run(@Nonnull Runnable action) {
		// Skip under test environment.
		if (TestEnvironment.isTestEnv()) return;

		// Hold for later if FX has not been initialized.
		if (!initialized) {
			preInitQueue.add(action);
			return;
		}

		// Wrap action so that if it fails we don't explode and kill the FX thread.
		action = ThreadUtil.wrap(action);

		// Run inline if on FX thread already, otherwise queue it up.
		if (Platform.isFxApplicationThread()) action.run();
		else Platform.runLater(action);
	}
Run action in JavaFX thread.

@param action
		Runnable to start in UI thread.
recaf-ui/src/main/java/software/coley/recaf/util/FxThreadUtil.java