ITextEditor textEditor = (ITextEditor) editorPart;
IDocumentProvider documentProvider = textEditor.getDocumentProvider();
IDocument document = documentProvider.getDocument(textEditor.getEditorInput());
// it's deprecated but the sse does not provide a
// FindReplaceDocumentAdapter
int offset = document.search(0, string, true, true, false);
if (offset >= 0) {
textEditor.selectAndReveal(offset, string.length());
}
// if (document instanceof IAdaptable) {
// IAdaptable adaptable = (IAdaptable) document;