Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 16892 - [Editor Mgmt] org.eclipse.ui.editors default option is not sufficient
Summary: [Editor Mgmt] org.eclipse.ui.editors default option is not sufficient
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-22 12:18 EDT by Gili Mendel CLA
Modified: 2002-09-04 11:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gili Mendel CLA 2002-05-22 12:18:16 EDT
The org.eclipse.ui.editors extension point provides the following option:

default            CDATA (true|false) "false"


The intent is to allow an editor to become a default editor for a particular 
resource type.   This option does not provide any meaningful control for a 
plugin to specify  its loading rule.

The way it is implemented today, plugins extensions are loaded (typically in the 
alphabetic order, as they are stored on a disk), and if an extension is marked 
as default, it is moved to the head of the queue.  Hence the last loaded 
extension will win the default war.   This also provides a problem if no 
extension specifies the "default" option.   There is no way for an extension to 
ask NOT to be the default editor.

For example:

   We developed the Java Visual Editor (AWT/Swing GUI editor) for a .java 
resource.   We do NOT want to come up as the default .java editor.  However, 
because our plugin's name starts with the com.*, it precedes the org.* plugins 
with the JDT Java editor.   Given that the Java editor is not marked as the 
"default" editor, the Visual Editor has no means to stop itself from being the 
"default default" editor. This outcome induces a significant usability issue for 
most users that do not use the JVE.

If the Java editor would have marked itself as the default editor, given that 
the org.* is the last extension to be loaded, it will (currently) be on top, 
even if others wanted to override it.
Comment 1 Nick Edgar CLA 2002-05-26 14:09:51 EDT
JDT should consider making the Java editor the default.

Eduardo, please also summarize the product customization support.
Comment 2 Erich Gamma CLA 2002-05-26 14:40:48 EDT
tagged the Java editor as the default editor
Comment 3 Eduardo Pereira CLA 2002-05-28 14:02:54 EDT
Copied comment from bug 13603. See also bug 15428.

1) A product can specify the default editors for each extension or file name by 
setting "org.eclipse.ui/defaultEditors" in the file plugin_customization.ini. 

e.g., org.eclipse.ui/defaultEditors= 
*.ext1:editorId1;*.ext2:editorId2;fileName:editorId3

So the product can resolve the conflicts if none or more then two editors are 
set as default.

2) Once a file is opened using another editor, it will allways use that editors.
E.g.
    a) Double click in a .txt file will open the DefaultTextEditor. (close it)
    b) Open it with Notepad (close it)
    c) Double click on it and notepad will open instead of DefaultTextEditor.
Comment 4 Gili Mendel CLA 2002-05-29 06:13:46 EDT
Are you suggesting that one would have to append:

org.eclipse.ui/defaultEditors=*.java:org.eclipse.jdt.ui.javaeditor

to the plugin_customization.ini file in the org.eclipse.platform_2.0.0 plugin ?

It will require a plugin to provide specialized packaging code, a significant 
impediment for a small plugin.

For the .java case, I would think that the Java editor should be the default 
editor by default, no interventions.
Comment 5 Gili Mendel CLA 2002-05-29 08:36:32 EDT
Not that if plugins are packaged on top of a product, they will have to 
parse/update this configuration file... a potential problem.
Comment 6 Nick Edgar CLA 2002-05-29 09:27:57 EDT
See note in bug 15428.
Comment 7 Eduardo Pereira CLA 2002-09-04 11:26:20 EDT
- The ini file should be used by products not by plugins.
- The major problem was fixed by setting the java editor as default.

Please reopen this report is you think this is still a problem for you.