MultiPageEditor within MultiPageEditor for eclipse 4.2

16 views
Skip to first unread message

Rohan Kapur

unread,
Jan 7, 2013, 1:00:38 AM1/7/13
to eclipse-...@googlegroups.com
Hi,

I was using eclipse 3.5.2 and had created a MultiPageEditor. In a MultiPageEditor we can add another Editor as a page. This editor could be another MultiPageEditor. Now I have migrated to eclipse 4.2.0. Now when I open my MultiPageEditor I get a ClassCastException. On going through the source code I found the below piece of code in the constructor of MultiPageEditorSite which is called from the org.eclipse.ui.part.MultiPageEditorPart.addPage(IEditorPart editor, IEditorInput input)
method used to add the editor as a page. 
PartSite site = (PartSite) multiPageEditor.getSite();

Since the editor that I am adding as a page in the MultiPageEditor the getSite returns an object which is an instance of the MultiPageEditorPart which is not of the type PartSite hence the exception is thrown.

Could someone please help me as to what could be used to open a MultiPageEditor as a page in another MultiPageEditor.

Thanks in anticipation of your help

Reply all
Reply to author
Forward
0 new messages