mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-03 10:46:54 +01:00
29 lines
675 B
Java
29 lines
675 B
Java
|
package io.bitsquare.di;
|
||
|
|
||
|
import com.google.inject.Injector;
|
||
|
import javafx.fxml.FXMLLoader;
|
||
|
|
||
|
/**
|
||
|
* Guice support for fxml controllers
|
||
|
*/
|
||
|
public class GuiceFXMLLoader extends FXMLLoader
|
||
|
{
|
||
|
|
||
|
private static Injector injector = null;
|
||
|
|
||
|
public GuiceFXMLLoader()
|
||
|
{
|
||
|
if (GuiceFXMLLoader.injector != null)
|
||
|
setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector));
|
||
|
}
|
||
|
|
||
|
public GuiceFXMLLoader(Injector injector)
|
||
|
{
|
||
|
if (GuiceFXMLLoader.injector == null)
|
||
|
{
|
||
|
GuiceFXMLLoader.injector = injector;
|
||
|
setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector));
|
||
|
}
|
||
|
}
|
||
|
}
|