Tag: hover

Eclipse – 将鼠标hover在标记上时的自定义文本

我正在研究Eclipse插件,目前我正在尝试让Eclipse(Luna)在hover在标记上时显示自定义文本。 我知道我可以通过指定标记参数来实现这一点,但我需要动态更改文本 ,例如: 我已经尝试过这些方法但没有成功: 1)使用自定义SourceViewerConfiguration自定义TextEditor : public class MyEditor extends TextEditor { public MyEditor() { setSourceViewerConfiguration(new SourceViewerConfiguration() { @Override public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return new IAnnotationHover() { @Override public String getHoverInfo(ISourceViewer sv, int ln) { return “Hello world!”; } }; } }); } } 和plugin.xml这样: 我的方法getHoverInfo永远不会被调用。 相反, 只要我打开任何* .c文件并将鼠标hover在标记上,就会调用DefaultAnnotationHover中的方法getHoverInfo 。 我通过Eclipse-> Preferences-> General-> Editors检查了可用的编辑器, […]