ProgressIndicator Problem [message #128917] |
Mon, 20 April 2009 14:43 |
Vaughn Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Hi,
I have a background Job that is created using a
IWorkbenchSiteProgressService for a view. When the job is run, it shows
the running animation and job name in the ProgressIndicator. When it
completes, the animation goes away and the text remains, sometimes showing
100%, sometimes showing a different percentage. It appears as though it's
not completing a final update of some sort.
Does anyone have a workaround or some other suggestion?
An example snippet is as follows:
IWorkbenchSiteProgressService ps = (IWorkbenchSiteProgressService)
getViewSite()
.getAdapter(IWorkbenchSiteProgressService.class);
Job job = new Job("Retrieving info from server") {
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Retrieving records", 100);
for (int i = 0; i < 100; i++)
monitor.worked(1);
try {
// Simulate work being done
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
monitor.done();
return Status.OK_STATUS;
}
};
ps.schedule(job, 0, true);
Thanks,
Vaughn
|
|
|
Re: ProgressIndicator Problem [message #129126 is a reply to message #128917] |
Tue, 21 April 2009 11:06 |
|
Hi Vaughn,
this sounds like a bug to me. Could you open up a bug report and include
your snippet and maybe a screenshot of the remaining text?
http://wiki.eclipse.org/RAP_Bug_Reporting_Howto
Thanks, Ralf
> I have a background Job that is created using a
> IWorkbenchSiteProgressService for a view. When the job is run, it shows
> the running animation and job name in the ProgressIndicator. When it
> completes, the animation goes away and the text remains, sometimes
> showing 100%, sometimes showing a different percentage. It appears as
> though it's not completing a final update of some sort.
>
> Does anyone have a workaround or some other suggestion?
>
> An example snippet is as follows:
>
> IWorkbenchSiteProgressService ps = (IWorkbenchSiteProgressService)
> getViewSite()
> .getAdapter(IWorkbenchSiteProgressService.class);
> Job job = new Job("Retrieving info from server") {
> protected IStatus run(IProgressMonitor monitor) {
> monitor.beginTask("Retrieving records", 100);
> for (int i = 0; i < 100; i++)
> monitor.worked(1);
> try {
> // Simulate work being done
> Thread.sleep(500);
> } catch (InterruptedException e) {
> e.printStackTrace();
> }
> }
>
> monitor.done();
> return Status.OK_STATUS;
> }
> };
> ps.schedule(job, 0, true);
>
> Thanks,
> Vaughn
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03125 seconds