Rename viewfx.view.support.guice.{Guice=>Injector}ViewFactory

This commit is contained in:
Chris Beams 2014-11-25 21:43:47 +01:00
parent e887be742d
commit 39ee637eda
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
3 changed files with 6 additions and 14 deletions

View file

@ -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

View file

@ -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();

View file

@ -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;