public IRegion getHoverRegion(ITextViewer _textViewer, int _offset) {
// TODO If this is too slow then we might return new Region(offset, 0)
Iterator annotationsIter = myAnnotationModel.getAnnotationIterator();
while (annotationsIter.hasNext()) {
Annotation annotation = (Annotation) annotationsIter.next();
Position position = myAnnotationModel.getPosition(annotation);
if (position.overlapsWith(_offset, 0)) {
String text = annotation.getText();
if (text != null && text.trim().length() > 0) {
return new Region(position.offset, position.length);
}
}
}