Many images leap out from the first two months of Donald Trump’s presidency, but one of the most vivid is that of the new President at his desk signing executive orders – with, by the way, a signature that deserves the close attention of graphologists. He signs these orders, one after another, like a practised potentate or, of more relevance, perhaps, like a company CEO whose writ runs the length and breadth of his commercial empire.

Those images seemed to say a lot about Trump, how used he was to exercising power and how he approached the job of President. But so did what came next. When his first attempt to prevent travellers from seven countries from entering the United States was struck down the appeal court, he expressed his frustration in his own inimitable way. But he did not – as widely predicted – rush to contest the ruling in the Supreme Court. He went back to his desk, took legal advice, had the original order redrafted, and signed the temporary travel ban mark II.

And this says something else about Trump. It says that he is not as impetuous as he might seem; that – for all the furious words – he is prepared to make adjustments to stay within the confines of the law, but also that he has to stay in power. Once he has set an objective, he will not be deterred. The President’s travel ban in some form may well reach the US Supreme Court – but not quite yet.

Donald Trump blast "judicial overreach" as Hawaii judge blocks travel ban

It is now the temporary travel ban mark II that is being tested. The latest version is clear in a way the first was not about the status of people with valid US entry documents and those en route when the ban comes into force. This addresses the specific point on which the first order was blocked: that it violated the rights of people “with valid residency papers and visas”. Other changes include the removal of Iraq from the list of countries, and the lifting of the blanket ban on Syrian refugees.

The central provisions, however, still stand: that people travelling from (now) six mainly Muslim countries will be subject to a 90-day ban from entering the United States, that a 120-day ban will apply to refugees, and that this is being done in the name of US national security, to strengthen its defences against terrorism.

This time around, the challenge has been led by Hawaii, which argued that relations with its Muslim population, its tourist industry and its ability to recruit foreign workers would all be damaged, and a federal judge there duly obliged. He blocked the order on Wednesday, just hours before it was due to come into force, arguing that a ban could violate the First Amendment of the US constitution (protection from religious discrimination) and that there was “a dearth of evidence” about any risk to national security.

Trump’s response was, as usual, hyperbolic: he called the ruling "unprecedented judicial overreach". But the judgment itself bore out strictures some lawyers had mooted last week, when Trump issued his new executive order. They estimated that the new version met many of the legal objections and that, if it had been presented originally, it might well have survived any court challenges. The problem was that the first order, and its rejection, had produced a history and a context which judges feel unable to ignore. And so it proved.

The Hawaii judgment went all the way back to earlier statements by Trump, including his call during the campaign for “a total and complete shutdown of Muslims entering the United States", and references to the travel ban as a “Muslim ban”. The Trump Justice Department presents it rather as an extension of the Obama administration’s introduction of stricter screening for those coming to the US from the six named countries – which means the fight will surely go on.

The next stage will be for the Administration to appeal – as it did with the first order, when it lost – and then, if it is rebuffed again, to take the case to the Supreme Court. With six other US states also mounting legal challenges to the new ban, the prospect is for protracted wrangling, not just through the courts, and for a lot more scolding and tweeting from the President.

But while there will doubtless be much complaining about the time and money squandered on the legal process, there are compelling reasons why this particular battle might be no bad thing, and could – perhaps should – be followed by others in response to Trump’s more contentious initiatives.

Donald Trump arrived at the White House with no conventional political experience – his outsider status being a selling point of his campaign – and his prolific use of executive orders, from Day One, gave the impression of a President ruling, essentially, by decree. What is happening now is precisely what should be happening: the powers of the executive, as exercised by an unconventional and untutored president, are being tested against the constraints set out in the US Constitution – those very checks and balances that every American learns about at school.

It might perhaps have been expected that the first challenges to Trump’s interpretation of his executive power would have come from the legislature. After all, Trump faces hostility from his own party, let alone from the defeated Democrats. So far, though, any Congressional revolt has been muted. It was individual states and the judiciary that rose up first, when they saw the practical and legal chaos created by the first travel ban. Their challenges demonstrated that in this instance, at least, the President could not both propose and dispose.

It was not just the states and the judiciary that acted as a restraint on an over–ambitious executive, however. Public opinion made itself felt, too – through the thousands of family, friends and campaigners who descended on the airports to protest and through the advisers and lawyers who offered their services pro bono. This was not all of American opinion, of course: Trump had his supporters, too – some of those same constituencies opposed to migration and concerned about security that had secured his victory last November.