Bug 244503 - Make editor registration more flexible
Summary: Make editor registration more flexible
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IMP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Stan Sutton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-19 02:06 EDT by Ed Willink CLA
Modified: 2014-01-09 15:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2008-08-19 02:06:54 EDT
The UniversalEditor is currently automatically registered as an editor
for each org.eclipse.imp.runtime.languageDescription file extension.
An icon can be specified, but the editor name, editor class and the
contribution class cannot.

A separate org.eclipse.ui.editors can be specified with the UniversalEditor
or a derived UniversalEditor or a MultiPageEditorPart that uses a
UniversalEditor for some pages.

The redundant automatic registration can then be 'suppressed' by specifying
an empty string for the file extensions. This seems to be a slight abuse of 
the language registration.

[I appreciate that UniversalEditor aims to provide extension via services,
but provision of any unforeseen services will always need more flexibility.
Today I need to extend UniversalEditor to put in the PropertyPage adapter
that will unwrap the ModelTree selection to get properties to work.]

Suggest one of:

1) add the org.eclipse.ui.editors name,class,contributorClass
attributes to org.eclipse.imp.runtime.languageDescription.

2) add a registerEditor attribute with default true value
to org.eclipse.imp.runtime.languageDescription.

3) remove the auto-registration, instead requiring that all editor
registrations occur through use of an org.eclipse.ui.editors.

4) add an org.eclipse.imp.runtime.editorRegistration that when
present defines name,icon,class,contributorClass of the editor
and inhibits and similar behaviour from the languageDescription.

[Observation: Is it really helpful to have 15 or so extensions?
Wouldn't it be more sensible for the language registration to 
have many nested capabilities?]
Comment 1 Ed Willink CLA 2008-08-19 11:49:25 EDT
3) is the only 'Eclipse' option.

Modifying the File Associations appears to be unsupported by the IEditorRegistry interface, though perhaps you could create a synthetic plugin
and exploit the IExitorExtension interface.

Use of the internal EditorRegistry API is very undesirable. 
Comment 2 Ed Willink CLA 2008-08-21 10:41:23 EDT
Minor correction:

A separate org.eclipse.ui.editors cannot be fully specified while
org.eclipse.imp.editor.internal.TextEditorActionContributor
is internal. (Unfortunately bug 244819 PDE doesn't diagnose
use of internal).

Please make TextEditorActionContributor non-internal.
Comment 3 Ed Willink CLA 2008-10-25 08:31:50 EDT
Bug #242967 patch 2 provides a poor comprise to suggestion 3.