private void showTaskDialog(WrappingTaskMonitor monitor) {

		if (SystemUtilities.isInHeadlessMode()) {
			return;
		}

		Swing.runIfSwingOrRunLater(() -> {
			taskDialog = buildTaskDialog();
			monitor.setDelegate(taskDialog); // initialize the dialog to the current monitor state 
			taskDialog.show(Math.max(delayMs, 0));
		});
	}
Helper class to launch the given task in a background thread, showing a task dialog if
this task takes to long. See {@link TaskLauncher}.
Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskRunner.java