|Possible to contribute an "editor factory" for specific resources? [message #507319]
||Tue, 12 January 2010 22:04
| Eric Rizzo
Registered: July 2009
I'm familiar with the org.eclipse.ui.editors extension point for |
registering a custom editor to open with a specific file type (or
types). What I need to do is a more complex decision about the type of
editor to open based on the contents of the selected IFile. In other
words, depending on the actual file contents I need to open an
appropriate custom EditorPart (actually, custom FormEditor classes); I
have several such custom editors, each appropriate for different files
based on their contents.
I don't think I can just specify a class attribute for the
org.eclipse.ui.editors extension point, since that EditorPart seems to
be instantiated before I have a chance to get involved in the decision.
Specifying an IEditorLauncher (via the "launcher" extension point
attribute) looks somewhat promising, although the docs for it indicate
it is intended for external editors. Would there be any problems in
using an IEditorLauncher for my purposes (to open an internal editor)?
Would that be a horrible abuse of the launcher attribute?
Are there any other solutions for deciding which editor class to open
based on file contents?
Thanks in advance,
Powered by FUDForum
. Page generated in 0.11360 seconds