Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to create nested default editor for MultiPageEditorPart?
How to create nested default editor for MultiPageEditorPart? [message #333884] Mon, 12 January 2009 16:42
Eclipse UserFriend
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
Previous Topic:Contribute command menu item to "legacy" menu?
Next Topic:Is it possible to change the font for content assist?
Goto Forum:
  


Current Time: Fri Apr 19 12:27:33 GMT 2024

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

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

Back to the top