问题
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