Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » E4 Application Model issues(Problems restoring the workbench state)
E4 Application Model issues [message #1777752] Mon, 04 December 2017 09:07
Sassan Ashkan Far is currently offline Sassan Ashkan FarFriend
Messages: 1
Registered: November 2017
Junior Member
I'm experiencing multiple issues when it comes to the Application Model when trying to develop an Eclipse RCP application using pure E4 (Oxygen 4.7.1).


I have attached a small workspace example which demonstrates the issues, and perhaps it is just me who is doing it the "wrong" way.

I have two PartStacks defined:
- test.partstack.sample which is empty in this example, tagged with "NoAutoCollapse" and intended to take up all the space available.
- test.partstack.hiddenstack which has "To Be Rendered" unchecked on both itself and the Part inside. The idea is it should be default hidden.

This works as intended on startup of the application.

First issue: When opening a Part from the Menu/Handler it ends up in test.partstack.hiddenstack as it should. However, closing said Part will not collapse / hide the PartStack. Why is this not happening, is it something I'm missing?

Second issue: The product is launched (intended) without -clearPesistedState. Opening the PluginPart which is provided from the Plugin/Fragment and then closing the application should try to restore said Part on the next startup. This works as it should for the MainPart provided by the main Application.e4xmi. However, the following exception occurs for the PluginPart:

java.lang.IllegalArgumentException: The selected element org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl@4397ad89 (elementId: plugin.part.pluginpart, tags: null, contributorURI: platform:/plugin/plugin) (widget: null, renderer: null, toBeRendered: false, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (contributionURI: bundleclass://plugin/plugin.parts.PluginPart, object: null, context: null, variables: null, label: Plugin Part, iconURI: null, tooltip: null, dirty: false, closeable: true, description: null) must be visible in the UI presentation
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:166)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.eSet(ElementContainerImpl.java:236)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl$3.set(BasicEObjectImpl.java:1623)
at org.eclipse.e4.ui.model.internal.ModelUtils.mergeList(ModelUtils.java:190)
at org.eclipse.e4.ui.model.internal.ModelUtils.merge(ModelUtils.java:146)
at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.mergeIdList(StringModelFragmentImpl.java:322)
at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.merge(StringModelFragmentImpl.java:300)
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModelFragment(ModelAssembler.java:299)
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragment(ModelAssembler.java:190)
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragments(ModelAssembler.java:145)
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragments(ModelAssembler.java:133)
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModel(ModelAssembler.java:99)
at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:197)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:378)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:253)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:149)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)



Further issue: The application is intended to be updated using the P2 (which btw is broken in Oxygen, but not Neon) mechanism, which could possibly be changes to the Application Model. At the same time, any open Parts (Editors) should be maintained, and the application should also remember basic stuff as ratios and sizes of things (if possible).
What is really the correct way to achieve this?
I ask because stuff like IModelResourceHandler and E4XMIResource are internal or not intended to be implemented by clients.


In general, I find that you got a lot of stuff for free with the 3.X framework but that is now gone with E4. It seems a bit more complex to do stuff programmatically and follow the "flow" of the application with injections / annotations.
Has anyone really finished a shipped product with automatic updates / online updates using pure E4 (no compatibility layer)?
  • Attachment: workspace.zip
    (Size: 22.49KB, Downloaded 125 times)
Previous Topic:e4 Compatibility Mode > MinMaxAddon
Next Topic:E4 persistence state load issues
Goto Forum:
  


Current Time: Thu Apr 25 09:14:28 GMT 2024

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

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

Back to the top