I was pretty annoyed to find that GWT's IncrementalCommand class was essentially atomic, when I tried to have an "operation in progress" style dialog that allowed it to be cancelled the event loop wasn't given enough breathing room to actually render the full animation of creating the dialog, let alone allow the user to click the Cancel button.
I think a better solution is to subclass (or in this case create an anonymous subclass) the normal Command class and then add your own incrementality by having it add itself to the end of the DeferredCommand queue until it is done:
Command ic = new Command()
{
public void execute()
{
if (doWork())
{
DeferredCommand.addPause();
DeferredCommand.addCommand(this);
}
}
};
DeferredCommand.addPause();
DeferredCommand.addCommand(ic);
Where doWork() has the same semantics as IncrementalCommand's execute(): return true is there's more work to do, false if not.