I’ve got several requests to implement timer functionality in TaskDialog commands. The latest code drop contains requested changes. This is a preliminary design and I invite a discussion on implementation which would cover the most common use cases.
Here are the main points of current implementation:
TaskDialog.Command interface now includes getWaitInterval function which should return required wait interval in seconds.
TaskDialog.StandardCommand by default returns 0, but includes new variant of the derive function with additional waitInterval parameter. This allows for adding custom commands with specified wait interval.
How would we do it with our very convenient methods from TaskDialogs class? By passing special commands with instruction text. Following will show a warning dialog with wait interval of 10 seconds.
TaskDialogs.warn( "Are you sure you want to quit?@@10", "Please do not quit yet!");
As always… Your comments and suggestions are welcome 🙂
The project is available at http://code.google.com/p/oxbow under BSD license.