Including a diagram ditor in a MultiPageEditor [message #1194821] |
Mon, 18 November 2013 13:15  |
Eclipse User |
|
|
|
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 13:14  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.17800 seconds