I do not believe that Trump is typically joking when he says outrageous things; his (or his staff's) claiming in retrospect that "it was just a joke" is just a way of backing off from any tweet or utterance that proved too embarrassing or was too widely condemned. Some of Trump's outrageous statements may also be trial balloons, but I think most are simply the uncontrolled demented thoughts of a seriously disturbed individual. Someone with the mental and emotional status of a petulant 2 year old child.
Whatever the reason, the bottom line is this: even if he is joking, this is itself an outrageous and incredibly dangerous thing for the President of the USA to do. I don't mean jokes about the color of a reporter's shirt: Trump's supposed jokes include those that go to the core of the legitimacy of our Constitutional government, support violence against his political opponents, or directly relate to promises and interactions with foreign countries, etc. Not to mention incredibly disgusting personal insults against others. These should not be joking matters for someone representing the top office of the USA.