private void rec() {
CompilerFacade compilerFacade = new CompilerFacade();
CategorizedProblem[] validate = compilerFacade.validate(
document.get(), editor.getJavaProject());
IAnnotationModel annotationModel = editor.getViewer()
.getAnnotationModel();
IAnnotationModelExtension e = (IAnnotationModelExtension) annotationModel;
e.removeAllAnnotations();
if (validate != null) {
for (CategorizedProblem p : validate) {
if (p.isError()){
int length = p.getSourceEnd() - p.getSourceStart()+1;
try{
Position pa = new Position(p.getSourceStart()-compilerFacade.length,length);
annotationModel.addAnnotation(new Annotation(
"org.eclipse.ui.workbench.texteditor.spelling",
false, p.getMessage()), pa);
}catch (Exception ea) {
}
}