Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Including a diagram ditor in a MultiPageEditor(How can I embed an existing editor in one off the pages from a multi page editor?)
Including a diagram ditor in a MultiPageEditor [message #1194821] Mon, 18 November 2013 18:15 Go to next message
Juan Manuel Moreno Rivera is currently offline Juan Manuel Moreno RiveraFriend
Messages: 2
Registered: January 2012
Junior Member
I am not sure if this is the correct place. If not, just let me know and I will move, because I am trying to reuse a diagram editor into my plugin, a MultiPageEditor.

I assume that it is imposible to embed an editor in a section's composite, isn't it? This would be ideal for me (I want to devide one page in to editors) but after looking in the documentation I haven't found any way to do that and as far as I understand the Parts / Views / Editors phhilosohy it is not expected to be done, so it can not be done. If I am wrong, could you point me to any example?

The issue is that I created the diagam editor in a GMF-based plugin automatically generated. On the other side I have my MultiPageEditor with my RCP form pages created. In one of the pages I would like to add this editor but when using the addPage(IEditorPart, IEditorInput) method, I use my Editor class as the first parameter and a new IEditorInput implementation as the second one.

Eclipse says I can not use my Editor class in the first parameter but it extends DiagramDocumentEditor, which implements IEditorPart. So, it should be working or maybe I am meshing a lot with the deep inside parts of Eclipse. I have developed previously plugins (with GMF or my own ones) but basic ones and using wizards. THis is my first time getting so deep into the IDE architecture.

Any advice?
Re: Including a diagram ditor in a MultiPageEditor [message #1197021 is a reply to message #1194821] Tue, 19 November 2013 18:14 Go to previous message
Juan Manuel Moreno Rivera is currently offline Juan Manuel Moreno RiveraFriend
Messages: 2
Registered: January 2012
Junior Member
Well, I will answer myself.

After going through the classes hierarchy once more I have found the answer to what is quite simple afterwards. If you want to integrate the editor (diagram or treeview editors) from a plugin developed with GMF just add in the addPages() method from your MultiPageEditor and add the line:

addPage((IEditorPart)(new yourEditorDiagram()), this.editorInput);

As I mentioned the DiagramDocumentEditor class implements IEditorPart so just a casting can do the work. The editorInput is defined in the EditorPart class so it is inherited in your extension of the MultiPageEditor.

This is answer to the easy (and a bit silly, sorry for it) question. I hope answering myself can help others also lost with that. The other about embeeding an Editor in a section form ... I still go for the "no, it is imposible based on Eclipse architecture". However if anyone can confirm or ccorrect me it is welcome. It is still an interesting option I would use if possible.
Previous Topic:Cannot resolve target platform due to javax.crypto
Next Topic:Code, content and template assist inside the ant editor for custom tasks
Goto Forum:
  


Current Time: Thu Apr 25 03:41:14 GMT 2024

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

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

Back to the top