package depart.frontal.vues;

import ca.ntro.app.Ntro;
import ca.ntro.app.frontend.ViewFx;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.StackPane;

public class VueRacine extends ViewFx {

	@FXML
	private StackPane stackPaneA;

	@FXML
	private ComboBox<String> comboBoxA;

	@Override
	public void initialize() {
		Ntro.assertNotNull(stackPaneA);
		Ntro.assertNotNull(comboBoxA);
		
		comboBoxA.getItems().add("fr");
		comboBoxA.getItems().add("en");
		
		comboBoxA.getSelectionModel().select(Ntro.currentLocale().language());
		
		comboBoxA.setOnAction(evtFx -> {

			Ntro.changeLocale(Ntro.buildLocale(comboBoxA.getSelectionModel().getSelectedItem()));

		});

	}

	public void methodeA(ViewFx paramA) {
		stackPaneA.getChildren().clear();
		stackPaneA.getChildren().add(paramA.rootNode());
	}
}
