如何设置ProgressMonitorDialog的标题

时间:2014-01-08 08:37:52

标签: java eclipse-rcp rcp

我正在使用ProgressMonitorDialog显示长时间运行进程的进度对话框。

Shell shell = HandlerUtil.getActiveWorkbenchWindow(event).getShell();
shell.setText("HTML result loading");
shell.update();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
dialog.setCancelable(true);
dialog.run(true, true, new IRunnableWithProgress() {
    @Override
    public void run(IProgressMonitor monitor) throws InterruptedException {
        monitor.beginTask(ResourceAssistant.getString(ViewAsHTML.class, "loadingHTMLResults"), //$NON-NLS-1$
                IProgressMonitor.UNKNOWN);
        while (!thread.getState().equals(Thread.State.TERMINATED)) {
            if (monitor.isCanceled()) {
                setCanceled(true);
                break;
            }
        }
        monitor.done();
    }
});

我想更改进度对话框的标题。默认情况下,它显示为“进度信息”。我怎么能改变这个。任何想法。

1 个答案:

答案 0 :(得分:6)

标题是在您可以覆盖的configureShell方法中设置的:

protected void configureShell(final Shell shell)
{
  super.configureShell(shell);

  shell.setText("your title");
}