org.netbeans.api.progress/1 1.10.1 1

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)
          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 suspend(String message)
          Currently running task can switch to silent suspend mode where the progress bar stops moving, hides completely or partially.
 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.


suspend

public void suspend(String message)
Currently running task can switch to silent suspend mode where the progress bar stops moving, hides completely or partially. Useful to make progress in status bar less intrusive for very long running tasks, eg. running an ant script that executes user application, debugs user application etc. Any incoming progress wakes up the progress bar to previous state.

Parameters:
message - a message to display in the silent mode
Since:
org.netbeans.api.progress/1 1.9

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

Parameters:
workunits - a definite number of complete units of work out of the total

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.

Parameters:
workunits - a definite number of complete units of work out of the total
estimate - estimated time to process the task, in seconds

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)
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 its 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 it to appear earlier or later, call this method with the value you prefer before starting the handle. (Has no effect if called after the handle is started.)

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

Parameters:
millis - number of miliseconds to wait before the progress appears in status bar.
Since:
org.netbeans.api.progress/1 1.2

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.

Parameters:
newDisplayName - a new name to set for the task
Since:
org.netbeans.api.progress 1.5

org.netbeans.api.progress/1 1.10.1 1

Built on January 29 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.