private Variable getVariable(ListingActionContext context) {
		if (context.hasSelection() || context.getAddress() == null) {
			return null;
		}
		ProgramLocation loc = context.getLocation();
		Program program = context.getProgram();
		if (!(loc instanceof OperandFieldLocation)) {
			return null;
		}
		OperandFieldLocation oloc = (OperandFieldLocation) loc;
		Instruction inst = program.getListing().getInstructionAt(oloc.getAddress());
		if (inst != null) {
			VariableOffset variableOffset = oloc.getVariableOffset();
			if (variableOffset != null) {
				return variableOffset.getVariable();
			}
		}
		return null;
	}
Creates a new action with the given name and associated to the given
plugin.
@param plugin the plugin this action is associated with.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditOperandNameAction.java