package moe.tristan.easyfxml;

import static org.springframework.context.annotation.FilterType.ASSIGNABLE_TYPE;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.PropertySource;

import javafx.application.Application;
import javafx.application.HostServices;

import moe.tristan.easyfxml.api.FxmlController;
import moe.tristan.easyfxml.api.FxmlNode;
import moe.tristan.easyfxml.model.beanmanagement.AbstractInstanceManager;
import moe.tristan.easyfxml.model.components.listview.ComponentListCell;

@ComponentScan(
    basePackages = "moe.tristan.easyfxml",
    lazyInit = true,
    includeFilters = @Filter(type = ASSIGNABLE_TYPE, classes = {
        EasyFxml.class,
        FxmlNode.class,
        FxApplication.class,
        FxUiManager.class,
        FxmlController.class,
        AbstractInstanceManager.class,
        ComponentListCell.class
    })
)
@PropertySource("classpath:easyfxml.properties")
public class EasyFxmlAutoConfiguration {

    private static final Logger LOGGER = LoggerFactory.getLogger(EasyFxmlAutoConfiguration.class);

    private final ApplicationContext context;

    @Autowired
    public EasyFxmlAutoConfiguration(ApplicationContext context) {
        this.context = context;
    }

    @PostConstruct
    public void logFoundControllers() {
        final String fxmlControllersFound = String.join("\n->\t", context.getBeanNamesForType(FxmlController.class));
        LOGGER.debug("\nFound the following FxmlControllers : \n->\t{}", fxmlControllersFound);
        LOGGER.info("EasyFXML is configured now configured with context {}", context);
    }

    @Bean
    public HostServices hostServices(final Application application) {
        return application.getHostServices();
    }

}


@@ -1907,27 +1907,16 @@
 FXML is 
-configured 
 now conf
@@ -1926,20 +1926,12 @@
 red 
-with context
+for:
  %7B%7D%22
@@ -1939,16 +1939,37 @@
  context
+.getApplicationName()
 );%0A    %7D
@@ -2105,9 +2105,8 @@
    %7D%0A%0A%7D%0A
-%0A

Fix typo