Community
Participate
Working Groups
Display a/syncExec method require runnable. However, there can be numerous cases where we're using it to retrieve some UI values. In such case, it would be great to have the methods taking as input a Supplier to let it return a typed object.
Can you give a sample snippet how do you imagine it ?
From non-UI Thred: Color backgroundColor = control.getDisplay().asyncExec(() -> control.getBackground());
(In reply to Mickael Istria from comment #2) > From non-UI Thred: Color backgroundColor = control.getDisplay().asyncExec(() > -> control.getBackground()); Not sure I can follow. If it waits here and get a Color, it is not an asyncExec(). Or it gets a Future<Color>, but then it needs to call future.get() for the Color and will be again not async.
The Display.syncExec(Supplier<T>) should return a T The Display.asyncExec(Supplier<T>) should return a CompletableFuture<T>