roskenet / springboot-javafx-support

SpringBoot / JavaFX8 Integration
MIT License
422 stars 139 forks source link

showView methods from AbstractJavaFxApplicationSupport should return more information #74

Open Blackdread opened 6 years ago

Blackdread commented 6 years ago

Both methods should return at least the AbstractFxmlView, but could useful to return an interface that would allow to get:

When using

public static void showView(final Class<? extends AbstractFxmlView> window, final Modality mode) {
}

or

public static void showView(final Class<? extends AbstractFxmlView> newView) {
}

Mainly useful for the first one.

It would allow to call getPresenter() on the returned View bean (newly instantiated or previous managed bean).

The use case is when a AbstractFxmlView and Controller are annotated with @ Scope("prototype"). With a modality mode passed, it is not possible to get the Controller and set some field in order to finish the initialization.

octaviospain commented 6 years ago

Some changes related to this were implemented in #58, the showView methods now belongs to classes that extends from AbstractFxmlView. Check the code changed and upgrade to version 2.1.6

You can inject your @FXMLView annotated class as any other, and call getPresenter() and others methods/