How do I show an open file in eclipse Package Explorer?

When a file (.java for example) is open in Eclipse, how do I get the Package Explorer to show the file that I am working on?


Solution 1:

There is a button in the Package Explorer view that looks like two yellow arrows pointed at left and right. The tooltip is "Link with Editor". Click that.

Solution 2:

I've found that constantly syncing package explorer with editor causes package explorer view eventually to grow too long, especially with large projects. I've instead mapped a keyboard shortcut to sync package explorer with the editor. If you are using mylyn this is of course a smaller problem.

Key mappings are available at Window ⟶ Preferences ⟶ General ⟶ Keys ⟶ Show In (Show In Target Id: Package Explorer). Mine is Ctrl+Alt+, be welcome to copy.


In Luna Command name has changed a little. Instead of Show In (Show In Target Id: Package Explorer) command is now Show In (Package Explorer).