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();
}
});
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.
精彩评论