Problem using new transient ui element feature [message #1809155] |
Wed, 10 July 2019 09:47 |
Stefan Folkesson Messages: 1 Registered: July 2019 |
Junior Member |
|
|
Hi,
In eclipse 4.11, there is a new feature where a ui element can be marked to not be persisted (https://www.eclipse.org/eclipse/news/4.11/platform_isv.php)
part.getPersistedState().put(IWorkbench.PERSIST_STATE, "false");
When I use this feature, the view will not be persisted to the workbench.xmi file, but eclipse still persists that this view was selected in the partstack when I closed the application and when I restart, the application throws an exception and resets the perspective together with all other views which should be persisted.
Here is the tag that cannot be parsed by eclipse
<children xsi:type="basic:PartStack" xmi:id="_PYv99KL2EemRTJKPOqiKJQ" elementId="persist.partstack.sample" contributorURI="platform:/plugin/persist" containerData="5000" selectedElement="_PYv99qL2EemRTJKPOqiKJQ">
The exception mentions the ID in selectedElement
Is this a glitch in the new feature or am I missing something?
Here is the exception
Caused by: org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference '_PYv99qL2EemRTJKPOqiKJQ'. (file:/C:/Users/stefan.folkesson/runtime-persist.product/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi, 8, 219)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1197)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHandler.java:1282)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1563)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1342)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 20 more
I have attached an example project with two views. One is always open and should be persisted. The other is opened through the open command and is marked not to be persisted, see OpenHandler.java.
To reproduce the error, open the second view (leave the new view selected in the partstack), close the application, and open the application again. This gives the exception and the perspective is reset.
-
Attachment: persist.zip
(Size: 70.22KB, Downloaded 90 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02783 seconds