Ejemplo n.º 1
0
  private void saveEditorPaneConfig() {
    List<String> editorPanePaths = new ArrayList<>();

    for (Tab tab : tabPane.getTabs()) {
      EditorPane pane = (EditorPane) tab.getContent();

      if (pane != null && pane.getSourceFile() != null) {
        String editorPanePath = pane.getSourceFile().getAbsolutePath();
        editorPanePaths.add(editorPanePath);
      }
    }

    config.setLastEditorPaneList(editorPanePaths);
    config.saveConfig();
  }
Ejemplo n.º 2
0
  private void runSandbox(File fileToRun) {
    try {
      Platform.runLater(
          new Runnable() {
            @Override
            public void run() {
              taLog.setText(S_EMPTY);
            }
          });

      String language = comboBoxVMLanguage.getValue();

      if (language != null) {
        List<File> compileList = new ArrayList<>();

        for (Tab tab : tabPane.getTabs()) {
          EditorPane pane = (EditorPane) tab.getContent();

          File sourceFile = pane.getSourceFile();

          if (sourceFile != null) {
            if (LanguageManager.isCompilable(language, sourceFile)) {
              compileList.add(sourceFile);
            }
          }
        }

        if (compileList.size() > 0) {
          sandbox.runSandbox(language, compileList, fileToRun);
        } else {
          log("Nothing to compile?");
        }
      }
    } catch (Exception e) {
      logger.error("Sandbox failure", e);
    }
  }
Ejemplo n.º 3
0
 private void setVMLanguage(EditorPane pane) {
   if (pane != null) {
     setVMLanguageFromFile(pane.getSourceFile());
   }
 }