use of org.apache.netbeans.modules.python4nb.preferences.PythonPreferencesValidator in project python4nb by ebresie.
the class PythonCustomizerPanel method validateData.
void validateData() {
ValidationResult result = new PythonPreferencesValidator().validateCustomizer(pythonEnabled, defaultPython, python, pythonPathPanel.getPythonSources(), debugPort).getResult();
if (result.hasErrors()) {
category.setErrorMessage(result.getFirstErrorMessage());
category.setValid(false);
return;
}
if (result.hasWarnings()) {
category.setErrorMessage(result.getFirstWarningMessage());
category.setValid(true);
return;
}
category.setErrorMessage(null);
category.setValid(true);
}
use of org.apache.netbeans.modules.python4nb.preferences.PythonPreferencesValidator in project python4nb by ebresie.
the class PythonExecutable method forProjectInternal.
@CheckForNull
private static PythonExecutable forProjectInternal(@NullAllowed Project project, boolean showCustomizer) {
if (project == null) {
return getDefault(null, showCustomizer);
}
PythonPreferences preferences = PythonSupport.forProject(project).getPreferences();
if (preferences.isDefaultPython()) {
return getDefault(project, showCustomizer);
}
String node = preferences.getPython();
ValidationResult result = new PythonPreferencesValidator().validateNode(node).getResult();
if (validateResult(result) != null) {
if (showCustomizer) {
PythonCustomizerProvider.openCustomizer(project, result);
}
return null;
}
assert node != null;
return createExecutable(node, project);
}
Aggregations