public void close(Window w) {
		if (w == null) {
			return;
		}

		if (w instanceof DockingDialog dialog) {
			DialogComponentProvider component = dialog.getDialogComponent();
			close(component);
			return;
		}

		boolean wait = !isOnlyFrame(w);
		runSwing(() -> w.setVisible(false), wait);
	}
Will try to close dialogs prompting for changes to be saved, whether from program changes
or from tool config changes.
Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java