ragz
ragz

Reputation: 87

Show progress bar for a background Operation

Im new to eclipse rcp.

Context:

Im performing a login operation using eclipse rcp, i'v cretead a view which accepts username and password from the user and when user clicks on Login Button the code checks against the database and if valid a new view is shown to the User else shows error invalid login.

So here in the above i desperately wanted to show a progress bar(that waits for sometime) while its checking against the database in the background.

can i know how to achieve that ?

Upvotes: 3

Views: 4063

Answers (2)

To Kra
To Kra

Reputation: 3578

If you are using Eclipse RCP based application, then you can even implement your "Operation" as extending "org.eclipse.core.runtime.jobs.Job". Your app ApplicationWorkbenchWindowAdvisor has to have set in preWindowOpen(): configurer.setShowProgressIndicator(true);

After your JOB is started is automatically shown down there in progress.

You can even add progressView via Extension to your app, and when you click down there on progress your operation pops up in ProgressView where you can even cancel :)

Hope it helped.

Upvotes: 2

Sandman
Sandman

Reputation: 9692

You can use ProgressMonitorDialog to achieve what you want. Here's a tutorial on how to use it.

Upvotes: 4

Related Questions