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.

Advertisements

4 thoughts on “Multi-instances of a ViewPart – Part 2

  1. 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)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s