Community
Participate
Working Groups
When scheduling a SynchronizeQueryJob from a UI component, such as a report, view, etc. there is no existing API available to access the progress of this synchronization which is relevant to the report, view, etc. It would be helpful if SynchronizeQueryJob (and other sync jobs) had API to access the progress monitor of the job. This way the view or page owner could report the progress to the user.
Here is a proposal for a solution: * Create a DelegatingProgressMonitor with the following interface: /** Delegates to all attached monitors. */ IDelegatingProgressMonitor extends IProgressMonitor { /** Reporting progress to this monitor. */ void attach(IProgressMonitor); } * Create a delegating progress monitor in the constructor of TaskSubmitJob and set the monitor that is passed to run() as the master. * All progress reporting in the job needs to be passed to the delegating monitor
Created attachment 134908 [details] patch The implementation does not currently handle the case when a progress monitor is attached after the job has already been started, i.e. some recording of past events would be necessary in order to provide accurate progress reporting and messaging.
Created attachment 134909 [details] mylyn/context/zip
This patch contains your patch + some recording of past events and setting them on a newly attached monitor. Not sure if that's all this implementation needs (if so, thanks for doing all the work). Also, not too certain about the internalWorked, but I think it should be set and set before the worked is set...
Tried the patch in my current scenario and it seems to work fine for me.
Created attachment 136563 [details] patch Sorry for the delay, it seems I forgot to actually attach the patch for keeping the state consistent for all monitors...here it is.
Created attachment 136564 [details] mylyn/context/zip
Thanks Thomas. I have applied the patch with minor modifications: attach now invokes done() last and IDelegatingProgressMonitor supports detaching of listening progress monitors.