|Save view with dirty state when view or perspective is changed [message #898622]
||Thu, 26 July 2012 22:10
| George R Malary
Registered: March 2012
Location: New Jersey
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?
Powered by FUDForum
. Page generated in 0.01729 seconds