Search code examples
eclipseeclipse-rcpjobs

Eclipse Jobs stay in the Progress View after returning an OK status


I have a an Eclipse Job class similar to the following:

public class MyCustomJob extends Job {
   @Override
   protected IStatus run(IProgressMonitor monitor) {
      MyObject.blockingMethod();
      return Status.OK_STATUS;
   }
}

When I execute this job and it exits correctly, the bottom-right where the progress is listed while it is running still shows the name of the now completed job, but without any progress bar. Lingering Job name

If I double click in the region where the name of the job still is, the Progress View opens as expected, but shows that the job has finished. If I click the "x" to clear the job, it disappears from the view, but if I close the view and reopen it, it comes right back. Lingering job in Progress View

How can I remove the name of the job from the bottom-right of the display and guarantee that if I clear the Finished job from the Progress View that is actually being dismissed?


Solution

  • Check the return path for any async UI execs that could affect status. Changing from:

    Platform.getDefault().asyncExec(runnable)
    

    to

    Platform.getDefault().syncExec(runnable)
    

    fixed this issue