Bug 24684

Summary: [Editor Mgmt] 'Open With' of Eclipse 2.0.1 sets wrong default editor
Product: [Eclipse Project] Platform Reporter: Tomoki Shiratori <shiratori.tomo>
Component: UIAssignee: Eduardo Pereira <eduardo_pereira>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: grduck, philippe_mulet, richkulp
Version: 2.0.1   
Target Milestone: 2.0.2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Tomoki Shiratori CLA 2002-10-11 03:12:20 EDT
1. Select any .java file in Package Explorer and press the right button of the 
mouse.
2. Select 'Open With' -> 'Text Editor' in the popup menu. Then the file opens 
with Text Editor and Text Editor becomes the default editor of the file.
3. Therefore, after closing the file, double-clicking the same file in Package 
Explorer opens it with Text Editor.
4. After closing the file, do the same operation again. That is, select the 
same .java file in Package Explorer, press the right button of the mouse and 
select 'Open With' -> 'Text Editor' in the popup menu.
5. Then the file opens with Text Editor. However, the default editor of the 
file changes to Java Editor.
6. Therefore, after closing the file, double-clicking the same file in Package 
Explorer opens it with Java Editor, not Text Editor.

After the above operation, the default editor should remain Text Editor.

This happens only on Eclipse 2.0.1. Eclipse 2.0 does not have the problem.
(I used eclipse-SDK-2.0-win32.zip and eclipse-SDK-2.0.1-win32.zip to check the 
behavior.)
Comment 1 Sonia Dimitrov CLA 2002-10-11 10:54:44 EDT
This may be a duplicate of 21486.
Comment 2 Sonia Dimitrov CLA 2002-10-11 11:00:41 EDT
*** Bug 24692 has been marked as a duplicate of this bug. ***
Comment 3 Sonia Dimitrov CLA 2002-10-18 09:26:04 EDT
*** Bug 25034 has been marked as a duplicate of this bug. ***
Comment 4 Nick Edgar CLA 2002-10-18 15:09:29 EDT
Should fix this for 2.0.2 (and also in the 2.1 stream).

Comment 5 Eduardo Pereira CLA 2002-10-21 15:35:00 EDT
Fix released to the HEAD stream.
Must be released to the 2.0.2 stream.
Comment 6 Eduardo Pereira CLA 2002-10-22 10:13:59 EDT
Released in the 202 stream.
Comment 7 Tomoki Shiratori CLA 2002-10-22 21:43:11 EDT
Thank you for your quick response.
Could you tell me which files were modified for this fix?
I'd like to try to apply the fix into 2.0.1, too.
Comment 8 Eduardo Pereira CLA 2002-10-23 09:17:50 EDT
One line in EditorManager.java. Instead of calling getDefaultEditor(file) we 
call getDefaultEditor(file.getName()).
Comment 9 Sonia Dimitrov CLA 2002-11-07 17:22:50 EST
*** Bug 25844 has been marked as a duplicate of this bug. ***