Summary: | [Databinding] Support for CompletableFuture | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> |
Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | jens, Lars.Vogel |
Version: | 4.16 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 10 | ||
Whiteboard: |
Description
Lars Vogel
2020-09-02 04:32:02 EDT
Jens, WDYT? (In reply to Lars Vogel from comment #1) > Jens, WDYT? It sound like an interesting idea! I don't understand exactly what you're thinking. To have a CompletableFuture value propagated to the databinding framework I guess you have to do something like this today: IObservableValue<String> o = new WritableValue<>(); CompletableFuture<String> f = new CompletableFuture<>(); f.whenComplete((s, exc) -> { o.getRealm().asyncExec(() -> o.setValue(s))); Is the new functionality that you're suggesting a way to make this easier and more natural? (In reply to Jens Lideström from comment #2) > (In reply to Lars Vogel from comment #1) > > Jens, WDYT? > > It sound like an interesting idea! > > I don't understand exactly what you're thinking. > > To have a CompletableFuture value propagated to the databinding framework I > guess you have to do something like this today: > > IObservableValue<String> o = new WritableValue<>(); > > CompletableFuture<String> f = new CompletableFuture<>(); > > f.whenComplete((s, exc) -> { > o.getRealm().asyncExec(() -> o.setValue(s))); > > Is the new functionality that you're suggesting a way to make this easier > and more natural? Thanks for the reply. Yes, I think the above coding could be easier. Maybe something like a WritableValueCompletableFuture which does the above automatically. |