Re-added injection singleton properties.
This commit is contained in:
parent
79ee3d3ff2
commit
1cd6bfccfc
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user