X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2Fdialogrunner%2FDialogRunnerI.java;h=1fc41e7c60cec166e33f913e096b9350b364d942;hb=5bbd8870c4840d4092e69a1fb772f453dab9245d;hp=0cb90c27b37373f58802ec6e7ed3c4240cfc69d8;hpb=2afa9987e7d3276b4525abb28767617732e6e7cf;p=jalview.git
diff --git a/src/jalview/util/dialogrunner/DialogRunnerI.java b/src/jalview/util/dialogrunner/DialogRunnerI.java
index 0cb90c2..1fc41e7 100644
--- a/src/jalview/util/dialogrunner/DialogRunnerI.java
+++ b/src/jalview/util/dialogrunner/DialogRunnerI.java
@@ -20,6 +20,8 @@
*/
package jalview.util.dialogrunner;
+import java.util.concurrent.Callable;
+
/**
* An interface for blocking dialog response handling. This is motivated by
* JalviewJS - when running as Javascript, there is only a single thread, and
@@ -29,28 +31,32 @@ package jalview.util.dialogrunner;
* @author jprocter
*
*/
-public interface DialogRunnerI {
+public interface DialogRunnerI
+{
+
+ /**
+ * Sets the action to be performed when the dialog returns the given response.
+ * Note this also handles int
-valued responses, which will be
+ * converted to Integer
when this method is invoked.
+ *
+ * @param response
+ * @param action
+ * @return
+ */
+ DialogRunnerI setResponseHandler(Object response, Callable action);
- /**
- * Sets the action to be performed when the dialog returns the given response.
- * Note this also handles int
-valued responses, which will be
- * converted to Integer
when this method is invoked.
- *
- * @param response
- * @param action
- * @return
- */
- DialogRunnerI setResponseHandler(Object response, Runnable action);
+ // DialogRunnerI setResponseHandler(Object response, Runnable action);
- /**
- * Runs the registered handler (if any) for the given response. The default
- * action is to do nothing. Typically an action will be need on 'OK' or other
- * positive selection in the dialog. An action might in some cases also be
- * needed for a 'Cancel' response.
- *
- * @param response
- * @return
- */
- default void handleResponse(Object response) {
- }
+ /**
+ * Runs the registered handler (if any) for the given response. The default
+ * action is to do nothing. Typically an action will be need on 'OK' or other
+ * positive selection in the dialog. An action might in some cases also be
+ * needed for a 'Cancel' response.
+ *
+ * @param response
+ * @return
+ */
+ default void handleResponse(Object response)
+ {
+ }
}