private void saveAs(DomainObject domainObject, DomainFolder folder, String name) {
		DomainFile existingFile = folder.getFile(name);
		if (existingFile == domainObject.getDomainFile()) {
			save(domainObject);
			return;
		}
		if (existingFile != null) {
			String msg = "Program " + name + " already exists.\n" + "Do you want to overwrite it?";
			if (OptionDialog.showOptionDialog(tool.getToolFrame(), "Duplicate Name", msg,
				"Overwrite", OptionDialog.QUESTION_MESSAGE) == OptionDialog.CANCEL_OPTION) {
				return;
			}
		}
		tool.prepareToSave(domainObject);
		DomainObjectSaveAsTask task = new DomainObjectSaveAsTask(CONTENT_NAME, domainObject, folder,
			name, existingFile != null);
		new TaskLauncher(task, tool.getToolFrame());
	}
Signals to this manager to save the knowledge of all currently opened archives and to mark
the tool as dirty (changed) if the current open archives are not the same as those that
were initially opened.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/archive/DataTypeManagerHandler.java