【问题标题】:Eclipse Job disable cancel buttonEclipse Job 禁用取消按钮
【发布时间】:2016-07-09 19:51:17
【问题描述】:

是否可以禁用进度对话框中的“取消”按钮 作业运行时显示? 我仍然想保持向用户显示后台工作进度的功能。让作业运行或 取消它对 GUI 没有影响,因为它会在远程启动任务 服务器,一旦启动,不支持取消/停止任务。

我不能使用setSystem(true),因为我想向用户显示进度。

即使在 Eclipse Bugzilla 中也有错误报告,但没有任何更新 https://bugs.eclipse.org/bugs/show_bug.cgi?id=155479

试图确定此问题是否已解决。 如果不是,我们如何处理这种情况。

任何帮助表示赞赏。谢谢。

【问题讨论】:

    标签: eclipse rcp jobs


    【解决方案1】:

    该错误仍然存​​在,尚未修复。

    我认为最接近的方法是使用ProgressMonitorDialog 运行IRunnableWithProgress 课程。可以设置ProgressMonitorDialog的可取消状态。

    类似:

    ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
    
    dialog.setCancelable(false);
    
    dialog.run(true, true, runnableWithProgress);
    

    【讨论】:

    • 我确实尝试过使用 ProgressMonitorDialog 但得到了SWT no more handle 异常,因为我的 rcp 有许多后台作业正在运行,并且当我们打开 ProgressMonitorDialog 时没有可用的资源。我正在使用 Job 来启动嵌入式服务器并使用 HTML 文件加载 SWT 浏览器。有没有其他方法可以避免这种情况??
    猜你喜欢
    • 2011-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多