use of com.intellij.facet.impl.ui.FacetErrorPanel in project intellij-community by JetBrains.
the class BuildoutConfigPanel method initErrorValidation.
private void initErrorValidation() {
FacetErrorPanel facetErrorPanel = new FacetErrorPanel();
myErrorPanel.add(facetErrorPanel.getComponent(), BorderLayout.CENTER);
facetErrorPanel.getValidatorsManager().registerValidator(new FacetEditorValidator() {
@NotNull
@Override
public ValidationResult check() {
if (!myFacetEnabled) {
return ValidationResult.OK;
}
return validateScriptName(getScriptName());
}
}, myScript);
facetErrorPanel.getValidatorsManager().validate();
}
use of com.intellij.facet.impl.ui.FacetErrorPanel in project intellij-community by JetBrains.
the class PyIntegratedToolsConfigurable method initErrorValidation.
private void initErrorValidation() {
final FacetErrorPanel facetErrorPanel = new FacetErrorPanel();
myErrorPanel.add(facetErrorPanel.getComponent(), BorderLayout.CENTER);
facetErrorPanel.getValidatorsManager().registerValidator(new FacetEditorValidator() {
@NotNull
@Override
public ValidationResult check() {
final Sdk sdk = PythonSdkType.findPythonSdk(myModule);
if (sdk != null) {
final Object selectedItem = myTestRunnerComboBox.getSelectedItem();
if (PythonTestConfigurationsModel.PY_TEST_NAME.equals(selectedItem)) {
if (!VFSTestFrameworkListener.getInstance().isPyTestInstalled(sdk)) {
return new ValidationResult(PyBundle.message("runcfg.testing.no.test.framework", "py.test"), createQuickFix(sdk, facetErrorPanel, PyNames.PY_TEST));
}
} else if (PythonTestConfigurationsModel.PYTHONS_NOSETEST_NAME.equals(selectedItem)) {
if (!VFSTestFrameworkListener.getInstance().isNoseTestInstalled(sdk)) {
return new ValidationResult(PyBundle.message("runcfg.testing.no.test.framework", "nosetest"), createQuickFix(sdk, facetErrorPanel, PyNames.NOSE_TEST));
}
}
}
return ValidationResult.OK;
}
}, myTestRunnerComboBox);
facetErrorPanel.getValidatorsManager().validate();
}
Aggregations