Community
Participate
Working Groups
In E4 we are still using IPerspectiveListener3 and IPerspectiveListener4 for listening on perspectiveDeactivated and perspectivePreDeactivated events. But they won't be fired on switching a perspective in the perspective toolbar.
You mean in Kepler running the standard RCP Workbench? Or in an Eclipse4 application? PW
Sorry, it's not Kepler. We are using the perspective listener in a E4.2.1 RCP application.
Doesn't work on Kepler (4.3.1) either. We use this together with hiding editors which is also not yet implemented, see bug 374132
Is there any intention of fixing this and the related bug 374132 or is there just a better way to do it now. We are now at Mars and it is still not resolved.
(In reply to Alain Picard from comment #4) > Is there any intention of fixing this and the related bug 374132 or is there > just a better way to do it now. We are now at Mars and it is still not > resolved. Gerrit patches are welcome. See http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html for how to do it.
There are already any fix or a workaround? I use Eclipse 4.5.1 and when I call method perspectiveDeactivated in IPerspectiveListener4 so doesn't work it.
With Eclipse 4.4 I encountered the following behaviour: -perspectivePreDeactivated is not called -perspectiveDeactivated is called The Code where the Listener is fired is WorkbenchPage.setPerspective(). Here only perspectiveDeactivated is fired. I compared this to a Code from the 3.X stream. Here both are fired. In the old Code there is a oldPersp.onDeactivate() between both calls which does not exist in the 4.x stream anymore (or I did not find it) So the suggestion for the problem I have is to do either one of the following: - mark perspectivePreDeactivated deprecated, so during migration it is possible to find the problem. - call both Listeners. As a solution for the 4.4 version I changed the perspectivePreDeactivated implementation to perspectiveDeactivated as the second is fired and during the call the perspective ist still active (perspectives.setSelectedElement() and mperspective.getContext().activate() are not called at that time)
In 4.5 perspectiveDeactivated is not being called consistently. When a new perspective is opened then WorkbenchPage.setPerspective is used and perspectiveDeactivated is called. When switching to an already open perspective PerspectiveSwitcher is manipulating the model directly and WorkbenchPage.setPerspective is not used. The WorkbenchPage.selectionHandler listens for this change and perspectiveActivated is called but perspectiveDeactivated is never called. In our project the workaround is to track the active perspective within our listener and call perspectiveDeactivated from perspectiveActivated if perspectiveDeactivated was not called.
I am using 4.6.3 Version: Neon.3 (4.6.3) The problem can also be reproduced. The perspectiveActivated method is called, but the perspectivePreDeactivated method is never called.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
In 4.20, perspectivePreDeactivated is still not called. WorkbenchWindow still contains the method firePerspectivePreDeactivate(..), but behavior is not implemented in 4.x, so it is dead code now. By now it should be decided if this ever gets implemented, or that the interface is marked deprecated.