Search in sources :

Example 1 with FxController

use of eu.ggnet.saft.api.ui.FxController in project dwoss by gg-net.

the class BuilderUtil method produceFxml.

static UiParameter produceFxml(UiParameter in) {
    try {
        // Cast is a shortcut.
        Class<FxController> controllerClazz = (Class<FxController>) in.getRootClass();
        FXMLLoader loader = new FXMLLoader(Objects.requireNonNull(loadView(controllerClazz), "No View for " + controllerClazz));
        loader.load();
        Objects.requireNonNull(loader.getController(), "No controller based on " + controllerClazz + ". Controller set in Fxml ?");
        return in.withPane(loader.getRoot()).withController(loader.getController());
    } catch (IOException ex) {
        throw new CompletionException(ex);
    }
}
Also used : FxController(eu.ggnet.saft.api.ui.FxController) IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader)

Aggregations

FxController (eu.ggnet.saft.api.ui.FxController)1 IOException (java.io.IOException)1 FXMLLoader (javafx.fxml.FXMLLoader)1