/* ----------------------------------------
 * Origin  : GFI INFORMATIQUE 
 * Project : CDPP Propagation Tool 
 * ----------------------------------------
 * History 
 * Version : 01/05/2015 : SCA : V2.1
 * ----------------------------------------
 */
package fr.tlse.irap.pt.client.component;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javafx.fxml.FXMLLoader;

public class CustomComponent {

	public static final Logger log = LoggerFactory.getLogger(CustomComponent.class);

	public static void initCustomComponent(ICustomComponent customComponent) {
		String fxmlComponent = customComponent.getClass().getSimpleName() + ".fxml";
		FXMLLoader fxmlLoader = new FXMLLoader(customComponent.getClass().getResource(fxmlComponent));
		fxmlLoader.setRoot(customComponent);
		fxmlLoader.setController(customComponent);
		try {
			fxmlLoader.load();
			//log.debug(fxmlComponent + " is loaded");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
