Thanks for feedback, can you elaborate more on why the resulting implementation is a no-no for you?
For example, I am told that the code will throw some magical exception that I may not catch or it will break continuations. The whole concept of continuations twisted the accepted workings of Threads. It's a non-standard concept as you pointed out.
The other way would be to have modal dialogs non-blocking and you would have to register to some event (which happens under the hood with continations usage). This would make the handlers using modal dialogs very fragmented IMHO.
I suggest introducing the usage of Future and CompletionHandler instead. This will allow users to write sequential use-cases as you described without the kind of "magic" introduced by continuations. For code:
1 2 3 4 5
| Future<?> f = fireSwingEvent(); f.get(); f = fireAnotherSwingEvent(); f.get();
|
This is essentially what you're doing with continuations but it's a lot more explicit and is still quite readable.
Gili