On Mon, Jan 12, 2009 at 2:13 PM, Kelly Norton <knor...@google.com> wrote: > We actually have it, it's called DeferredCommand. Unfortunately, we let its > implementation get too gangled up with another feature called > IncrementalCommand and use of DeferredCommand now generates way too much > code. Many developers still use DeferredCommand when wanting to invokeLater.
I was thinking of DeferredCommand, and using it as a way to get invokeLater. However, I am pretty sure we don't currently have what I am asking for. Using a DeferredCommand boils down to a Timer, which uses setTimeout. Thus, a minimum-duration DeferredCommand should happen one time tick later and after a repaint of the browser window. I'm getting the impression that a 0-length timer is strongly ingrained for AJAX programmers to mean wait for a minimum time tick. If so, then invokeLater should be a separate mechanism unrelated to Timers. Any opinions on where in the GWT library to add an invokeLater method? Perhaps invokeLater could be a static method in DeferredCommand, and runInvokeLaterCommands would be a default-access static method in the same? Every place in GWT that installs a global event handler should also call runInvokeLaterCommands. In addition, there could be a periodic timer that calls runInvokeLaterCommands, to catch any cases that were missed. To make it easy to not miss these cases, we could add GWT.runGwtCode(Command), which is intended to be used by all entry points from the browser into GWT code. GWT.runGwtCode would take care of both the global exception handler and calling runInvokeLaterCommands. -Lex --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---