Navigation view and package explorer view can be linked with the editors. After this linking, views will highlight the file which is opened in the current active editor.

How to do:

Click on the menu item “Link with Editor” of the view menu of the navigator view according to the figure shown below.