[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Proxy for org.eclipse.ui.editors extension point?

Trey Anastasio wrote:
I'm not explicitly opening the editor, but instead it's opened by the Workbench via filename+extension configuration within the extension point.

I think what you're suggestiong is:
- Create an extension point for each version of the editor with a unique editor id
- When the file is opened, get and evaluate project property
- Based on property, explicitly open one of the editors via org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage page, IFile input, String editorId)


If so, how is the above process initiated when a user double-clicks on the assigned filename+extension?


It wouldn't be. AFAIK you would have to create your own open editor action. Why not have one editor that calls different createPartControl(*) methods depending on the info you get from an IEditorInput? Or delegates to a different "internal editor" object based on the input (same deal, different pattern).

Which editor gets opened on a double-click tends to be a fairly static deal (based on extension) or mildly dynamic (based on extension+content type). Content type is the opportunity to examine the content of a file to show multiple editors within the "Open With" menu ... but I'm sure how helpful that content type would be to you.

Later,
PW