Editor 3.x/4.x – org.eclipse.ui.editorss

I would like to show you how to re-use the Eclipse editor area in an e4 application. Before, I had the problem that the editor disappeared after maximizing views or that Eclipse showed me messages like:


!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/application/ApplicationElement/tags/REMOVE] {ChangedElement=org.eclipse.e4.ui.model.application.ui.basic.impl.PartStackImpl@4981d95b (elementId: org.eclipse.chemclipse.ux.extension.msd.ui.partstack.main.2, tags: [active], contributorURI: platform:/plugin/org.eclipse.chemclipse.ux.extension.msd.ui) (widget: CTabFolder {}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer@7b2f8152, toBeRendered: true, onTop: false, visible: true, containerData: 10000, accessibilityPhrase: null), Widget=CTabFolder {}, AttName=tags, EventType=REMOVE, Position=1, OldValue=Maximized} to handler org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler@5f32ab17
!STACK 0
org.eclipse.e4.core.di.InjectionException: 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.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler$1.run(UIEventObjectSupplier.java:56)

So, here’s the description how to use the editor correctly:

A) Define an Area under “Shared Elements” in the Application.e4xmi:

Application.e4xmi Area

B) Insert a “Part Stack” called “org.eclipse.e4.primaryDataStack”:

Application.e4xmi Part Stack

Add the tags:

  • newtablook
  • org.eclipse.e4.primaryDataStack
  • EditorStack
  • NoAutoCollapse

Application.e4xmi Part Stack Tags

C) Import the Area in the fragment.e4xmi:

fragment.e4xmi Import

D) Reference the Area via a Placeholder called “org.eclipse.ui.editorss”:

fragment.e4xmi Placeholder

It’s important that the Placeholder gets the ID “org.eclipse.ui.editorss”. The Area must be referenced in other perspectives via the same placeholder ID “org.eclipse.ui.editorss”.

E) The 3.x editor is used when elements are opened via the “Project Explorer”:

3.x Editor

F) The 4.x editor is used when elements are opened via 4.x editor parts:

4.x Editor

That’s it!

Posted in Uncategorized | Leave a comment

RCPTT – set a file from the workspace dynamically

I’m quite amazed how powerful RCPTT is!
https://www.eclipse.org/rcptt

Recently, I’ve encountered a problem. The task was to set the path of a file into the file selection dialog, but it should be independent of the currently used test system. The first try was to set the file directly, but the path is hardcoded:


set-dialog-result File "/home/testman/rcptt/HelloWorld.txt"
get-window -class WizardDialog | get-button "Select *.txt" | click

Hence, a better way is to clear the workspace and import the needed files into the workspace before running the tests. Therefore, a context can be created within RCPTT. The workspace is resolved by “workspace:/” in RCPTT. This could be a solution, cause the workspace is created independently – different systems, different locations. Hence, we could try:


set-dialog-result File "workspace:/com.acme.rcptt/HelloWorld.txt"
get-window -class WizardDialog | get-button "Select *.txt" | click

But this won’t work. We should have a look at the ECL commands:

http://download.xored.com/q7/docs/ecl-api/latest

Instead, we can get the workspace location by using the ECL command “get-workspace-location” and concatenate it with the path to our file in the workspace:


set-dialog-result File [concat [get-workspace-location] "/com.acme.rcptt/HelloWorld.txt"]
get-window -class WizardDialog | get-button "Select *.txt" | click

Tadaaa, that’s it!

Posted in Uncategorized | 2 Comments

Eclipse Hackathon Hamburg – 2015 Q41

Last Friday we had again an Eclipse Hackathon in Hamburg! Folks do Hackathons, it’s a great experience to be a part of the Eclipse Community!
https://wiki.eclipse.org/Hackathon_Hamburg_2015_Q41

Hackathon-Q41-1

Hackathon-Q41-2

Posted in Uncategorized | Leave a comment

OpenChrom 1.0.0 “Aston” GA

I proudly announce the official release of OpenChrom 1.0.0 “Aston”.
Some new data converters and a lot of improvements have been added.

https://www.openchrom.net/download
https://en.wikipedia.org/wiki/OpenChrom

OpenChrom 1.0.0 Aston

Posted in Uncategorized | 4 Comments

Eclipse Hackathon Hamburg – 2015 Q3

Yesterday, we had our third Eclipse Hackathon (2015) in Hamburg, Germany. It was a great meeting:-).
https://wiki.eclipse.org/Hackathon_Hamburg_2015_Q3

Eclipse Hackathon Hamburg Q3 2015
* Foto (C) by Tobias Baumann

Stay tuned, the next Hackathon will be in approx. three month.
https://wiki.eclipse.org/Hackathon_Hamburg_2015_Q4

Posted in Uncategorized | Leave a comment

OpenChrom 1.0.0 “Aston” Preview

I proudly announce the preview release of OpenChrom 1.0.0 “Aston”.
Some new data converters and a lot of improvements have been added. Stay tuned.

https://www.openchrom.net/download
https://en.wikipedia.org/wiki/OpenChrom

OpenChrom 1.0.0 Preview

Posted in Uncategorized | 2 Comments

Eclipse Hackathon Hamburg – Greetings

Yesterday, we had our second Eclipse Hackathon in Hamburg, Germany. It was a great meeting:-).

Hackathon-2015-Q2

Stay tuned, the next Hackathon will be in approx. three month.

Posted in Uncategorized | 1 Comment