您的错是您为现有的Java编辑器创建了一个全新的编辑器,而不是一个插件。插件将通过激活
extensionpoints。你的情况,你必须使用
org.eclipse.jdt.ui.javaEditorTextHovers
更多…。
<plugin> <extension point="org.eclipse.jdt.ui.javaEditorTextHovers"> <hover activate="true" id="id.path.to_your.hoverclass"> </hover> </extension></plugin>
class参数保存您的Class that的路径
implements IJavaEditorTextHover。
public class LangHover implements IJavaEditorTextHover{ @Override public String getHoverInfo(ITextViewer textviewer, IRegion region) { if(youWantToShowAOwnHover)return "Your own hover Text goes here""; return null; // Shows the default Hover (Java Docs) }}那应该做;-)



