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

org.minifx.fxmlloading.builders.OngoingFxmlNodeBuilder 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.builders;

import java.util.Arrays;

import org.minifx.fxmlloading.configuration.FxmlLoadingConfiguration;
import org.minifx.fxmlloading.factories.impl.ClassToInstanceLookupControllerFactory;
import org.minifx.fxmlloading.factories.impl.DelegatingControllerFactory;

import javafx.util.Callback;

public class OngoingFxmlNodeBuilder {
    private final FxmlLoadingConfiguration configuration;

    public OngoingFxmlNodeBuilder(FxmlLoadingConfiguration configuration) {
        this.configuration = configuration;
    }

    public NestableFxmlNodeBuilder controllersFrom(Callback, Object> controllerFactory) {
        return new NestableFxmlNodeBuilder(configuration, DelegatingControllerFactory.of(controllerFactory));
    }

    public NestableFxmlNodeBuilder controllers(Iterable controllerInstances) {
        return new NestableFxmlNodeBuilder(configuration,
                ClassToInstanceLookupControllerFactory.ofInstances(controllerInstances));
    }

    public NestableFxmlNodeBuilder controllers(Object... controllerInstances) {
        return controllers(Arrays.asList(controllerInstances));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy