Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357777 - UIProcess should have change listener support
Summary: UIProcess should have change listener support
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: Look And Feel (show other bugs)
Version: 4.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 06:52 EDT by Christian Campo CLA
Modified: 2012-05-25 09:21 EDT (History)
1 user (show)

See Also:


Attachments
proof of concept but not code to be committed (6.81 KB, patch)
2011-09-15 06:55 EDT, Christian Campo CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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() { ... }

});