Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4 perspective with e3 editor area (org.eclipse.ui.editorss)(ClassCastException when restoring minimized parts)
e4 perspective with e3 editor area (org.eclipse.ui.editorss) [message #1732825] Fri, 20 May 2016 06:35 Go to next message
Felix Hirsch is currently offline Felix HirschFriend
Messages: 5
Registered: May 2016
Location: Aachen, Germany
Junior Member
Hi,

I am working on a hybrid e3/e4 (4.6M7) application. Most of my perspectives are e3 perspectives but one perspective has been migrated as an e4 perspective provided by a model fragment.

In this e4 perspective I want to show the e3 editor area (org.eclipse.ui.editorss) with its main part stack (org.eclipse.e4.primaryDataStack).

To accomplish this I extended the "sharedElements" of the "IDEWindow" via a seperate model fragment to provide an area with the ID "org.eclipse.ui.editorss" and in this area I added a part stack child with the ID "org.eclipse.e4.primaryDataStack". In my e4 perspective the area is integreated via a MPlaceholder to the imported shared area element.

This way works fine. All compatibility e3 editors are merged together with the e4 parts I provide in the new e4 perspective. Thus the same area and the same part stack is used for all perspectives.

But then something strange happens: I maximize a part and afterwards I try to restore/unzoom the layout (both via double click on the part label).

In all e3 perspectives the behaviour is as expected: The part gets maximized and afterwards the layout is restored. But in the e4 perspective I get the following ClassCastException:

...
Caused by: java.lang.ClassCastException: org.eclipse.e4.ui.model.application.ui.advanced.impl.AreaImpl cannot be cast to org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder
	at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.getElementsToRestore(MinMaxAddon.java:908)
	at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.unzoom(MinMaxAddon.java:852)
	at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.subscribeTopicTagsChanged(MinMaxAddon.java:369)
	at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)
	... 54 more


Has anyone an idea why the exception only occurs in the e4 perspective? In my e4 perspective the area is integreated via a MPlaceholder. Why does the find method solve the placeholder reference in the e4 perspective and not in the e3 perspective.

Thanks a lot!
Felix

[Updated on: Mon, 23 May 2016 06:12]

Report message to a moderator

Re: e4 perspective with e3 editor area (org.eclipse.ui.editorss) [message #1732970 is a reply to message #1732825] Mon, 23 May 2016 13:29 Go to previous messageGo to next message
Alexander Bunkowski is currently offline Alexander BunkowskiFriend
Messages: 23
Registered: February 2014
Junior Member
Hey Felix,

i think you should read this: https://openchrom.wordpress.com/2016/05/19/editor-3-x4-x-org-eclipse-ui-editorss/

Not 100% sure but it sounds related.
Re: e4 perspective with e3 editor area (org.eclipse.ui.editorss) [message #1733085 is a reply to message #1732970] Tue, 24 May 2016 09:47 Go to previous message
Felix Hirsch is currently offline Felix HirschFriend
Messages: 5
Registered: May 2016
Location: Aachen, Germany
Junior Member
Hi,

thanks. The description in the blog entry did it.

Actually I had to differ in one step. The area in the shared elements needs also to have the id "org.eclipse.ui.editorss" and not "org.eclipse.ui.editor.area".

Then the placeholder has both its own id and the reference id set to "org.eclipse.ui.editorss".

I do not know why this must be done that way, but if I would keep it the way descibed in the blog then two different editor areas apear in my model and the e3 and e4 parts would not be merged together.

Thanks again for the fast and helpful hint!!

Felix
Previous Topic:How to pass boolean attributes within java filter to doFilter
Next Topic:Visibility of new editor part
Goto Forum:
  


Current Time: Sun Nov 19 20:04:43 GMT 2017

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

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