public void addSelectedTags() {
		if (function == null) {
			return;
		}

		Set<FunctionTag> selectedTags = getSelectedTags();
		for (FunctionTag tag : selectedTags) {

			// If the tag is one that has not yet been created (a temp tag), first create it,
			// then add it to the function.
			if (tag instanceof InMemoryFunctionTag) {
				Command<Program> cmd = new CreateFunctionTagCmd(tag.getName(), tag.getComment());
				tool.execute(cmd, program);
			}

			Command<Program> cmd = new AddFunctionTagCmd(tag.getName(), function.getEntryPoint());
			tool.execute(cmd, program);
		}
	}
Adds any selected tags to the function currently selected in the listing
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/tags/SourceTagsPanel.java