views:

299

answers:

2

Hi!

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();
        }
    });
A: 

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

Zoltán Ujhelyi
+1  A: 

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

Prakash G. R.