Eclispe does not show progress bar of user threads

浪尽此生 提交于 2020-01-03 02:33:05

问题


I created some user jobs on start-up of eclipse, but after launching the workbench I am not able to see the progress bar. Is there anywhere I have to mention these threads other than making them user threads?

protected IStatus run(IProgressMonitor monitor) {
    monitor.beginTask("Download", -1);
    for (ProxyBean network : ProxyBean.get()) {
        // do something
    }
    monitor.done();
    return Status.OK_STATUS;
}

I initialize it in this way:

job = new MyJob();
job.setUser(true);
job.schedule();`

回答1:


Check whether you are applying it on correct shell, or the execution time of job is too low so that you can not see the progress bar..

You can also use:

// Update the user interface asynchronously
Display.getDefault().asyncExec(new Runnable() {
  public void run() {
    // ... do any work that updates the screen ...
  }
});


来源:https://stackoverflow.com/questions/19325603/eclispe-does-not-show-progress-bar-of-user-threads

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!