Class UIFuture

java.lang.Object
org.vaadin.firitin.components.button.UIFuture

public class UIFuture extends Object
This helper class is used to execute long-running actions and provide an easy way to run updates once the action is finished.

The helper takes care of enabling polling if push is not enabled and synchronizes the UI updates with the UI thread. If the manual push mode is used, the server push is triggered automatically after UI updates are done.

NOTE! This class is still in early development and likely to get some changes still in the future. Suggestions/contributions are more than welcome!

  • Constructor Details Link icon

    • UIFuture Link icon

      public UIFuture(com.vaadin.flow.component.UI ui)
    • UIFuture Link icon

      public UIFuture()
  • Method Details Link icon

    • isAsyncUiUpdate Link icon

      public boolean isAsyncUiUpdate()
    • setAsyncUiUpdate Link icon

      public void setAsyncUiUpdate(boolean asyncUiUpdate)
    • getExecutor Link icon

      public Executor getExecutor()
    • setExecutor Link icon

      public void setExecutor(Executor executor)
      Sets the executor that will be used to run the task. A default by JDK is used if not set.
      Parameters:
      executor -
    • of Link icon

      public <T> CompletableFuture<T> of(CompletableFuture<T> task)
      Returns a completable future whose additional actions are executed and properly synchronized in the UI thread. Note, that if you use the async methods of the completable future, you need to synchronize with the UI thread yourself.
      Type Parameters:
      T -
      Parameters:
      task -
      Returns:
    • supplyAsync Link icon

      public <T> CompletableFuture<T> supplyAsync(Supplier<T> supplier)
    • runAsync Link icon

      public CompletableFuture<Void> runAsync(Runnable runnable)