My Job's Progress Bar Won't Go Away [message #508164] |
Sat, 16 January 2010 22:48 |
Scott Hamilton Messages: 5 Registered: January 2010 |
Junior Member |
|
|
This is my first plugin, so be gentle. I can't figure this out!
I have a task that the user initiates with a button on my plugin view. This task can take a while so I put it into a Job and schedule it for ASAP execution. If I use the IProgressMonitor given to my job's run() method such that in the run method I call monitor.beginTask(String,int) and then monitor.worked(1) for each unit of work done, then in a finally block call monitor.done(), MOST of the time the progress view's job will not only show up and grow the progress indicator bar across from left to right, but it will also:
1. Not move it to 100% but some percentage short (seems consistent how far it goes), and
2. Not remove the job from the progress view.
Debugging shows me that (a) no errors occur in my code, (b) I in fact DO call monitor.worked(1) the exact # of times that match the 2nd parameter to monitor.beginTask(), and (c) monitor.done() is definitely called.
AND... here's the really painful part: if I set a breakpoint on monitor.done(), then continue VM execution, the progress job disappears as it should.
So it seems like some kind of race condition perhaps, since when I trigger this breakpoint I'm stopping the job's thread but not all threads?
One last bit to throw into play: when the job thingie lingers, the cancel button in the progress window for this job is still red and active, and I can click it and the job disappears. So it is not like the progress monitor thinks the job is done and just waiting for me to dismiss it.
So... anyone know what is going on here?
I'm baffled!
(PS. if I stop using monitor.beginTask(), worked() and done() altogether, while I don't see the progress bar, the job DOES seem to go away when done pretty consistently.)
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03069 seconds