| Summary: | ui.services has a dependency on SWT | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Thomas Schindl <tom.schindl> | ||||||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | ob1.eclipse | ||||||||
| Version: | 1.0 | ||||||||||
| Target Milestone: | 4.1 M6 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 319713 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Thomas Schindl
Created attachment 190057 [details]
patch
With the patch I am getting 120+ test failures when I run UIAllTests JUnits. Is it because Realm is not set in the context? I only know that the Workbench-Code sets a realm. I need to see why this fails. maybe the reason is that it is now asyncExec instead of syncExec. The change is the same we made in the DI-Code You replacing Display.getDefault().syncExec() with realm.exec() The realm.exec() translates into async call for non-UI thread. So, in practice, you are changing code to execute non-main thread calls as async calls. Correct. This is something i mentioned in the mail to e4-dev. I think what we should add is an abstraction for Display#syncExec/asyncExec because so this API is toolkit neutral. The API i have in mind is something like this:
interface UISync {
public void syncExec(Runnable runnable);
public void asyncExec(Runnable runnable);
}
Created attachment 190287 [details]
Abstracting sync/asynExec
This brings me down to on test failure but I doubt the failing test is because of this change
Created attachment 190288 [details]
now with all changes
Ok the test failure is expected and tracked in bug 333869 (In reply to comment #8) > Created attachment 190288 [details] > now with all changes Looks good! You might consider a few small adjustments: - UISynchronize: if we expect other people to implement this, better to make it an abstract class instead of an interface - more flexible - UISynchronize needs some Javadoc for the interface itself - UISynchronize implementation in the E4Application: I am not sure if it makes sense to put a guard on (display == null) in there. It is probably not possible to get to that place with null display today, but somehow I have a feeling that if the same code will be reached in a headless run, that might happen - Update years on copyright headers Done beside adding the null check which is impossible be null at this point |