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/, 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(
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.eSet(
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(
at org.eclipse.emf.ecore.impl.BasicEObjectImpl$3.set(
at org.eclipse.e4.ui.model.internal.ModelUtils.mergeList(
at org.eclipse.e4.ui.model.internal.ModelUtils.merge(
at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.mergeIdList(
at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.merge(
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModelFragment(
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragment(
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragments(
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragments(
at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModel(
at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
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(
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

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)?
Previous Topic:e4 Compatibility Mode > MinMaxAddon
Next Topic:E4 persistence state load issues
Goto Forum:

Current Time: Fri Aug 14 17:17:25 GMT 2020

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

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

Back to the top