Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 13560

Summary: [Navigator] Closing editor should NOT change Navigator selection
Product: [Eclipse Project] Platform Reporter: Peter Burka <peter_burka>
Component: UIAssignee: Knut Radloff <knut_radloff>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: dean.t.roberts
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Peter Burka CLA 2002-04-11 14:17:00 EDT
Build 20020321

- switch to the Resources perspective
- open up several editors on different .java files
- collapes all of the trees in the Navigator view
- now close the last editor
- the editor will close, and the next-to-last editor will now get focus
- when it gets focus, the file that it is open on will be selected in the 
Navigator view
(The same scenario can be repeated in the Java perspective - just substitute 
the Packages view for the Navigator view.)

This behaviour is extremely annoying, as it causes me to lose my context in 
the Navigator.  I get stuck between two usability problems -- Eclipse's editor 
management requires me to manually close editors all of the time to keep from 
being overwhelmed with editors, but whenever I do close an editor, Eclipse 
changes the state of the Navigator and I have to find where I was again.

Eclipse should NOT change the state of the Navigator when I close an editor.  
If I want to find the editor's source in the Navigator, I can always click on 
the editor's tab again.

(I could swear that I've reported this bug before, but I can't find it 
anywhere.  If I have, my apologies, but this is one of my biggest peeves with 
Eclipse right now.)
Comment 1 Peter Burka CLA 2002-04-19 19:08:48 EDT
Perhaps a better solution to this problem would be to provide a way to find an 
editor's input in the navigator/packages view when the 'Link Navigation 
Selection to Active Editor' option is turned off.

I think I'd probably prefer to run with this option off, but I'd still like 
some way to (manually) select the current editor's input in the tree.
Comment 2 Nick Edgar CLA 2002-04-22 23:29:11 EDT
Views like the Navigator and Packages view already implement 
ISetSelectionTarget e.g. to select a new file when it is created.
Could have a sync action which calls this on all implementing views in the 
window, passing the active editor's input.
Comment 3 Nick Edgar CLA 2002-04-25 12:23:25 EDT
*** Bug 14617 has been marked as a duplicate of this bug. ***
Comment 4 Peter Burka CLA 2002-05-01 19:19:55 EDT
*** Bug 11211 has been marked as a duplicate of this bug. ***
Comment 5 Knut Radloff CLA 2002-09-06 11:33:19 EDT
Editor to Navigator linking works as intended. When an editor becomes active 
the navigator selection should follow if the workbench preference is enabled.

Bug 11211 mentions that the navigator selection should not change if it does 
not match the current editor input. If I follow the steps above, when I close 
the last editor the navigator still has focus and the new, reopened editor is 
not active. Thus the navigator selection does not change. The selection only 
changes when I click on an editor and then close it in which case the Navigator 
selection matched the editor input.

As an alternative to the editor/view linking we should provide a "Show in" 
mechanism. Show in all viewers that implement ISetSelectionTarget is probably 
not good enough though. There have been bug reports about unwanted reveal in 
random viewers when new resources are created. We should consider a 
generic "Show in" mechanism like Erich suggests in bug 7822.

I would like to mark this as WONTFIX. The navigator selection only links to the 
*active* editor which seems to be what Peter wants. For Dean there's hope that 
bug 7822 will get addressed in the future.