Commit d25757ee authored by Axel Howind's avatar Axel Howind

fix cancel button not working

parent 89065e93
......@@ -31,7 +31,25 @@ import javafx.scene.control.ButtonType;
*/
public abstract class AbstractDialogPaneBuilder<D, B extends AbstractDialogPaneBuilder<D, B, R>, R> {
/**
* Dialog(Pane) result handler.
*
* @param <R> the result type
*/
public static interface ResultHandler<R> {
/**
* Handle result.
*
* @param btn
* the button that was pressed
*
* @param result
* the dialog/pane result as returned by the result converter
*
* @return
* true, if it's ok to proceed (the current page should be left)
* false otherwise
*/
boolean handleResult(ButtonType btn, R result);
}
......
......@@ -96,9 +96,9 @@ public class WizardDialog extends Dialog<Map<String,Object>> {
boolean apply(ButtonType btn) {
R result = pane.get();
boolean ok = resultHandler.handleResult(btn, result);
this.result = ok ? result : null;
return ok;
boolean done = resultHandler.handleResult(btn, result);
this.result = done ? result : null;
return done;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment