org.netbeans.api.progress/1 1.5.22

org.netbeans.api.progress
Class ProgressHandle

java.lang.Object
  extended by org.netbeans.api.progress.ProgressHandle

public final class ProgressHandle
extends Object

Instances provided by the ProgressHandleFactory allow the users of the API to notify the progress bar UI about changes in the state of the running task. Progress component will be visualized only after one of the start() methods.


Method Summary
 void finish()
          finish the task, remove the task's component from the progress bar UI.
 void progress(int workunit)
          Notify the user about completed workunits.
 void progress(String message)
          Notify the user about progress by showing message with details.
 void progress(String message, int workunit)
          Notify the user about completed workunits and show additional detailed message.
 void setDisplayName(String newDisplayName)
          change the display name of the progress task.
 void setInitialDelay(int millis)
          allows to set a custom initial delay for the progress task to appear in the status bar.
 void start()
          start the progress indication for indeterminate task.
 void start(int workunits)
          start the progress indication for a task with known number of steps.
 void start(int workunits, long estimate)
          start the progress indication for a task with known number of steps and known time estimate for completing the task.
 void switchToDeterminate(int workunits)
          Currently indeterminate task can be switched to show percentage completed.
 void switchToDeterminate(int workunits, long estimate)
          Currently indeterminate task can be switched to show the time estimate til completion.
 void switchToIndeterminate()
          Currently determinate task (with percentage or time estimate) can be switched to indeterminate mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public void start()
start the progress indication for indeterminate task. it will be visualized by a progress bar in indeterminate mode.


start

public void start(int workunits)
start the progress indication for a task with known number of steps.

Parameters:
workunits - total number of workunits that will be processed

start

public void start(int workunits,
                  long estimate)
start the progress indication for a task with known number of steps and known time estimate for completing the task.

Parameters:
workunits - total number of workunits that will be processed
estimate - estimated time to process the task in seconds

switchToIndeterminate

public void switchToIndeterminate()
Currently determinate task (with percentage or time estimate) can be switched to indeterminate mode.


switchToDeterminate

public void switchToDeterminate(int workunits)
Currently indeterminate task can be switched to show percentage completed. A common usecase is to calculate the amount of work in the beginning showing in indeterminate mode and later switch to the progress with known steps


switchToDeterminate

public void switchToDeterminate(int workunits,
                                long estimate)
Currently indeterminate task can be switched to show the time estimate til completion. A common usecase is to calculate the amount of work in the beginning in indeterminate mode and later switch to the progress with the calculated estimate.


finish

public void finish()
finish the task, remove the task's component from the progress bar UI.


progress

public void progress(int workunit)
Notify the user about completed workunits.

Parameters:
workunit - a cumulative number of workunits completed so far

progress

public void progress(String message)
Notify the user about progress by showing message with details.

Parameters:
message - details about the status of the task

progress

public void progress(String message,
                     int workunit)
Notify the user about completed workunits and show additional detailed message.

Parameters:
message - details about the status of the task
workunit - a cumulative number of workunits completed so far

setInitialDelay

public void setInitialDelay(int millis)
allows to set a custom initial delay for the progress task to appear in the status bar. This delay marks the time between starting of the progress handle and it's appearance in the status bar. If it finishes earlier, it's not shown at all. There is a default < 1s value for this. If you want to to appear earlier or later, call this method with the value you prefer before starting the handle.

Progress bars that are placed in custom dialogs do always appear right away without a delay.

Parameters:
millis - amount of miliseconds that shall pass before the progress appears in status bar.

setDisplayName

public void setDisplayName(String newDisplayName)
change the display name of the progress task. Use with care, please make sure the changed name is not completely different, or otherwise it might appear to the user as a different task.

Since:
1.5

org.netbeans.api.progress/1 1.5.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.