Community
Participate
Working Groups
... because of this dependency ui.workbench gets a dependency on swt which is incorrect and violates our Framework design. The suggested fix is the same we made to in bug 322226 by makeing use of the Databinding-Realm.
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