Difference between revisions of "FAQ How do I show progress on the workbench status line?"

From Eclipsepedia

Jump to: navigation, search
 
m
 
Line 1: Line 1:
The status line has two areas for showing progress.
+
The status line has two areas for showing progress. The status line manager has a progress monitor that can be used when you want to block the user from continuing to work during an operation.  This progress bar is used as follows:
The status line manager has a progress monitor that can be used  
+
when you want to block the user from continuing to
+
work during an operation.  This progress bar is used as follows:
+
 
<pre>
 
<pre>
 
   IActionBars bars = getViewSite().getActionBars();
 
   IActionBars bars = getViewSite().getActionBars();
Line 12: Line 9:
 
   pm.done();
 
   pm.done();
 
</pre>
 
</pre>
If the amount of work to be done can be estimated ahead of time, a more
+
If the amount of work to be done can be estimated ahead of time, a more intelligent value can be passed to <tt>beginTask</tt>, and calls to <tt>worked</tt> can be used to provide better progress feedback than a continuous animation.
intelligent value can be passed to <tt>beginTask</tt>, and calls to <tt>worked</tt>
+
can be used to provide better progress feedback than a continuous animation.
+
 
+
 
+
The far right-hand side of the status line is used to show progress for
+
things happening in the background.  In other words, when progress
+
is shown here, the user can generally continue working while the operation
+
runs.
+
  
 +
The far right-hand side of the status line is used to show progress for things happening in the background.  In other words, when progress is shown here, the user can generally continue working while the operation runs.
  
 
== See Also: ==
 
== See Also: ==
 +
*[[FAQ How do I use progress monitors?]]
 +
*[[FAQ Why should I use the new progress service?]]
 +
*[[FAQ How do I show progress for things happening in the background?]]
  
[[FAQ_How_do_I_use_progress_monitors%3F]]
+
{{Template:FAQ_Tagline}}
[[FAQ_Why_should_I_use_the_new_progress_service%3F]]
+
 
+
[[FAQ_How_do_I_show_progress_for_things_happening_in_the_background%3F]]
+
 
+
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
+

Latest revision as of 22:24, 26 June 2006

The status line has two areas for showing progress. The status line manager has a progress monitor that can be used when you want to block the user from continuing to work during an operation. This progress bar is used as follows:

   IActionBars bars = getViewSite().getActionBars();
   IStatusLineManager statusLine = bars.getStatusLineManager();
   IProgressMonitor pm = statusLine.getProgressMonitor();
   pm.beginTask("Doing work", IProgressMonitor.UNKNOWN);
   pm.worked(1);
   .... the actual work is done here...
   pm.done();

If the amount of work to be done can be estimated ahead of time, a more intelligent value can be passed to beginTask, and calls to worked can be used to provide better progress feedback than a continuous animation.

The far right-hand side of the status line is used to show progress for things happening in the background. In other words, when progress is shown here, the user can generally continue working while the operation runs.

[edit] See Also:


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.