private void generateReports()

in codeexplorer/src/main/java/nl/obren/sokrates/codeexplorer/configuration/CodeConfigurationView.java [191:225]


    private void generateReports(String reportType) {
        completeAndSave();

        File absoluteSrcRoot = new File(CodeConfiguration.getAbsoluteSrcRoot(getConfigurationFromEditor().getSrcRoot(), file));
        File reportsFolder = CodeConfigurationUtils.getDefaultSokratesReportsFolder(absoluteSrcRoot);
        ProgressFeedback progressFeedback = codeBrowserPane.getConsole().getProgressFeedback();
        progressFeedback.start();
        CommandLineInterface commandLineInterface = new CommandLineInterface();
        commandLineInterface.setProgressFeedback(progressFeedback);
        Executors.newCachedThreadPool().execute(() -> {
            try {
                String reportTypeOption = "-" + reportType;
                String configFileOption = "-" + CommandLineInterface.CONF_FILE;
                String outputFolderOption = "-" + CommandLineInterface.OUTPUT_FOLDER;
                String commandLine = "java -jar sokrates.jar "
                        + CommandLineInterface.GENERATE_REPORTS + " "
                        + reportTypeOption + " "
                        + configFileOption + " '" + file.getPath() + "' "
                        + outputFolderOption + " '" + reportsFolder.getPath() + "'";
                progressFeedback.setText("Command line: <span style='background-color: #e5ffe5;'>" + commandLine + "</span>");
                progressFeedback.setText("");
                commandLineInterface.run(new String[]{CommandLineInterface.GENERATE_REPORTS,
                        reportTypeOption,
                        configFileOption, file.getPath(),
                        outputFolderOption, reportsFolder.getPath()});
            } catch (IOException e) {
                LOG.warn(e);
            } catch (Throwable e) {
                LOG.warn(e);
            } finally {
                progressFeedback.setText("Done.");
                progressFeedback.end();
            }
        });
    }