Krumelur的秘诀给了我一个很好的起点。
documentEvent返回的s
IdocumentListener足够细,可以通过对发生的情况进行字符分析来给我一个字符。
IEditorPart editor = ...; IEditorInput input = editor.getEditorInput(); Idocument document=(((ITextEditor)editor).getdocumentProvider()).getdocument();document.adddocumentListener(new IdocumentListener() { @Override public void documentChanged(documentEvent event) { System.out.println("Change happened: " + event.toString()); } @Override public void documentaboutToBeChanged(documentEvent event) { System.out.println("I predict that the following change will occur: "+event.toString()); } };});就我应该扩展的内容而言,我扩展
org.eclipse.ui.startup并添加了一系列侦听器,直到获得类似于上面的代码为止。
我希望这对正在寻找我的人有所帮助。



