private void renameEquateForCodeUnit(ListingActionContext context, Enum enoom, Equate equate,
			String newName, String oldName, CompoundBackgroundCommand<Program> bgCmd, CodeUnit cu) {

		if (cu instanceof Instruction) {

			Instruction inst = (Instruction) cu;
			Program program = context.getProgram();
			List<Integer> opIndices = getInstructionMatches(program, inst, equate);
			Address addr = inst.getAddress();
			for (Integer opIndice : opIndices) {
				bgCmd.add(createRenameCmd(enoom, oldName, newName, addr, opIndice));
			}
		}
		else if (cu instanceof Data) {

			Data data = (Data) cu;
			if (isDataMatch(data, context, equate)) {
				Address addr = data.getAddress();
				bgCmd.add(createRenameCmd(enoom, oldName, newName, addr, getOperandIndex(context)));
			}
		}
	}
Called in response to the user selecting the Apply Enum action from the popup menu. This
action will apply enum values to scalars in a selection.
@param context the action context
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/EquatePlugin.java