use of org.eclipse.wst.validation.internal.model.ProjectPreferences in project sling by apache.
the class SightlyFacetInstallDelegate method execute.
@Override
public void execute(IProject project, IProjectFacetVersion version, Object config, IProgressMonitor monitor) throws CoreException {
Logger logger = Activator.getDefault().getLogger();
Validator[] validators = ValManager.getDefault().getValidators(project);
ValidatorMutable[] mutis = new ValidatorMutable[validators.length];
for (int i = 0; i < validators.length; i++) {
mutis[i] = new ValidatorMutable(validators[i]);
}
boolean changed = false;
for (ValidatorMutable validator : mutis) {
if (HTML_VALIDATOR_ID.equals(validator.getId())) {
if (validator.isManualValidation() || validator.isBuildValidation()) {
validator.setBuildValidation(false);
validator.setManualValidation(false);
changed = true;
logger.trace("Disabled {0} for project {1}", validator, project.getName());
break;
}
}
}
ProjectPreferences projectPreferences = ValManager.getDefault().getProjectPreferences(project);
if (!projectPreferences.getOverride()) {
projectPreferences = new ProjectPreferences(project, true, projectPreferences.getSuspend(), null);
}
if (changed || !projectPreferences.getOverride()) {
ValPrefManagerProject prefManager = new ValPrefManagerProject(project);
prefManager.savePreferences(projectPreferences, mutis);
}
}
Aggregations