Bug 173590 - [EditorMgmt][Preferences] scenario were declaring editor as default isn't honored if another editor already existed for same extension
Summary: [EditorMgmt][Preferences] scenario were declaring editor as default isn't hon...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-09 01:14 EST by Kurtis Martin CLA
Modified: 2019-09-06 16:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurtis Martin CLA 2007-02-09 01:14:34 EST
Build ID: M20070119-1200

Steps To Reproduce:
1. create a plugin that defines an editor for a file extension put doesn't declare the editor as default.  To reproduce, the plugin doesn't need any code.  But does need an icon and plugin.xml could be: 

<plugin>

   <extension
         point="org.eclipse.ui.editors">
      <editor
            name="bbbb Editor 1"
            extensions="bbbb"
            icon="icons/sample.gif"
            contributorClass="editor1.contributor"
            class="editor1"
            id="bbbb.editor1">
      </editor>
   </extension>

</plugin>

2. Create a similar plugin that declares a different editor for the same file extension and does specify itself as default.  plugin.xml could be this:

<plugin>

   <extension
         point="org.eclipse.ui.editors">
      <editor
            name="bbbb Editor 2"
            extensions="bbbb"
            icon="icons/sample.gif"
            contributorClass="editor2.contributor"
            class="editor2"
            id="bbbb.editor2"
            default="true">
      </editor>
   </extension>

</plugin>

3. Start by only deploying the first plugin and launch eclipse on a clean workspace.

4. Now go to Windows->Preferences->General->Editors->File Associations and add, modify or remove an association which has nothing to do with the extension of our plugins defined above (i.e. has nothing to do with .bbbb).

5. Now shutdown Eclipse, deploy plugin 2 from step 2 above and restart Eclipse on the same workspace.

6. Look under the file association preferences and notice that editor 2 from plugin 2 is not the default.


More information:
If you follow the steps to reproduce, the one marked as default (editor 2) isn't being set as the default.  But if you omit step 4 then editor 2 would be set as default.  Although in step 4 we modified an association that didn't have anything to do with the .bbbb extension.

From what I can tell just because we modified one association, then the preference store for workbench saved all associations.  And since an editor is in the preferences associated with .bbbb then when a new editor is associated it wouldn't become the default.

It just seems wrong that I have two editors one not set as default and one set as default.  But the one set as default isn't being honored if the user changed an association which had no relation to the association i'm working with.

The use case is that my product is trying to become the default editor for a certain file type where another plugin has already contributed an editor.  But the other plugin doesn't mark it's editor as default and we do.  Which works unless the user has modified any associations at all.  I would expect this to work unless the user had modified the association of interest (.bbbb).  Not just any association.
Comment 1 Boris Bokowski CLA 2007-05-23 23:34:53 EDT
I don't have any time left to do this in 3.3.
Comment 2 Boris Bokowski CLA 2009-11-17 13:04:29 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:17:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.