我无法得到Andrew在Eclipse 3.7中的工作答案.编译器给出了这个错误:
The method getSourceViewer() from the type AbstractTextEditor is not visible.
但是,我能够使用该selectAndReveal()方法:
IFile myfile = ...
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ITextEditor editor = (ITextEditor) IDE.openEditor(page, myfile);
editor.selectAndReveal(offset, length);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2885 次 |
| 最近记录: |