Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » When is IPerspectiveListener4.perspectivePreDeactivate() called?(In which cases is IPerspectiveListener4.perspectivePreDeactivate() actually called?)
When is IPerspectiveListener4.perspectivePreDeactivate() called? [message #1236858] Tue, 28 January 2014 03:40 Go to next message
Eclipse UserFriend
Hi all,

I have an RCP application with a couple of perspectives. In one of these perspectives there's a view where the user can manipulate masterdata.
I need to save a dirty state of this view in case, for instance, the user changes to another perspective without having saved her changes.

After various vain attempts to implement some veto mechanism here, I've decided to
register an IPerspectiveListener4 by overriding PerspectiveAdapter and implementing perspectivePreDeactivate() there.
The listener is registered in createPartControl() by calling

getSite().getWorkbenchWindow().addPerspectiveListener(perspectiveListener);

Surprisingly, that very method of my listener instance is never called by the platform when the perspective is active and the user changes to another perspective (using the perspective chooser in the applications tool bar)!

On the other hand, when I additionally implement perspectiveActivated() in my perspective listener, this method is called for the new perspective once the switch to the other perspective is performed; hence, registration of the listener seems to have worked.

Now I wonder in which cases IPerspectiveListener4.perspectivePreDeactivate() is actually called?
Apparently I am wrong in guessing that this happens each time a perspective change occurs?

Re: When is IPerspectiveListener4.perspectivePreDeactivate() called? [message #1244626 is a reply to message #1236858] Wed, 12 February 2014 11:29 Go to previous message
Eclipse UserFriend
When using an Eclipse 3.x I believe this is called when activating a new perspective, before the new perspective is actually activated.

When using 4.x this is never called. This is bug 408309, please vote for it!
Previous Topic:Solid tutorial for creating Eclipse RCP product
Next Topic:HTML in menu tooltip
Goto Forum:
  


Current Time: Thu Jul 10 04:31:51 EDT 2025

Powered by FUDForum. Page generated in 0.29262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top