return errorMessage;
}
@NbBundle.Messages("YiiModuleCustomizerExtender.error.source.invalid=Can't find source directory. Project might be broken.")
private void validate() {
YiiCustomizerPanel panel = getPanel();
if (!(panel.isEnabledPlugin())) {
isValid = true;
errorMessage = null;
return;
}
// source directory
FileObject sourceDirectory = phpModule.getSourceDirectory();
if (sourceDirectory == null) {
// project may be broken
isValid = false;
errorMessage = Bundle.YiiModuleCustomizerExtender_error_source_invalid();
return;
}
// validate
YiiCustomizerValidator validator = new YiiCustomizerValidator()
.validateDirectory(sourceDirectory, panel.getSystemPath())
.validateDirectory(sourceDirectory, panel.getApplicationPath())
.validateDirectory(sourceDirectory, panel.getZiiPath())
.validateDirectory(sourceDirectory, panel.getExtPath())
.validateDirectory(sourceDirectory, panel.getControllersPath())
.validateDirectory(sourceDirectory, panel.getViewsPath())
.validateDirectory(sourceDirectory, panel.getThemesPath())
.validateDirectory(sourceDirectory, panel.getMessagesPath());
ValidationResult result = validator.getResult();
if (result.hasWarnings()) {
isValid = false;
errorMessage = result.getWarnings().get(0).getMessage();
return;