Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370219

Summary: Selection service could use an ability to pause dependency recording
Product: [Eclipse Project] Platform Reporter: Oleg Besedin <ob1.eclipse>
Component: UIAssignee: Oleg Besedin <ob1.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ob1.eclipse, pwebster, remy.suen, tjwatson
Version: 4.2   
Target Milestone: 4.2 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Oleg Besedin CLA 2012-01-31 09:48:52 EST
Some Run-and-Tracks might benefit from an ability to stop & resume dependency recording, for instance, when calling 3rd party code such as listeners.

In particular, selection service uses async calls to work around this issue which changes expected behavior.

I'll add the following methods to RunAndTrack:
	pauseRecording()
	resumeRecoding()

to provide this functionality and will update selection service to use it.
Comment 2 Oleg Besedin CLA 2012-01-31 10:07:36 EST
.
Comment 3 Remy Suen CLA 2012-01-31 10:18:15 EST
With these new methods we can probably rewrite UpdateExpression to not dispatch its calls asynchronously?
Comment 4 Oleg Besedin CLA 2012-01-31 10:38:10 EST
(In reply to comment #3)
> With these new methods we can probably rewrite UpdateExpression to not dispatch
> its calls asynchronously?

Seems like a good idea, I'll reopen bug bug 347140.
Comment 5 Oleg Besedin CLA 2012-02-01 11:59:00 EST
It seems that I need to make the pair of calls safer: the number of "pause" requests must match with the number of "resume" requests.

The simplest way to do that seems to be providing one method on RunAndTrack:

   runExternalCode(Runnable runnable)

instead of pauseRecording() and resumeRecoding() pair of methods.

That would ensure that we get exactly one "pause" and one "resume" request.

Runtime change:
http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=1634731aa1325e5c90be3be2b08384414b77f77e

I also updated SelectionAggregator.
Comment 6 Remy Suen CLA 2012-02-02 16:00:18 EST
*** Bug 370490 has been marked as a duplicate of this bug. ***
Comment 7 Oleg Besedin CLA 2012-03-13 13:47:27 EDT
Verified that code is present in the I20120313-0610.