How to have the file selected in Project Explorer when focusing on a certain file's tab?
There is an icon which looks like two horizontal arrows:
If you select this toggle button (so it is depressed as shown, it has the tooltip 'Link to Editor') then changing tabs should now refocus the selected item in the explorer.
You can also find a 'Link to Editor' checkbox on the Project Explorer menu.
Many other views have similar icons which perform a similar function, for instance the Navigator or Package Explorer, or Git Staging and Repositories views.
You can find more information in the Workbench User Guide on the Linking the Project Explorer view to the active editor page.
1. From the Project Explorer menu, select Link With Editor.
2. Click on the Link With Editor icon Link with editor icon on one of the navigation bars.
Click on the link below for the image
Ref : http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-18.htm