fengye87
fengye87

Reputation: 2553

Eclipse RCP e4: how to add a progress bar with unknown work load

I want to add a progressbar to my RCP e4 application that only indicates that some bg-work is running. No progress report needed, just a rolling bar like below:

enter image description here

My question is how to do that? Do I need to implement this control myself? Thanks a lot!

Upvotes: 1

Views: 1704

Answers (1)

greg-449
greg-449

Reputation: 111217

At the lowest level you can use the SWT ProgressBar control with the SWT.INDETERMINATE flag.

JFace extends this with the ProgressIndicator class which supports both determinate and indeterminate bars. It extends this further with the ProgressMonitorPart which provides a cancel button and implements the IProgressMonitorWithBlocking interface.

If you are using Job in e4 you need to hook up the UI progress bar to the job manager by setting the progress provider using:

Job.getJobManager().setProgressProvider(provider);

where provider is a class extending ProgressProvider. This class provides the job system with the progress monitor to use when jobs are running. This can be based on a ProgressMonitorPart.

Upvotes: 2

Related Questions