Eclipse RCP:在一个进度对话框中呈现并行作业?

发布于 2024-10-12 17:49:55 字数 447 浏览 6 评论 0原文

我想显示多个 作业 并行运行,但仅在一个进度对话框中运行。

但每次调用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苍风燃霜 2024-10-19 17:49:55

您是否尝试过使用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 年后的相关性如何。

本教程同时执行两个作业。

UIJobs

Eclipse 的好处是源代码很容易获得:)。只需破解进度视图源即可。本质上思路是一样的,你需要翻译的是 Progress View ->复合您的对话框 ->复合

希望这会有所帮助。

Have you tried using org.eclipse.ui.progress.UIJob. Checkout this link http://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.

UIJobs

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 to Your Dialog -> Composite.

Hope this will help.

一百个冬季 2024-10-19 17:49:55

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文