Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Neon: Restore editor state on startup
Neon: Restore editor state on startup [message #1744137] Thu, 22 September 2016 15:23 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 185
Registered: July 2009
Senior Member
Hi,

since I have changed from 4.5 (Mars) to 4.6 (Neon) the editors in my RCP does not get opened after restart even they where open before closing the application.

I had a look into workbench.xmi and it seams the relevant information are persisted.

  <persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;workbench>&#xD;&#xA;&lt;mruList>&#xD;&#xA;&lt;file factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; id=&quot;org.eclipse.ui.DefaultTextEditor&quot; name=&quot;x.txt&quot; tooltip=&quot;x/x.txt&quot;>&#xD;&#xA;&lt;persistable path=&quot;/x/x.txt&quot;/>&#xD;&#xA;&lt;/file>&#xD;&#xA;&lt;/mruList>&#xD;&#xA;&lt;/workbench>"/>


Does have any one an idea where to look for the trouble making code? Does any one have same experience after switching to Neon and a solution?

My RCP is using the compatibility layer as there are quite some e3 based plugins from IDE used in the RCP.

Any hints are appreciated, Martin
Re: Neon: Restore editor state on startup [message #1744167 is a reply to message #1744137] Fri, 23 September 2016 06:22 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
Have you checked if the -clearPersistedState parameter is set?
Re: Neon: Restore editor state on startup [message #1744170 is a reply to message #1744167] Fri, 23 September 2016 06:50 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 185
Registered: July 2009
Senior Member
Thanks Dirk,
the -clearPersistedState is not set.

the config.ini is:
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Fri Sep 16 11:10:54 CEST 2016
org.eclipse.update.reconcile=false
eclipse.p2.profile=profile
osgi.nl=en
osgi.framework=file\:plugins/org.eclipse.osgi_3.11.0.v20160603-1336.jar
equinox.use.ds=true
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.1.200.v20160504-1450.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=de.bahntechnik.dd.opn.rcp.product
osgi.splashPath=platform\:/base/plugins/de.bahntechnik.dd.opn.rcp
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.0.200.v20160504-1419.jar,reference\:file\:org.eclipse.osgi.nl_pt_4.5.0.v20151128060001.jar,reference\:file\:org.eclipse.osgi.nl_zh_4.5.0.v20151128060001.jar,reference\:file\:org.eclipse.osgi.nl_zh_TW_4.5.0.v20151128060001.jar
osgi.bundles.defaultStartLevel=4
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.p2.data.area=@config.dir/../p2


The layout of views /perspective is restored only the files does not get opened after restart of the RCP.

Any idea where to debug?

Martin
Re: Neon: Restore editor state on startup [message #1744171 is a reply to message #1744170] Fri, 23 September 2016 07:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
Unfortunately not. Sorry. Maybe in org.eclipse.ui.part.FileEditorInputFactory but I'm honestly not very familiar with that part of the platform.
Re: Neon: Restore editor state on startup [message #1744849 is a reply to message #1744171] Fri, 30 September 2016 17:58 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 485
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

We are hit by the same issue. All last opened editors are not restored on workbench restart.

I found the culprit to be within our fragment.e4xmi. As soon as I disable it, everything works as expected. Thus, I believe it has something to do how the editors are restored in e4 when a fragment is involved.

Do you have a custom e4 application model?

[Updated on: Fri, 30 September 2016 20:18]

Report message to a moderator

Re: Neon: Restore editor state on startup [message #1745006 is a reply to message #1744849] Tue, 04 October 2016 07:27 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 185
Registered: July 2009
Senior Member
Yes, I am using multiple fragment.e4xmi to define a perspectives, commands and so on.

I do not have a custom e4 application model as I am defining a product with application ID "org.eclipse.ui.ide.workbench".

I thought it might be connected to my own defined persepctives. But this is not the case as I used the "Resource" perspective provided by the application and the issue still persists.

Unfortunately I did not have time to debug into org.eclipse.ui.part.FileEditorInputFactory.

Do you think its because of the use of fragment.e4xmi or a specific setting?
Re: Neon: Restore editor state on startup [message #1745021 is a reply to message #1745006] Tue, 04 October 2016 09:32 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
Maybe the issue is related to the fact that perspectives need to be contributed as snippets in mixed mode (usage of the compatibility layer and E4 contributions)
Re: Neon: Restore editor state on startup [message #1745024 is a reply to message #1745021] Tue, 04 October 2016 09:37 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2525
Registered: July 2012
Senior Member
Or some sort of startup issue. Have you tried to auto start the plugin via product configuration?
Re: Neon: Restore editor state on startup [message #1745027 is a reply to message #1745006] Tue, 04 October 2016 10:16 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 485
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Martin,

I can confirm that this is related to defining/contributing a perspective via fragments to the IDE. There is something fishy with the compatibility layer and the shared editor area. I suspect (but I did not debug) that because of that the code to restore the editors is not triggered or is confused where to restore them.

As a workaround, I reverted back to defining/contributing the perspective using plugin.xml. Works like a charm.

I've opened https://bugs.eclipse.org/502963 to clarify whether extending the IDE by fragments is supported/recommended or not. A reply on Twitter indicates it's not designed for this.

-Gunnar

[Updated on: Tue, 04 October 2016 10:19]

Report message to a moderator

Previous Topic:multiple instances of an eclipse 4 application project
Next Topic:Plugin is unpacked even unpack is not set
Goto Forum:
  


Current Time: Mon Nov 20 07:47:43 GMT 2017

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

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