From 1cd6bfccfcc7d22be99f9b568de6161859ec3e99 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Mon, 5 Dec 2016 01:15:52 +0000 Subject: [PATCH] Re-added injection singleton properties. --- src/main/java/musicplayer/SwingUIModule.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/musicplayer/SwingUIModule.java b/src/main/java/musicplayer/SwingUIModule.java index 68d3fbb..5ee6d50 100644 --- a/src/main/java/musicplayer/SwingUIModule.java +++ b/src/main/java/musicplayer/SwingUIModule.java @@ -22,14 +22,14 @@ class SwingUIModule extends AbstractModule { @Override protected void configure() { bind(IDatabase.class).to(HibernateDatabase.class).in(Singleton.class); - bind(IPlaylist.class).to(TabbedJTablePlaylist.class); - bind(ILibrary.class).to(JTreeLibrary.class); - bind(PlayerCallbackInterface.class).to(PlayerGUI.class); + bind(IPlaylist.class).to(TabbedJTablePlaylist.class).in(Singleton.class); + bind(ILibrary.class).to(JTreeLibrary.class).in(Singleton.class); + bind(PlayerCallbackInterface.class).to(PlayerGUI.class).in(Singleton.class); String engineName = ConfigManager.getPlayerEngine(); boolean engineSet = false; for(Engine engine : Engine.values()){ if(engineName.equals(engine.getEngineName()) && engine.isAvailable()){ - bind(IPlayer.class).to(engine.getEngineImplementation()); + bind(IPlayer.class).to(engine.getEngineImplementation()).in(Singleton.class); ConfigManager.setPlayerEngine(engine.getEngineName()); engineSet = true; } @@ -37,7 +37,7 @@ class SwingUIModule extends AbstractModule { if(!engineSet){ // If the user has set an invalid engine, try and set a usable one. for(Engine engine : Engine.values()){ if(engine.isAvailable()){ - bind(IPlayer.class).to(engine.getEngineImplementation()); + bind(IPlayer.class).to(engine.getEngineImplementation()).in(Singleton.class); ConfigManager.setPlayerEngine(engine.getEngineName()); break; }