@Override
	protected void okCallback() {
		Program program = programActionContext.getProgram();
		ProgramLocation loc = programActionContext.getLocation();
		OperandFieldLocation location = (OperandFieldLocation) loc;
		Symbol sym = getSymbol(programActionContext);
		String currentLabel = myChoice.getText();
		if (currentLabel.equals(sym.getName(true))) {
			close();
			return;
		}

		ReferenceManager refMgr = program.getReferenceManager();
		SymbolTable symTable = program.getSymbolTable();
		int opIndex = location.getOperandIndex();
		Address addr = location.getAddress();
		Address symAddr = sym.getAddress();
		Reference ref = refMgr.getReference(addr, symAddr, opIndex);

		CompoundCmd<Program> cmd = new CompoundCmd<>("Set Label");
		Namespace scope = null;

		Symbol newSym = findSymbol(symTable, currentLabel, symAddr);
		if (newSym == null) {
			cmd.add(new AddLabelCmd(symAddr, currentLabel, SourceType.USER_DEFINED));
		}
		else {
			scope = newSym.getParentNamespace();
			currentLabel = newSym.getName();
		}
		cmd.add(new AssociateSymbolCmd(ref, currentLabel, scope));

		if (!plugin.getTool().execute(cmd, program)) {
			setStatusText(cmd.getStatusMsg());
			return;
		}
		close();

	}
This method gets called when the user clicks on the Ok Button.  The base
class calls this method.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/label/OperandLabelDialog.java