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);
}
}
Aggregations