Manually manage the EditorPart life cycle to insert it into the ViewPart

I have an Eclipse RCP application that uses views to enable the release of an EMF resource. Resource and EditingDomain are contained in the input page.

Now we are trying to integrate Eclipse GMF. This creates a DiagramEditor that works wonderfully, but in Eclipse 3 it is not possible to use it on the same stack as the other views of my application. You can edit only in the editor.

Can someone direct me to a solution? I see several options, each of which has certain advantages / disadvantages:

  • Implement the conversion level between IEditorSite and IViewSite, so I can load my editor inside the view. This works in part, but many GMF features are suddenly missing. Someone must have done this before; since I find nothing, I assume that this is not possible.
  • Implement all views as EditorParts. Only EditorArea app in app. Disadvantage: a built-in Workbench API is required to assemble all parts of a DZone link
  • Create a GMF view instead of the GMF editor. Is this possible even without losing the palette?
+4
source share
1 answer

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

Option # 1 is almost impossible, since there are large parts of IViewPart functionality that cannot be delegated to parts. Just look at how common the multi-editor code is: you can find instanceof tests deep in the org.eclipse.ui code.

Option number 3 can probably be done, but only by losing the palette, since this seems to relate to the editorial material in depth (at least this is in my notes from 2 years ago :-))

+2
source

All Articles