Question

I have an Eclipse RCP application which uses Views to allow edition of an EMF Resource. The resource and EditingDomain is contained in the Page input.

We are now trying to integrate Eclipse GMF. This generates a DiagramEditor which works wonderfully, but in Eclipse 3 this cannot be used in the same stack as the other views of my application. Editors can only be put in the EditorArea.

Can anybody direct me towards a solution? I see multiple options, each of which has distinct advantages/disadvantages:

  1. Implement a conversion layer between IEditorSite and IViewSite, so I can load my Editor inside of a view. This works partially, but a lot of GMF functionality is suddenly missing. Somebody must surely have done this before; since I do not find anything, I assume instead it is impossible.
  2. Implement all views as EditorParts. Only have a single EditorArea in the application. Disadvantage: requires an internal Workbench API to layout all the parts DZone link
  3. Generate a GMF View instead of a GMF Editor. Is this even possible without losing the Palette?
Was it helpful?

Solution

I have done option #2 two years ago and depending on your layout requirements, this is by far the easiest.

Option #1 is almost impossible as there bigger parts of the IViewPart functionality that cannot be delegated to a sub-part. Just see how pervasive the multi-editor code is - you can find instanceof tests deep in the org.eclipse.ui code.

Option #3 can probably be done, but only by loosing the palette, as this seems to refer to editor stuff deep down (at least this is in my notes from 2 years ago :-))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top