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.

4 Responses to “Multi-instances of a ViewPart - Part 2”

  1. Markus Alexander Kuppe Says:

    That is taken care of in 3.4 with https://bugs.eclipse.org/215797

  2. Manuel Says:

    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)

  3. Tom Schindl Says:

    why are they empty? Can’t you restore them from the secondary-id?

  4. Manuel Says:

    Hi Tom,

    No I can’t, the view content is relative to other work in the current launch.

    Manu

Leave a Reply