Multi-instances of a ViewPart - Part 2
As discussed in a previous post I created an application with a View allowing multi instances.
An other problem I encountered with multi instances views is about Views persistence between several launches.
When the workbench is closed Eclipse automatically remember each opened view’s position. This way the next time I’ll start my workbench these opened views will be automatically displayed.
In my case this behavior is not the good one since view’s content is not persistent across launches. For example if the user leaves its workbench with 6 opened instances of my view he ‘ll get 6 empty views at next launch …
To solve this problem I just added an IWorkbenchListener closing all the opened instances of my view when the workbench is closing down. Closing a view is done by the IWorkbenchPage.hideView() method.
May 21, 2008 at 12:51 pm
That is taken care of in 3.4 with https://bugs.eclipse.org/215797
May 21, 2008 at 1:24 pm
Hi Markus,
Thanks for your answer and your contribution to this ;o)
Manu
PS: It’s the second time I search for a workaround to a problem fixed in 3.4 ;o)
May 21, 2008 at 4:29 pm
why are they empty? Can’t you restore them from the secondary-id?
May 21, 2008 at 7:16 pm
Hi Tom,
No I can’t, the view content is relative to other work in the current launch.
Manu