Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Proposal: TaskProgressDialog & ServiceDialog
Proposal: TaskProgressDialog & ServiceDialog [message #1696139] Fri, 22 May 2015 10:27
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hello

I am currently working on some multi purpose dialog classes. If there is an interessest in for these features I would contribute them to efxclipse. Please give me feedback on the following proposal:

1. TaskProgressDialog

I am thinking about a dialog based on javafx.scene.control.Dialog that displays the progress of a task in a progress bar as well as the title and messages. The dialog will optionally provide a cancel button. The result of the task will be returned as the result of the dialog.

Usage could look like this:

TaskProgressDialog<Boolean> dialog = new TaskProgressDialog<Boolean>(stage, task);
dialog.setCancelable(cancelable);
dialog.setFailedHandler(exception -> {
    exception.printStackTrace();
    new Alert(AlertType.ERROR, exception.getMessage(), ButtonType.OK).showAndWait();
    return false;
});
Optional<Boolean> result = dialog.showAndWait();


My approach to the api is that the TaskProgressDialog takes care of starting and canceling the task and also provides API to set handlers in case of failure and cancel.

2. ServiceDialog

The TaskProgressDialog is used as a "one shot" thing, where the task either completes or not: the dialog is useless afterwards. The ServiceDialog on the other hand uses a Service to process its input which can be started multiple times.

I see this class as a base for editing dialogs or wizards. I. e. if you have a dialog to create a new entity and save it to the database, the dialog will display input fields for the entities properties in its content area. The Service will attempt so save the entity. On failure, the dialog should still be open, so that the user has a chance to correct his input and try again.

The ServiceDialog also uses a progress bar to display the progress of the service, when its running and will optionally show a cancel button.

The ServiceDialog will typically be subclassed to combine the input area to the service that performs whatever calculation is necessary based on the input.

Question on available dialogs

org.eclipse.fx.ui.controls.dialog.Alert - Is this similar to the JavaFX Alert which was introduced in 8u40? Or does this have a differnet use case?

org.eclipse.fx.ui.controls.dialog.Dialog - Similar question here ... either this is a relict from before 8u40 and should be refactored to use javafx.scene.control.Dialog, or it should be renamed to something that gives a hint on its purpose?

org.eclipse.fx.ui.dialogs.Dialog - Same question as above

TitleAreaDialog - There are two of those, one in org.eclipse.fx.ui.controls.dialog and one in org.eclipse.fx.ui.dialogs. Is there a need for a new dialog with a title area, as the JavaFX Dialog already provides this feature?

Should we clean this up? Rename them? Mark some classes as deprecated? Port them to javafx.scene.control.Dialog?

Conclusion

I will open bug reports for the details but any input on the broad perspective of dialogs in efxclipse is welcome.

[Updated on: Fri, 22 May 2015 10:29]

Report message to a moderator

Previous Topic:FilteredList problem
Next Topic:Internal compiler error with EObjectAdapterProvider
Goto Forum:
  


Current Time: Thu Apr 25 11:08:02 GMT 2024

Powered by FUDForum. Page generated in 0.03200 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top