Here's the code, maybe this helps:
try {
file.deleteMarkers(IMarker.PROBLEM, true, 0);
for (int j = 0; j < storage.getAnnotations().size(); j++) {
try {
com.tabuso.durban.model.Annotation annotation =
storage.getAnnotations().get(j);
IMarker marker = file.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.MESSAGE, annotation.getMessage());
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
MarkerUtilities.setCharStart(marker, annotation.getIndex());
MarkerUtilities.setCharEnd(marker, annotation.getIndex() +
annotation.getLength());
} catch (CoreException e) {
e.printStackTrace();
}
}
Daniel Megert wrote:
Martin Tauber wrote:
I'm creating a marker for a TextEditor, but the underline showing
the error is not shown. Do I need to configure that using the
viewerConfiguration and if yes, how do I do that?
If you are using/extending the existing TextEditor and you create
your marker with an existing/known marker type then this should work
out of the box.
Dani
Thanks
Martin