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

org.minifx.fxmlloading.lang.OngoingNodeCreation Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
/**
 * Copyright (c) 2018 European Organisation for Nuclear Research (CERN), All Rights Reserved.
 */

package org.minifx.fxmlloading.lang;

import java.util.Objects;

import org.minifx.fxmlloading.builders.FxmlNodeBuilders;
import org.minifx.fxmlloading.factories.impl.ControllerFactory;

import javafx.scene.Node;
import javafx.scene.Parent;

public class OngoingNodeCreation {

    private final ControllerFactory controllerFactory;

    public OngoingNodeCreation(ControllerFactory controllerFactory) {
        this.controllerFactory = Objects.requireNonNull(controllerFactory, "controllerFactory must not be null");
    }

    public Parent byConventionFrom(Class controllerClass) {
        return FxmlNodeBuilders.byConventionFrom(controllerClass).controllersFrom(controllerFactory).build();
    }

    public Parent fromFxml(String classpathResource) {
        return FxmlNodeBuilders.fromFxml(classpathResource).controllersFrom(controllerFactory).build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy