Module org.autogui

Class GuiSwingTaskRunner

java.lang.Object
org.autogui.swing.GuiSwingTaskRunner

public class GuiSwingTaskRunner extends Object
a task runner for deferring a task takes long time to complete. basically, the methods of GuiRepresentation need to be executed under the thread of the task runner of GuiMappingContext.getTaskRunner(). executeContextTask(Supplier, Consumer) achieves this.
      new GuiSwingTaskRunner(context).executeContextTask(
          () -> context.getReprValue().getUpdatedValue(context, spec),
          r  -> r.executeIfPresented(v ->
                      SwingUtilities.invokeLater(() -> setSwingViewValue(v))))