package ru.teamrocket.csrSysteamDesktop.Controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.layout.BorderPane;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

public class RootController implements Initializable {

    @FXML
    private BorderPane borderPane;

    //TODO-Alexander: Снять ID borderPane с главного элемента.
    public void initialize(URL location, ResourceBundle resources) {
        System.out.println("location = [" + location + "], resources = [" + resources + "]");
    }

    @FXML
    private void handlerOnAddUser(ActionEvent event){
        setScene("/AddUser.fxml");
    }

    @FXML
    private void handlerOnAddOffer(ActionEvent event){
        setScene("/AddOffer.fxml");
    }

    private void setScene(String nameResurce){
        try {
            Parent parent = FXMLLoader.load(getClass().getResource(nameResurce));
            borderPane.setCenter(parent);
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}

@@ -485,16 +485,67 @@
 %D0%B5%D0%BC%D0%B5%D0%BD%D1%82%D0%B0.%0A
+    //TODO-Alexander: %D0%94%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C Default BorderPane;%0A
     publ

add todo