@Override
	public void actionPerformed(ListingActionContext context) {
		ProgramLocation loc = context.getLocation();
		Program program = context.getProgram();
		if (loc instanceof FunctionSignatureFieldLocation) {
			Function function = functionPlugin.getFunction(context);
			if (function != null) {
				AddEditDialog dialog =
					new AddEditDialog("Edit Function Name", functionPlugin.getTool());
				dialog.editLabel(function.getSymbol(), program);
			}
		}
		else if (loc instanceof VariableLocation) {
			Variable variable = ((VariableLocation) loc).getVariable();
			Symbol s = variable.getSymbol();
			if (s == null) {
				Msg.showError(this, null, "Edit Failed", "Variable may not be modified");
				return;
			}
			AddEditDialog dialog =
				new AddEditDialog("Edit Variable Name", functionPlugin.getTool());
			dialog.editLabel(s, program);
		}
		else if (loc instanceof OperandFieldLocation) {
			Function function =
				functionPlugin.getFunctionInOperandField(program, (OperandFieldLocation) loc);
			if (function != null) {
				while (function.isThunk() &&
					function.getSymbol().getSource() == SourceType.DEFAULT) {
					// find source of thunk function label
					function = function.getThunkedFunction(false);
				}
				AddEditDialog dialog =
					new AddEditDialog("Edit Function Name", functionPlugin.getTool());
				dialog.editLabel(function.getSymbol(), program);
			}
		}
	}
the plugin associated with this action.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditNameAction.java