/** * Return true if the enabled validators have not changed since this ValidationConfiguration was * constructed, false otherwise. (This method is needed for the Properties and Preference pages; * if the list of validators hasn't changed, then there is no need to update the task list; * updating the task list is a costly operation.) */ protected boolean hasEnabledValidatorsChanged(ValidatorMetaData[] oldEnabledVmd) throws InvocationTargetException { // First check the obvious: is every enabled validator still enabled, and is // the number of enabled validators the same as it was before? If not, return true. if (oldEnabledVmd == null) { // Something's gone wrong... return true; } for (int i = 0; i < oldEnabledVmd.length; i++) { ValidatorMetaData vmd = oldEnabledVmd[i]; if (!isEnabled(vmd)) { return true; } } // Everything that was enabled is still enabled; have any additional // validators been enabled? if (numberOfEnabledValidators() != oldEnabledVmd.length) { return true; } return false; }
/** * Return true if the validator is enabled on this preference. */ public boolean isEnabled(String validatorClassName) throws InvocationTargetException { if (validatorClassName == null) { return false; } ValidatorMetaData vmd = ValidationRegistryReader.getReader().getValidatorMetaData(validatorClassName); return isEnabled(vmd); }
/** * @see org.eclipse.wst.validation.internal.operations.internal.preference.ValidationConfiguration#isEnabled(ValidatorMetaData) */ public boolean isEnabled(ValidatorMetaData vmd) throws InvocationTargetException { if (useGlobalPreference()) { return ConfigurationManager.getManager().getGlobalConfiguration().isEnabled(vmd); } return super.isEnabled(vmd); }