Thoughts about the use cases for Dialog

Keimel, Christoph c.keimel at
Fri Sep 19 13:02:26 UTC 2014


I am playing around with the new Dialog API in 8u40. I am evaluating if the Dialog class could be the base for a custom Dialog implementation (Wizard) for use in a business application. The use cases for these dialogs usually require the calculation of the return value based on user input. This calculation may be a long running operation, in which case a progress bar should be displayed and the operation should be cancellable. If the operation is cancelled or could not be completed because of i.e. a database error, the dialog should stay open, so the user may change his input and try again.

I am unsure, on how to setup the actions of the buttons. I tried to use a result converter to start a Service which is bound to the progress bar, cancel button and so on. This doesn't work of course, because the dialog will close before the service is done with its calculation. Since I cannot overwrite the event handler for the dialog buttons, the workaround I found was to consume the ActionEvent.ACTION in the capturing phase with an event filter and bypass the result converter altogether (which smells like a hack to me ...). Am I missing something here?

Considering my difficulties above, I have the feeling that the dialogs may only be targeted for small input or information dialogs like the Alert dialog where the result value can be processed after the dialog has been closed. On the other hand, the API itself seems to have had larger constructs (i.e. Wizards) in mind, since there are things like a ButtonType.NEXT.

What are your thoughts and plans concerning the Dialog class?

Thanks for your time!

Christoph Keimel

More information about the openjfx-dev mailing list