- /**
- * Adds a new response for this dialog, and returns the dialog (this), to allow chaining, eg.
- * <pre>
- * dialog.addResponse(newRunResponse(OK_PRessed) { run()...})
- * .addResponse(new RunResponse(CANCEL_PRESSED);
- * </pre>
- *
- * @param action
- * @return
- */
- DialogRunnerI addResponse(RunResponse action);
+ /**
+ * Sets the action to be performed when the dialog returns the given response.
+ * Note this also handles <code>int</code>-valued responses, which will be
+ * converted to <code>Integer</code> when this method is invoked.
+ *
+ * @param response
+ * @param action
+ * @return
+ */
+ DialogRunnerI setResponseHandler(Object response, Runnable action);