예제 #1
0
    protected void doOKAction() {
      lastRunStatus = doRun.isSelected();

      final CppSupportLoader loader = CppSupportLoader.getInstance(project);
      loader.setIncludeProjectSettings(includeProjectCompileParametersCheckBox.isSelected());
      String s = compileProperties.getText();
      int index = s.lastIndexOf(CompileHandler.MARKER);
      if (index != -1) s = s.substring(0, index).trim();
      loader.setAdditionalCompileParameters(s.length() > 0 ? s : null);
      lastOptions = getCompiler();

      super.doOKAction();
    }
예제 #2
0
    protected CompileCppDialog(
        Project _project, CompileHandler compilerHandler, CompileCppOptions options) {
      super(_project, false);

      project = _project;
      setModal(true);

      doRun.addItemListener(
          new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
              final boolean b = doRun.isSelected();
              executableFileName.setEnabled(b);
              executableFileName.setEditable(b);
            }
          });

      executableFileName.getEditor().setItem(options != null ? options.getOutputFileName() : "");
      doRun.setSelected(lastRunStatus);

      final CppSupportLoader loader = CppSupportLoader.getInstance(project);
      final String compileParameters = loader.getAdditionalCompileParameters();

      compileProperties.setText(
          (compileParameters != null && compileParameters.length() > 0
                  ? compileParameters + " "
                  : "")
              + CompileHandler.MARKER);

      setTitle(CppBundle.message("compile.cpp.file.dialog.title"));

      compilerSelector.setModel(
          new DefaultComboBoxModel(CppSupportSettings.CompilerSelectOptions.values()));
      compilerSelector.setSelectedItem(getCurrentCompilerOption(project));

      setSelectedProjectCompile();

      includeProjectCompileParametersCheckBox.addItemListener(
          new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
              setSelectedProjectCompile();
            }
          });

      includeProjectCompileParametersCheckBox.setSelected(loader.isIncludeProjectSettings());
      final String compileParametersText = compilerHandler.buildProjectCompileOptions(project);
      projectCompileParameters.setText(compileParametersText != null ? compileParametersText : "");

      init();
    }
예제 #3
0
 static CppSupportSettings.CompilerSelectOptions getCurrentCompilerOption(Project project) {
   return lastOptions != null
       ? lastOptions
       : CppSupportLoader.getInstance(project).getCompilerOptions();
 }