あなたの欠点は、既存のJavaエディターのプラグインではなく、完全に新しいエディターを作成したことです。プラグインはを介してアクティブ化されextension points
ます。あなたの場合、org.eclipse.jdt.ui.javaEditorTextHovers
もっと使う必要があります。
<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>
class引数は、クラスへのパスを保持します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)
}
}
それはそれをするべきです;-)