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(); }
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(); }
boolean doRun() { return doRun.isSelected(); }
String getProjectCompilerOptions() { return includeProjectCompileParametersCheckBox.isSelected() ? projectCompileParameters.getText() : ""; }
private void setSelectedProjectCompile() { boolean b = includeProjectCompileParametersCheckBox.isSelected(); projectCompileParameters.setEditable(b); projectCompileParameters.setEnabled(b); }