Problems with WorkspaceModifyOperation and IProgressService.run(...) [message #335509] |
Fri, 10 April 2009 19:13 |
Eclipse User |
|
|
|
Originally posted by: ofrijole.hotmail.com
I can't figure out how to use the progress monitor supplied to the
execute(...) method of a WorkspaceModifyOperation. For instance, when I
call monitor.worked(1) it doesn't do anything to the progress monitor
(which was launched using
PlatformUI.getWorkbench().getProgressService().run(...)). The monitor
appears to be wrapped and altered to the point that it doesn't seem to
respond to worked events.
Is it likely that I'm doing something wrong?
|
|
|
Re: Problems with WorkspaceModifyOperation and IProgressService.run(...) [message #335511 is a reply to message #335509] |
Fri, 10 April 2009 19:50 |
Eclipse User |
|
|
|
Originally posted by: ofrijole.hotmail.com
Well, I found the answer to my own question (had to dig through the code
in the debugger). The problem is that WorkspaceModifyOperation doesn't
pass the progress monitor (created by the progress service) cleanly
through. Instead, it wraps it in a customized SubProgressMonitor. If you
pass UNKNOWN when calling beginTask() within the
WorkspaceModifyOperation.execute(...) implementation, the monitor
silently accepts the argument but subsequent worked(int) calls have no
effect.
Unfortunately, I can't predict the amount of work in several cases, so
I'll have to find some solution other than using
WorkspaceModifyOperation to manage resource locking, etc.
|
|
|
Powered by
FUDForum. Page generated in 0.02454 seconds