如何在 Eclipse RCP 中实现内容辅助文档弹出窗口
我已经实现了自己的编辑器并为其添加了代码完成功能。 我的内容助手在源查看器配置中注册如下:
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
if (assistant == null) {
assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(getMyAssistProcessor(),
MyPartitionScanner.DESIRED_PARTITION_FOR_MY_ASSISTANCE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
}
return assistant;
}
当我在所需分区内按 Ctrl + SPACE 时,将出现完成弹出窗口并按预期工作。
这是我的问题.. 如何实现/注册出现在完成弹出窗口旁边的文档弹出窗口? (例如在java编辑器中)
I have implemented my own editor and added a code completion functionality to it. My content assistant is registered in source viewer configuration like this:
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
if (assistant == null) {
assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(getMyAssistProcessor(),
MyPartitionScanner.DESIRED_PARTITION_FOR_MY_ASSISTANCE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
}
return assistant;
}
When I press Ctrl + SPACE inside the desired partition, the completion popup appears and works as expected.
And here's my question.. How do I implement/register a documentation popup that appears next to completion popup? (For example in java editor)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,
我自己回答这个问题;-)
你必须将此行添加
到上面的配置中。 然后,在创建 CompletionProposals 时,构造函数的第八个(最后一个)名为 additionalProposalInfo 的参数是文本,它将显示在文档弹出窗口中。
有关更多信息,请参阅这里。
很简单,不是吗……如果你知道怎么做的话;)
Well,
I'll answear the question myself ;-)
You have to add this line
to the configuration above. Then when creating CompletionProposals, the eighth (last) parameter called additionalProposalInfo of the constructor is the text, which will be shown in the documentation popup.
More information about can be found here.
Easy, isn't it.. if you know how to do it ;)
对于样式信息框(就像 JDT 中一样)。
HTMLTextPresenter
。For the styled information box (just like in JDT).
HTMLTextPresenter
.