开发者

eclipse progress bar

开发者 https://www.devze.com 2022-12-25 13:21 出处:网络
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, than

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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号