How to create nested default editor for MultiPageEditorPart? [message #333884] |
Mon, 12 January 2009 16:42 |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eclipse2008.shedid.de
We would like to create an multi page editor where one editor page is
showing a nested editor. Since we do not know the content type at design
time, we'd like to let Eclipse determine the editor to be shown.
This works well with getEditorRegistry().getDefaultEditor(<fileName>)
and we're able to open the editor standalone by calling openEditor() on
the active workbench page.
But to get the editor to be nested within our own multipage editor we
need to call addPage(IEditorPart editor, IEditorInput input) and thus
need an IEditorPart instance as parameter.
The interesting part is now how to get from the IEditorDescriptor return
by getDefaultEditor() to an IEditorPart without opening the editor part.
Unfortunately, the actual implementation EditorDescriptor is internal,
the implementation of public IEditorPart createEditor() is exacly what
we'd need.
Our code should the basically look something like this:
IEditorDescriptor desc =
PlatformUI.getWorkbench().getEditorRegistry().getDefaultEdit or(filename);
IEditorPart editor = <thisIsTheMissingPart>(desc);
ourMultiPageEditor.addPage(editor, editorInput);
Please let me know if you have any ideas on this...
Thanks,
Dirk
|
|
|
Powered by
FUDForum. Page generated in 0.05637 seconds