Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Turn off validation...
Turn off validation... [message #229203] Wed, 18 March 2009 15:56 Go to next message
bouge is currently offline bougeFriend
Messages: 13
Registered: July 2009
Junior Member
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 15:21 Go to previous message
bouge is currently offline bougeFriend
Messages: 13
Registered: July 2009
Junior Member
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);
Previous Topic:Java EE Module Dependencies not saved
Next Topic:Re: Ident, not Format, in XML files
Goto Forum:
  


Current Time: Mon Dec 11 15:24:35 GMT 2017

Powered by FUDForum. Page generated in 0.01876 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software