private void save() {

		String newName = nameField.getText().trim();

		if (newName.length() == 0) {
			this.setStatusText("Please enter or select a name.");
			return;
		}

		if (newName.indexOf(" ") >= 0) {
			setStatusText("Name cannot have spaces.");
			nameField.requestFocus();
			return;
		}
		if (!NamingUtilities.isValidName(newName)) {
			setStatusText("Invalid character in name: " + NamingUtilities.findInvalidChar(newName));
			nameField.requestFocus();
			return;
		}

		if (newName.equals(defaultName)) {
			saveToolConfig();
		}
		else if (isOverwriteExistingTool(newName)) {
			if (OptionDialog.showOptionDialog(tool.getToolFrame(), "Overwrite Tool?",
				"Overwrite existing tool, " + newName + "?", "Overwrite",
				OptionDialog.QUESTION_MESSAGE) == OptionDialog.OPTION_ONE) {
				tool.setToolName(newName);
				saveToolConfig();
			}
			else {
				return;
			}
		}
		else {
			tool.setToolName(newName);
			saveToolConfig();
		}
		close();
	}
Calls a method in ToolManager to save the tool configuration to a
different name.
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialog.java