use of org.apache.netbeans.modules.python4nb.editor.options.PythonOptionsValidator in project python4nb by ebresie.
the class PythonOptionsPanelController method isValid.
@Override
public boolean isValid() {
assert EventQueue.isDispatchThread();
PythonOptionsPanel panel = getPanel();
ValidationResult result = new PythonOptionsValidator().validatePython(panel.getPython(), panel.getPythonSources()).validatePip(panel.getPip()).getResult();
// errors
if (result.hasErrors()) {
panel.setError(result.getFirstErrorMessage());
return false;
}
// warnings
if (result.hasWarnings()) {
panel.setWarning(result.getFirstWarningMessage());
return true;
}
// everything ok
// NOI18N
panel.setError(" ");
return true;
}
Aggregations