Validation Framework not returning errors [message #218456] |
Tue, 29 July 2008 18:24 |
Philippe Sabourin 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
|
|
|
Powered by
FUDForum. Page generated in 0.02879 seconds