How to listen to lose focus event of a part in Eclipse E4 RCP?

ぃ、小莉子 提交于 2019-12-11 23:13:41

问题


I have multiple views in a perspective, these are shown as tabs. I want to catch the event when I switch from one Part to another (by clicking on the other parts tab). In other words I want to catch the event when a part looses focus. How can I do that in E4?

I have tried IPartListener implementation but its methods are called twice and also too late. For example, if I have parts A and B and part A is in focus, when I click on tab for part B, the @Focus method of part B is called first and then part deactivated (or part hidden) method of IPartListener is called for part A. I do not want that. Also, I have noticed that the partActivated and partDeactivated methods are called twice (for each part), which is also not desireable.

Any help would be greatly appreciated.

Thanks, Jehan

来源:https://stackoverflow.com/questions/33342823/how-to-listen-to-lose-focus-event-of-a-part-in-eclipse-e4-rcp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!