computered computered - 9 months ago 39
Java Question

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:


1) Are there listeners that are fired when properties view became visible or invisible, gain ou lost focus?

2) What code I use to know if properties view is closed?

3) What code I use to know if the properties view is opened but not visible? Like this image:

Figure 1

Figure 1

4) How can I know if it is visible and have focus? Like image:

Figure 2

Figure 2

5) And if it is visible and DONT have focus, like:

Figure 3

Figure 3


Use IPartListener2 to listen for all part events.

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


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.