mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Rename viewfx.view.support.guice.{Guice=>Injector}ViewFactory
This commit is contained in:
parent
e887be742d
commit
39ee637eda
3 changed files with 6 additions and 14 deletions
|
@ -41,7 +41,7 @@ import java.nio.file.Paths;
|
|||
import viewfx.view.View;
|
||||
import viewfx.view.ViewLoader;
|
||||
import viewfx.view.support.CachingViewLoader;
|
||||
import viewfx.view.support.guice.GuiceViewFactory;
|
||||
import viewfx.view.support.guice.InjectorViewFactory;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
|
@ -67,7 +67,7 @@ public class BitsquareApp extends Application {
|
|||
public void start(Stage primaryStage) throws IOException {
|
||||
bitsquareAppModule = new BitsquareAppModule(env, primaryStage);
|
||||
injector = Guice.createInjector(bitsquareAppModule);
|
||||
injector.getInstance(GuiceViewFactory.class).setInjector(injector);
|
||||
injector.getInstance(InjectorViewFactory.class).setInjector(injector);
|
||||
|
||||
|
||||
// route uncaught exceptions to a user-facing dialog
|
||||
|
|
|
@ -39,7 +39,7 @@ import viewfx.view.ViewFactory;
|
|||
import viewfx.view.ViewLoader;
|
||||
import viewfx.view.support.CachingViewLoader;
|
||||
import viewfx.view.support.fxml.FxmlViewLoader;
|
||||
import viewfx.view.support.guice.GuiceViewFactory;
|
||||
import viewfx.view.support.guice.InjectorViewFactory;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
@ -56,8 +56,8 @@ public class GuiModule extends BitsquareModule {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(GuiceViewFactory.class).in(Singleton.class);
|
||||
bind(ViewFactory.class).to(GuiceViewFactory.class);
|
||||
bind(InjectorViewFactory.class).in(Singleton.class);
|
||||
bind(ViewFactory.class).to(InjectorViewFactory.class);
|
||||
|
||||
bind(ResourceBundle.class).toInstance(BSResources.getResourceBundle());
|
||||
bind(ViewLoader.class).to(FxmlViewLoader.class).asEagerSingleton();
|
||||
|
|
|
@ -23,15 +23,7 @@ import com.google.inject.Injector;
|
|||
|
||||
import viewfx.view.ViewFactory;
|
||||
|
||||
/**
|
||||
* A JavaFX controller factory for constructing viewfx Views using Guice. To
|
||||
* install this in the {@link javafx.fxml.FXMLLoader}, pass it as a parameter to
|
||||
* {@link javafx.fxml.FXMLLoader#setControllerFactory(javafx.util.Callback)}.
|
||||
* <p>
|
||||
* Once set, make sure you do <b>not</b> use the static methods on
|
||||
* {@link javafx.fxml.FXMLLoader} when creating your JavaFX node.
|
||||
*/
|
||||
public class GuiceViewFactory implements ViewFactory {
|
||||
public class InjectorViewFactory implements ViewFactory {
|
||||
|
||||
private Injector injector;
|
||||
|
Loading…
Add table
Reference in a new issue