Eclipse RCP:从编辑器激活视图而不失去焦点
我在 SWT 中有一个树表。我想在用户开始编辑视图上的字段时显示视图。但是,我遇到的问题是,当我进入编辑器时,视图的激活会窃取编辑器的焦点,因此我无法再使用它。
在不失去焦点的情况下从树单元编辑器激活视图的正确方法是什么?
I have a Tree Table in SWT. I want to show a view when the user starts editing a field on the view. However, I have the problem that when I go into the Editor, the activation of the view steals the focus of the editor, so I can't use it anymore.
What would be the correct way to activate a view from my Tree Cell Editor, without losing Focus?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是在活动页面中使用 showView() 方法。
对于这种特殊情况,有必要使用方法bringToFront()而不是showView(),因为bringToFront()不会窃取焦点。
The problem was using the method to showView() in the Active Page.
For this particular case, it is necessary to use the method bringToFront() instead of showView(), as bringToFront() does not steal the focus.