org.netbeans.api.progress/1 1.32.1

org.netbeans.api.progress.aggregate
Class AggregateProgressHandle

java.lang.Object
  extended by org.netbeans.api.progress.aggregate.AggregateProgressHandle

public final class AggregateProgressHandle
extends Object

a progress handle that allows aggregation of progress indication from multiple independant sources. All of the progress contributors are considered equal and are given equal share of the global progress. The task progress contributors can be added dynamically and the progress bar adjusts accordingly, never stepping back though. For a more simple version of progress indication, see ProgressHandle


Method Summary
 void addContributor(ProgressContributor contributor)
          add a contributor to the global, aggregated progress.
 void finish()
          finish the task, remove the task's component from the progress bar UI, any additional incoming events from the contributors will be ignored.
 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 setMonitor(ProgressMonitor monitor)
          allow to watch the incoming events from the individual progress contributors.
 void start()
          start the progress indication for the task, shows the progress in the UI, events from the contributors are expected after this call.
 void start(long estimate)
          start the progress indication for the task with an initial time estimate, shows the progress in the UI, events from the contributors are expected after this call.
 void suspend(String message)
          Currently running task can switch to silent suspend mode where the progress bar stops moving, hides completely or partially.
 
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 the task, shows the progress in the UI, events from the contributors are expected after this call.


start

public void start(long estimate)
start the progress indication for the task with an initial time estimate, shows the progress in the UI, events from the contributors are expected after this call.

Parameters:
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, any additional incoming events from the contributors will be ignored.


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.10

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.

addContributor

public void addContributor(ProgressContributor contributor)
add a contributor to the global, aggregated progress. Adding makes sense only if the task is still in progress.


setMonitor

public void setMonitor(ProgressMonitor monitor)
allow to watch the incoming events from the individual progress contributors.


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.32.1

Built on February 14 2013.  |  Portions Copyright 1997-2013 Oracle. All rights reserved.