Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » My Job's Progress Bar Won't Go Away
My Job's Progress Bar Won't Go Away [message #604201] Sat, 16 January 2010 22:49 Go to next message
Scott Hamilton is currently offline Scott HamiltonFriend
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.)
Re: My Job's Progress Bar Won't Go Away [message #604227 is a reply to message #604201] Mon, 18 January 2010 05:22 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 17/01/10 4:19 AM, Scott Hamilton wrote:
> 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.

What you have done seems to be right. Can you attach a sample code to
reproduce it?

- Prakash
Platform UI Team, IBM

Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
Previous Topic:API Tools - No warnings/errors when changing API
Next Topic:plugin with POI
Goto Forum:
  


Current Time: Thu Dec 18 10:46:35 GMT 2014

Powered by FUDForum. Page generated in 0.03445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software