All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rx.javafx.sources.DialogSource Maven / Gradle / Ivy

package rx.javafx.sources;

import javafx.scene.control.Dialog;
import java.util.Optional;
import rx.Observable;
import rx.schedulers.JavaFxScheduler;

public final class DialogSource {
    private DialogSource() {}

    public static  Observable fromDialogSource(final Dialog dialog) {
        return Observable.fromCallable(dialog::showAndWait)
                .subscribeOn(JavaFxScheduler.getInstance())
                .filter(Optional::isPresent)
                .map(Optional::get);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy