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

Bug 357777

Summary: UIProcess should have change listener support
Product: [RT] Riena Reporter: Christian Campo <christian.campo>
Component: Look And FeelAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: nobody
Version: 4.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proof of concept but not code to be committed none

Description Christian Campo CLA 2011-09-15 06:52:56 EDT
UIProcess is an extension to the Jobs API of Eclipse. However it is missing the IJobChangeListener equivalent that the Jobs API offers. In this usecase we were looking for a way to offer a method in the SubModuleController called "loadDataForViewInUIProcess" that would return for each controller the instance of a started UIProcess. The superclasses monitors through the new change listener the UIProcess and only when its finished, does it unblock the view.
The submoduleController could also make sure that "loadDataForViewInUIProcess" is not called multiple times.
Comment 1 Christian Campo CLA 2011-09-15 06:55:40 EDT
Created attachment 203401 [details]
proof of concept but not code to be committed

This code was create by Heiko Barth and is not intended to be committed into CVS. It shows an idea on how to address the problem with the SubModuleController which lead to the discussion that the best solution is a IUIProcessChangeListener
Comment 2 Nobody - feel free to take it CLA 2012-05-25 07:32:53 EDT
Fixed and pushed

Usage:

UIProcess p = new UIProcess(...);
p..addUIProcessChangedListener(new IUIProcessChangeListener() {

  public void onInitialUpdateUI(final int totalWork) { ... }
  public void onFinalUpdateUI() { ... }

});
Comment 3 Nobody - feel free to take it CLA 2012-05-25 07:50:00 EDT
Reopening since a predictable execution order is desired. The IUIProcessChangeListeners should be called _after_ the UIProcess.initialUpdateUI() method.
Comment 4 Nobody - feel free to take it CLA 2012-05-25 09:21:04 EDT
The IUIProcessChangeListener will be always called after the methods UIProcess.initialUpdateUI() and UIProcess.finalUpdateUI()

Usage:

UIProcess p = new UIProcess(...);
p..addUIProcessChangedListener(new IUIProcessChangeListener() {

  public void afterInitialUpdateUI(final int totalWork) { ... }
  public void afterFinalUpdateUI() { ... }

});