Dave
Dave

Reputation: 1

eclipse progress bar

I develop an eclipse plugin and I want to create an progress bar as eclipse view at bottom of the workbench window. I have an example, but this is showed only a moment. Please give me some ideas, thanks

  ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
    dialog.run(true, true, new IRunnableWithProgress(){
        public void run(IProgressMonitor monitor) {
            monitor.beginTask("Some nice progress message here ...", 100);
            // execute the task ...
            monitor.done();
        }
    });

Upvotes: 0

Views: 4291

Answers (2)

Prakash G. R.
Prakash G. R.

Reputation: 4892

You are using a ProgressMonitorDialog - which will open up a dialog. If you want the bar to appear in the Progress View- use a Job. Or if you want to show the progress in the status bar of the workbench window, use IWorkbenchWindow.run().

See more uses of Progress Bar here: http://eclipse-tips.com/index.php/how-to-guides/4-progress-bars-in-eclipse-ui

Upvotes: 9

Zoltán Ujhelyi
Zoltán Ujhelyi

Reputation: 13858

Stupid question: doesn't the task execution finish too early? When execution finishes, the progress monitor disappears.

Upvotes: -2

Related Questions