How to bind a Gluon View with spring boot controller?

Viewed 101

I created a Gluon project on springboot container. The MainApplication is :

@ComponentScan(basePackages = {"toto", "toto.core"})
@SpringBootApplication
@EnableFeignClients
public class RxGluonApp extends MobileApplication {

private ConfigurableApplicationContext context;

public static void main(String[] args) {
    Application.launch(RxGluonApp.class, args);
}


@Override
public void init() {
    context = SpringApplication.run(RxGluonApp.class);
    final MainController controller = context.getBean(MainController.class);
    controller.showView();
    addViewFactory(HOME_VIEW, BasicView::new);
}

@Override
public void postInit(Scene scene) {
    Swatch.AMBER.assignTo(scene);
    ((Stage) scene.getWindow()).getIcons().add(new Image(RxGluonApp.class.getResourceAsStream("/icon.png")));
}

@Override
public void stop() {
    Platform.exit();
    context.stop();
}

}

for the moment 'GLUON' AND 'Springboot Beans' are separated

    controller.showView(); // call the controller 
    addViewFactory(HOME_VIEW, BasicView::new); // GLUON HOME VIEW

How to INJECT the controller showView() process in the AddViewFactory ??

Here is the project source link https://github.com/raidentel/reactive-client

0 Answers
Related