Your mistake is that you created a completely new editor instead of the plug-in for your existing Java editor. Plugins will be activated using extension points . In your case, you should use org.eclipse.jdt.ui.javaEditorTextHovers more ....
<plugin> <extension point="org.eclipse.jdt.ui.javaEditorTextHovers"> <hover activate="true" class="path.to_your.hoverclass" id="id.path.to_your.hoverclass"> </hover> </extension> </plugin>
The class argument contains the path to your class, which 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) } }
That should do it; -)
source share