if (!(sourceViewer instanceof ITextViewerExtension2)) {
fTextOperationAction.run();
return;
}
final ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;
// does a text hover exist?
final ITextHover textHover = textViewerExtension2.getCurrentTextHover();
if (textHover == null) {
// TODO this crashes... why?
// fTextOperationAction.run();
return;
}
final Point hoverEventLocation = textViewerExtension2.getHoverEventLocation();
final int offset = computeOffsetAtLocation(sourceViewer, hoverEventLocation.x,
hoverEventLocation.y);
if (offset == -1) {
fTextOperationAction.run();
return;