Eclipse RCP:在一个进度对话框中呈现并行作业?
我想显示多个 作业 并行运行,但仅在一个进度对话框中运行。
但每次调用 Job.setUser() 似乎都会产生一个新的进度对话框。
我尝试过:
- 在所有作业上设置一个通用进度组(通过 IJobManager.createProgressGroup() 获得)。
- 让一个父作业调用 setUser() 并加入所有并行作业所属的作业族。 (这会导致一条消息,表明父作业的进度被后台任务阻止。)
我可以遵循什么模式来使所有并行作业出现在一个进度对话框中?
I would like to show progress of multiple Jobs running in parallel, but in only one progress dialog.
But each call to Job.setUser() seems to result in a new progress dialog.
I've tried:
- Setting a common progress group on all the jobs (obtained via IJobManager.createProgressGroup()).
- Having one parent job call setUser() and join a job family to which all the parallel jobs belong. (This results in a message that progress is blocked on the parent job, by the background tasks.)
What pattern can I follow to result in all the parallel jobs appearing in one progress dialog?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过使用
org.eclipse.ui.progress.UIJob
。查看此链接http://www.jdg2e.com/ch29。 jobs/doc/index.html.https://web.archive.org/web/20090406175007/http://www.jdg2e.com:80/ 看到页面底部的下载链接,虽然我不是确定该解决方案在 6 年后的相关性如何。本教程同时执行两个作业。
Eclipse 的好处是源代码很容易获得:)。只需破解进度视图源即可。本质上思路是一样的,你需要翻译的是
Progress View ->复合
到您的对话框 ->复合
。希望这会有所帮助。
Have you tried using
org.eclipse.ui.progress.UIJob
. Checkout this linkhttp://www.jdg2e.com/ch29.jobs/doc/index.html.https://web.archive.org/web/20090406175007/http://www.jdg2e.com:80/ see the download link at the bottom of the page, though I am not sure how relevant the solution is after 6 years.The tutorial executes two jobs simultaneously.
The good thing about eclipse is that the source code is readily available :) . Just hack through the progress view source. Essentially the idea is same, what you need to translate is
Progress View -> Composite
toYour Dialog -> Composite
.Hope this will help.
ProgressMonitorFocusJobDialog 只能显示一项作业的进度。如果您需要显示多个作业的进度,那么进度视图就是您的答案。如果用户单击“在后台运行”复选框,该对话框将消失
The ProgressMonitorFocusJobDialog can show the progress of only one job. If you need to show progress of multiple jobs, then Progress View is your answer. The dialog will go away if the user clicks the "Run in background" checkbox