int widgetLocation= styledText.getOffsetAtLocation(new Point(x, y));
int widgetOffset= styledText.getOffsetAtLocation(new Point(x, y)); Point p= styledText.getLocationAtOffset(widgetOffset); if (p.x > x) widgetOffset--;
		private int computeOffsetAtLocation(ITextViewer textViewer, int x, int y) {			StyledText styledText= textViewer.getTextWidget();			IDocument document= textViewer.getDocument();			if (document == null)				return -1;			try {				int widgetLocation= styledText.getOffsetAtLocation(new Point(x, y));				if (textViewer instanceof ITextViewerExtension5) {					ITextViewerExtension5 extension= (ITextViewerExtension5) textViewer;					return extension.widgetOffset2ModelOffset(widgetLocation);				} else {					IRegion visibleRegion= textViewer.getVisibleRegion();					return widgetLocation + visibleRegion.getOffset();				}			} catch (IllegalArgumentException e) {				return -1;			}		}