lunes, 6 de febrero de 2012

The Endless Progress Bar/Indicator

One of the most complete posts I've seen about the Progress Bar/Indicator is by that of mfp.  One tidbit of useful information we can glean from the text is that by not setting the total setTotal(...) number of iterations we won't see the progress from 0 to X but still have the animation for the user to 'enjoy' watching.  Sometimes we neither know nor care for the percentage of completion of our task.
If you do not specify the total, the progress indicator and the time remaining will not be shown.
We therefore can exclude the incCount() call as well:
    SysOperationProgress  progress = new SysOperationProgress();
    int k;
    progress.setCaption('@SYS8516'); //Updating...

    // It'll be 10 passes today, 2 million in the production environment!
    for (k=0; k<10; k++) {
        progress.setText( strfmt("Update step %1", k+1) );

No hay comentarios:

Publicar un comentario