package moe.tristan.easyfxml.spring;

import moe.lyrebird.view.util.AbstractEasyFxml;
import moe.tristan.easyfxml.EasyFxml;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_SINGLETON;

@Configuration
@ComponentScan(basePackages = "moe.tristan.easyfxml")
public class SpringContext {

}

@@ -42,85 +42,333 @@
 ort 
-moe.lyrebird.view.util.AbstractEasyFxml;%0Aimport moe.tristan.easyfxml.EasyFxml
+javafx.fxml.FXMLLoader;%0Aimport javafx.scene.Node;%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport moe.tristan.easyfxml.model.views.ControllerManager;%0Aimport moe.tristan.easyfxml.model.views.FXMLController;%0Aimport org.springframework.beans.factory.config.ConfigurableBeanFactory;%0Aimport org.springframework.context.ApplicationContext
 ;%0Aim
@@ -538,16 +538,91 @@
 uration;
+%0Aimport org.springframework.context.annotation.Scope;%0A%0Aimport java.net.URL;
 %0A%0Aimport
@@ -704,19 +704,279 @@
 OPE_
-SINGLETON;%0A
+PROTOTYPE;%0A%0A/**%0A * %7B@link Configuration%7D class for non-autonomous %7B@link Bean%7Ds. Useful to%0A * bean-ify the JDK classes as can sometimes be needed.%0A * %3Cp%3E%0A * (e.g. : here with%7B@link FXMLLoader%7D as seen in%0A * %7B@link #fxmlLoader(ApplicationContext, ControllerManager)%7D%7D.%0A */
 %0A@Co
@@ -1041,16 +1041,23 @@
 yfxml%22)%0A
+@Slf4j%0A
 public c
@@ -1078,10 +1078,1857 @@
 text %7B%0A%0A
+    /**%0A     * The %7B@link FXMLLoader%7D object is a /SINGLE-USE/ object to load%0A     * a FXML file and deserialize it as an instance of %7B@link Node%7D.%0A     * %3Cp%3E%0A     * Because of its single-use policy on %7B@link FXMLLoader#load()%7D%0A     * (you can not follow it with a %7B@link FXMLLoader#setLocation(URL)%7D%0A     * and another load as a way to reuse it as it caches object tree in%0A     * the instance), it must stay as a%0A     * %7B@link ConfigurableBeanFactory#SCOPE_PROTOTYPE%7D - scoped bean.%0A     * %3Cp%3E%0A     * This pre-made instance will be preloaded with%0A     * %7B@link ApplicationContext#getBean(Class)%7D as the default way to%0A     * fabricate the controller classes which handle the UI's state.%0A     * The use of this is to be obtain as loose a coupling as possible%0A     * between the front and back ends of the application.%0A     * Once a stage is showed up it will be registered in the%0A     * %7B@link ControllerManager%7D so it is reachable by other classes.%0A     *%0A     * @param context           The application's context for controller instanciation%0A     * @param controllerManager The controller management service%0A     *%0A     * @return A ready-to-use %7B@link FXMLLoader%7D which auto-registers created%0A     * controllers.%0A     */%0A    @Bean%0A    @Scope(scopeName = SCOPE_PROTOTYPE)%0A    @SuppressWarnings(%22unchecked%22)%0A    public FXMLLoader fxmlLoader(final ApplicationContext context, final ControllerManager controllerManager) %7B%0A        final FXMLLoader loader = new FXMLLoader();%0A        loader.setControllerFactory(clazz -%3E %7B%0A            final Class%3CFXMLController%3E clazzCtrl = (Class%3CFXMLController%3E) clazz;%0A            final FXMLController controllerInstance = context.getBean(clazzCtrl);%0A            controllerManager.registerController(clazzCtrl, controllerInstance);%0A            return controllerInstance;%0A        %7D);%0A        return loader;%0A    %7D%0A%0A%0A
 %7D%0A

Add non-Spring project support