Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Save view with dirty state when view or perspective is changed(Trying to perform an action if view is dirty when switching to another viewpart or perspective.)
Save view with dirty state when view or perspective is changed [message #898622] Thu, 26 July 2012 22:10
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
Hi,

I have 2 views, 1 with a stack layout that implement ISaveablePart2. I am trying to perform an action when the view is changed to another view, or if the perspective is changed. I believe this can be done using getSite().getPage().saveAllEditors(true). I get this to work when I change to another composite in my StackLayout in the same view. Everything works as expected.

Now I cannot handle the case when the view is changed. My view has an IPartControlListener and I try to do a saveAllEditors() on partDeactivated, which gets called when I switch views. My action save action is performed, but I get a RunTimeException "Prevented recursive attempt to activate part A while still in the middle of activating part B". I have also tried adding a PerpectiveListener to handle the perspectedChanged event, but that was not successful.

Is there an easy to just know when a viewPart is about to be hidden or deactivated, so that I can handle my save actions then, and then continue with the normal presentation workflow. I saw in PerspecticeListener there was a handle on perspectivePreDeactivate(). Could something similar exist or be added for a ViewPart?

Regards.
Previous Topic:[ANN] RAP 2.0, API changes
Next Topic:Buckminster / WAR product
Goto Forum:
  


Current Time: Mon Jan 13 01:26:35 GMT 2025

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

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

Back to the top