Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Validation Framework not returning errors
Validation Framework not returning errors [message #218456] Tue, 29 July 2008 18:24
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

I'm trying to determine whether the file open in my editor has errors in
it. It's an XML file with a DTD defined, and when I erase part of a tag
(or the whole tag, if its required), the little red box shows up on the
right, and sometimes a marker shows up on the left. However, this method
always returns false. I call it in between switching from a source page to
a form page, which I only want viewable if there are no errors in the
source.

private boolean hasErrors(){
Validator[] validators =
ValidationFramework.getDefault().getValidatorsFor(currentFil e);
for(Validator validator : validators){
ValidationResult result = validator.validate(currentFile,
IResourceDelta.CONTENT, null, null);
if(result.getSeverityError() > 0)
return true;
}
return false;
}

Any ideas?

PS: Reference from before:
http://dev.eclipse.org/newslists/news.eclipse.webtools/msg16 654.html
Previous Topic:Force Eclipse to Publish?
Next Topic:Java EE Module spontaneously deselected in Project properties
Goto Forum:
  


Current Time: Sat Sep 23 23:41:18 GMT 2017

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

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