如何更改 ContentProposalAdapter 的外观
我正在使用 ContentProposalAdapter 自动完成文本框,它工作正常,但我想更改其外观,例如弹出窗口的字体或背景颜色等,我搜索了但找不到任何 ContentProposalAdapter 的方法来执行这些操作。如何更改 ContentProposalAdapter 的外观?
I'm using a ContentProposalAdapter to auto completion of a textbox, it work's OK, but I want change its appearance like font or background color of popup, and more, I searched but I can't find any ContentProposalAdapter's method for doing these stuff. how can i change the appearance of a ContentProposalAdapter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对这个 jface 部分没有任何经验,但是当您检查文档时,您可以找到方法
openProposalPopup
(参见文档)此类提供一些可重写的方法允许客户端手动控制弹出窗口。但是,大多数实现仍然是私有的。
打开提案弹出窗口并显示提案提供者提供的提案。该方法立即返回。也就是说,它不会等待提案被选择。子类使用此方法显式调用弹出窗口的打开。如果没有要显示的提案,则不会打开弹出窗口,并且会发出蜂鸣声。
如果您检查此方法的代码,您会发现
该代码创建了
ContentProposalPopup
实例,该实例管理弹出窗口小部件的外观和其他一些东西(查看源代码整个 ContentProposalAdapeter 类)。因此,如果您创建新类来重写
openProposalPopup()
并使用您自己的ContentProposalPopup
,您可以根据需要管理外观。I don't have any experiences with this jface part, but when you check the documentation, you can find method
openProposalPopup
(see docs)This class provides some overridable methods to allow clients to manually control the popup. However, most of the implementation remains private.
Open the proposal popup and display the proposals provided by the proposal provider. This method returns immediately. That is, it does not wait for a proposal to be selected. This method is used by subclasses to explicitly invoke the opening of the popup. If there are no proposals to show, the popup will not open and a beep will be sounded.
If you check code of this method, you'll find
The code creates
ContentProposalPopup
instance, which manage the appearance of popup widget and few other things (see source code of whole ContentProposalAdapeter class).So if you'll create new class which will override
openProposalPopup()
and will use your ownContentProposalPopup
, you could manage the appearance as you want..我们也遇到了
ContentProposalAdapter
的问题,最终复制粘贴它,然后根据我们的需要进行修改。We had issues with the
ContentProposalAdapter
, too, and ended up copy-pasting it, then modified according to our needs.