Search in sources :

Example 1 with Descripteme

use of model.Descripteme in project uPMT by coco35700.

the class NewInterviewDialogController method validerClick.

public void validerClick() {
    LocalDate d = dateEntretien.getValue();
    String text = "";
    try {
        File fileDir = fichierChoisi;
        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF8"));
        String line = br.readLine();
        while (line != null || !line.equals(null)) {
            text = text + line + "\n";
            line = br.readLine();
        }
        br.close();
    } catch (Exception e) {
    // System.out.println(e.getMessage());
    }
    // System.out.println(text);
    DescriptionInterview de = new DescriptionInterview(new Descripteme(text), nomEntretien.getText());
    de.setDateInterview(d);
    if (!participantEntretien.getText().replaceAll(" ", "").equals(""))
        de.setParticipant(participantEntretien.getText());
    if (!commentaireEntretien.getText().replaceAll(" ", "").equals(""))
        de.setComment(commentaireEntretien.getText());
    if (main.getProjectInCreation() != null) {
        main.getProjects().add(main.getProjectInCreation());
        main.setCurrentProject(main.getProjectInCreation());
        main.getCurrentProject().save();
        main.setProjectInCreation(null);
        main.launchMainView();
    }
    main.getCurrentProject().addEntretiens(de);
    main.setCurrentDescription(de);
    main.refreshDataTreeView();
    main.getMainViewController().addGridPaneInterview(de);
    main.getMainViewController().updateGrid();
    // in case the center was set to null because of automatic interview Creation
    if (main.getRootLayout().getCenter() == null) {
        main.launchMainView();
    }
    main.getCurrentProject().save();
    main.launchMainView();
    main.refreshDataTreeView();
    main.needToSave();
    window.close();
}
Also used : InputStreamReader(java.io.InputStreamReader) BufferedReader(java.io.BufferedReader) DescriptionInterview(model.DescriptionInterview) LocalDate(java.time.LocalDate) File(java.io.File) FileInputStream(java.io.FileInputStream) IOException(java.io.IOException) Descripteme(model.Descripteme)

Aggregations

BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 LocalDate (java.time.LocalDate)1 Descripteme (model.Descripteme)1 DescriptionInterview (model.DescriptionInterview)1