Turn off validation... [message #229203] |
Wed, 18 March 2009 11:56  |
Eclipse User |
|
|
|
Hi,
We create a webtools project that provides template content that causes
about 2000 warnings. We've successfully turned off validation in the past
using a variety of methods that break with new eclipse releases. We've
just discovered that the ProjectPreferences.setOverride and setSuspend
methods no longer exist. What would be better than turning off validation
on our projects would be if we could add some exclude rules on folders or
file patterns. Is there a way to exclude files from validators
programmatically? If not, what is the latest recommended way to turn off
validation?
public void disableValidation()
{
ProjectPreferences prefs =
ValManager.getDefault().getProjectPreferences(project);
prefs.setOverride(true);
prefs.setSuspend(true);
}
Thanks in advance!
bouge
|
|
|
Re: Turn off validation... [message #229414 is a reply to message #229203] |
Mon, 23 March 2009 11:21  |
Eclipse User |
|
|
|
Hi All,
Wanted to follow up with this thread. The api's did change in 3.4.2, and
I've posted the below snippet on how to turn off validators in 3.4.2.
This code does not work in 3.4.1.
/*Method for disabling validators on Eclipse 3.4.2 */
Validator[] vals =
ValManager.getDefault().getValidatorsConfiguredForProject(
project, UseProjectPreferences.MustNotUse);
ValidatorMutable[] validators = new ValidatorMutable[vals.length];
for (int i = 0; i < vals.length; i++)
{
validators[i] = new ValidatorMutable(vals[i]);
}
ProjectPreferences prefs = new ProjectPreferences(project, true, true,
vals);
ValPrefManagerProject vpm = new ValPrefManagerProject(project);
vpm.savePreferences(prefs, validators);
|
|
|
Powered by
FUDForum. Page generated in 0.14875 seconds