简体   繁体   English

如何在Eclipse向导页面中获取ProgressBar?

[英]How to get a ProgressBar in an Eclipse Wizard page?

I am developing wizard pages. 我正在开发向导页面。 In one wizard page there will conversion of files from one framework to other framework will be performed which takes lot of time. 在一个向导页面中,将执行文件从一种框架到另一种框架的转换,这需要很多时间。 So I want to use a ProgressBar on this page. 所以我想在此页面上使用ProgressBar

How can I do it? 我该怎么做?

Note: I am using SWT, I am not using JFace. 注意:我使用的是SWT,而不是JFace。

You can't access progress bar directly, but you can execute a long running process in the context of the wizard dialog and update progress via progress monitor . 您不能直接访问进度栏,但是可以在向导对话框的上下文中执行长时间运行的进程,并通过进度监视器更新进度。

IWizardPage page = ...;
IRunnableWithProgress runnable = new IRunnableWithProgress() {
    public void run(IProgressMonitor monitor) {
        monitor.beginTask("Working on 100 units", 100);
        ...
    }
};
page.getWizard().getContainer().run(true, true, runnable);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM