score:440

Accepted answer

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.

score:2

above project explorer window you will see the below image in the red circle , just clicked on this one mean when clicked any file in the project will showing you in project explorer.

enter image description here

if you want to show only one file you can

1 - click right on the file .

2 - select show-in .

3 - select show in project explorer .

4 - done.

the below image explain more about it .

enter image description here

score:7

in your eclipse .java file editor, right-click anywhere, then "show in-> package explorer".

as shown:

image

as you can see, you can also open file in navigator, outline and so on with this.

score:15

there is a double arrow icon at the top of the package explorer that toggles this behaviour. click on it

enter image description here

score:37

from this site:

how to use show in functionality from the popup menu

press alt+shift+w while you’re in an editor. this pops up a menu with a number of choices. the choices will vary depending on what plugins you have installed. select the option you want and press enter.

the fastest way to select an option is to use the first letter of the option, eg. to go to the package explorer, press p (you may have to do this 2 or 3 times depending on how many other options start with p). the press enter. you could also use the arrow keys.

enter image description here

invoke "show in" faster with a keyboard shortcut

if you frequently use one of the options (eg. package explorer), you can map a single keyboard shortcut to invoke it.

  • go to windows > preferences > general > keys.
  • search for show in. eclipse will list a number of show in options. in our case we want show in (show in target id: package explorer).
  • select the command you want, enter a key in binding and you’re done.

always link active source file with package explorer

if you like this feature, you can open the package editor and click on the double yellow arrows to always show the currently selected source file in the package explorer.

score:53

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).


Related Query

More Query from same tag