FAQ How do I show progress on the workbench status line?
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.
- 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?
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.