1 11 package org.eclipse.ant.internal.ui.editor.text; 12 13 import org.eclipse.ant.internal.ui.model.IProblem; 14 import org.eclipse.jface.text.source.Annotation; 15 16 19 public class XMLProblemAnnotation extends Annotation { 20 21 public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.error"; public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.warning"; public static final String INFO_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.info"; 25 private IProblem fProblem; 26 27 public XMLProblemAnnotation(IProblem problem) { 28 29 fProblem= problem; 30 31 if (fProblem.isError()) { 32 setType(ERROR_ANNOTATION_TYPE); 33 } else if (fProblem.isWarning()) { 34 setType(WARNING_ANNOTATION_TYPE); 35 } else { 36 setType(INFO_ANNOTATION_TYPE); 37 } 38 39 setText(fProblem.getMessage()); 40 } 41 } 42 | Popular Tags |