简体   繁体   English

我自己的日食编辑器中的“属性视图”事件

[英]Events of Properties View in my own eclipse editor

I implemented a Properties View in my own editor in eclipse and I start this view using the code: 我在自己的eclipse编辑器中实现了属性视图,并使用以下代码启动了该视图:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.PropertySheet");

1) Are there listeners that are fired when properties view became visible or invisible, gain ou lost focus? 1)当属性视图变为可见或不可见时,是否有被激发的监听器会失去焦点?

2) What code I use to know if properties view is closed? 2)我用什么代码知道属性视图是否关闭?

3) What code I use to know if the properties view is opened but not visible? 3)我使用什么代码知道属性视图是否已打开但不可见? Like this image: 喜欢这张图片:

Figure 1 图1

图1

4) How can I know if it is visible and have focus? 4)如何知道它是否可见并具有焦点? Like image: 像图片:

Figure 2 图2

图2

5) And if it is visible and DONT have focus, like: 5)如果可见并且不要有焦点,例如:

Figure 3 图3

图3

Use IPartListener2 to listen for all part events. 使用IPartListener2侦听所有零件事件。

IPartService partService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService();

partService.addPartListener(listener);

You will get events for all parts so you will have to check the event is for your part. 您将获得所有零件的事件,因此必须检查该事件是否适合您的零件。 The listener gets events for all the state changes of a part (open, closed, activated, brought to top, ....) 侦听器获取零件的所有状态更改的事件(打开,关闭,激活,置于顶部等)。

There is also a very similar IPartListener but IPartListener2 should be used if possible. 还有一个非常相似的IPartListener但是如果可能的IPartListener2应该使用IPartListener2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM