if (page != null) {
try {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(this.uri);
IEditorPart editorPart = IDE.openEditorOnFileStore(page, fileStore);
if (this.line > 0) {
ITextEditor textEditor = null;
if (editorPart instanceof ITextEditor)
textEditor = (ITextEditor) editorPart;
else
textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
if (textEditor != null) {
IEditorInput input = editorPart.getEditorInput();
IDocumentProvider provider = textEditor.getDocumentProvider();
try {
provider.connect(input);
} catch (CoreException e) {
e.printStackTrace();
// unable to link
//DebugUIPlugin.log(e);
return;
}
IDocument document = provider.getDocument(input);
int offset = -1, lenght = -1;
try {
IRegion region= document.getLineInformation(this.line - 1);
offset = region.getOffset();
lenght = region.getLength();
} catch (BadLocationException e) {
// unable to link
//DebugUIPlugin.log(e);
e.printStackTrace();
}
provider.disconnect(input);
if (offset >= 0 && lenght >=0) {
textEditor.selectAndReveal(offset, lenght);
}
}
}
} catch (PartInitException e) {