Look I understand that it's not the best approach and of course is a player swore at a ref he'd be in trouble, but even that would depend on the context.
In this situation you have a player that had far too much to say for himself (not necessarily at me) and he was causing issues for everyone, i'd asked him to keep it down, but he'd continued to have too much to say and it was having an effect on the game, so he got the "XXXX will you just shut the fcuk up" he did! "well said sir" came the call from a number of the opposition and even one of his own players, it got a giggle and everyone got on with the game.
I did apologise to him after the game, his response, "to be fair, I deserved it!"
If as a ref I was reffing a game sooooo badly that a player told me to "shut the fcuk up", he/she might well be in trouble but so would I for having such a poor game!