package de.prob2.ui;


import java.io.IOException;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import de.prob2.ui.internal.UIState;
import javafx.fxml.FXMLLoader;
import javafx.scene.layout.BorderPane;

@Singleton
public class MainController extends BorderPane {
	
	private FXMLLoader loader;
		
	
	@Inject
	public MainController(FXMLLoader loader, UIState uiState) {
		this.loader = loader;
		refresh(uiState);
	}
	
	public void refresh(UIState uiState) {
		String guiState = "main.fxml";
		if(!"detached".equals(uiState.getGuiState())) {
			guiState = uiState.getGuiState();
		}
		loader.setLocation(getClass().getResource(guiState));
		loader.setController(this);
		loader.setRoot(this);
		try {
			loader.load();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	
	
}

@@ -15,17 +15,16 @@
 b2.ui;%0A%0A
-%0A
 import j
@@ -151,16 +151,17 @@
 IState;%0A
+%0A
 import j
@@ -223,16 +223,74 @@
 rPane;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 @Singlet
@@ -341,16 +341,101 @@
 rPane %7B%0A
+%09private static final Logger LOGGER = LoggerFactory.getLogger(MainController.class);%0A
 %09%0A%09priva
@@ -460,11 +460,8 @@
 er;%0A
-%09%09%0A
 %09%0A%09@
@@ -905,73 +905,52 @@
 on e
-1
 ) %7B%0A%09%09%09
-// TODO Auto-generated catch block%0A%09%09%09e1.printStackTrace(
+LOGGER.error(%22loading FXML failed%22, e
 );%0A%09
@@ -959,12 +959,6 @@
 %0A%09%7D%0A
-%09%0A%09%0A%09%0A
 %7D%0A

Fix MainController FXML exception handler