What is the IntelliJ equivalent from Eclipse, show file in the package explorer view - eclipse

I am more familiar in Eclipse and need the IntelliJ equivalent. In Eclipse, I could open a java class, right click, show file in package explorer and it would highlight the file on the left. What is the IntelliJ equivalent.

You can highlight a file you have open in the editor in a number of views using the Select In...menu that can be opened using ALT-F1 when the editor window has the cursor.
The most usual ones (Project/Packages) are found under the menu opened by ALT-F1 and then right arrow.

You can also double click the circle/cross button ontop of the Project view
it will show you the current active file in the project structure

You can turn on Autoscroll from source in Project Tool Window so that the file/class to the left is scrolled to as soon as you open a file for edit.
If this option is on, IntelliJ IDEA automatically navigates from a file in the editor to the corresponding node (file, class, field, method, etc.) in the Project tool window.
Note that selecting this option makes the Scroll to Source button unavailable.

It is called "select in project view".
You'd better edit your keymap ! (alt+F1 right arrow is not very efficient...)
file > settings > keymap > select in project view : alt+E for example

You can press Alt-Home, it goes to the navigation bar.
Go to or select the package by pressing left arrow.
Press F4 now to see it in the project view.

Related

Eclipse open all files in project

How can I open all source code files in a eclipse project at once? It takes too long to open all files in large projects by expanding out the packages and clicking on all the files.
I would like to know how to do this so I can ctrl+e to classes quickly.
It is not a good way to keep open all source files in a project because a project may have hundreds of source files. There is NO direct way to open all source files in eclipse.
However you can do it in two ways:
Using open resource dialog:
Create a working set which includes your project. Refer this.
Press Ctrl+Shift+R and select the your working set(Click on the downward pointed triangle button)
Type *.java in the text box. Dialog will list all java files in your project. Press Ctrl+A to select all files. Click on open button.
Using search dialog:
Select your project in Package explorer/Navigator/Projects view.
Press Ctrl+H. Go to File search tab. Leave "Containing text:" as blank. In File name patterns text box enter *.java. In scope section choose Selected resource option. Press search button. All source files will be displayed in search view.
Change the view layout of Search view to Show as list(In search view toolbar click on the downward pointed triangle button)
Press Ctrl+A to select all results. Right click and select open option.

pydev: package explorer disappears when file is openend

Silly question, but I don't know what to do:
My view in Eclipse pydev has changed;
Don't know what I did It used to be that the Pydev package explorer would appear on the left and then whatever file I selected would appear on the right, in the editor area. Instead, Pydev now opens a blank window.
I can make the Pydev package explorer appear by selecting it from the little icon on the lower left. However, when I then click on a file, the file opens, but the explorer disappears. Very annoying.
You probably made the package explorer work as a 'fast view'. You can do the following: Ctrl+F7 until you reach it (this keybinding should allow you to pass through the opened views), then alt+- (which should open the view menu) and deselect the 'fast view'.

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?
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.
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).
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.
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.
There is a double arrow icon at the top of the Package Explorer that toggles this behaviour. click on It
In your Eclipse .java file editor, right-click anywhere, then "Show In-> Package Explorer".
As shown:
As you can see, you can also open file in Navigator, Outline and so on with this.
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.
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 .

How to open the 'Projects' panel in Netbeans

In Netbeans, to the top left of where the code is, there used to be two panels, one called 'Projects' where you could click a project name to open a tree of all the directories and files in it, and you could double click a file to edit it.
Below it is the navigation panel which shows the class names, methods, etc contained in the file you're viewing.
I accidently clicked the close button on the projects panel and can't figure out how to get it to open again, any ideas?
In Netbeans 6.8 on Windows, going to Window -> Projects brings it back for me. CTRL + 1 works as the shortcut.
Click Window > Reset Windows will give you back the old state of all windows!
just go to Window in menu bar and select Projects
Window -> Projects
In NetBeans 8.2 Go to Window->Navigator in menu bar or press Ctrl+7 and select Projects
it will open a folder as work space .

IntelliJ IDEA equivalent of Eclipse "Link with Editor"

In Eclipse you can check the "Link with Editor" option and whatever source file you are viewing in the current tab will be highlighted and have its package expanded in the Package Explorer view.
Is there something equivalent to this in IntelliJ IDEA 8.1?
At IntelliJ IDEA 12 (13, 14 and 15 from comments), it is located at the gear icon into the "Project" Tool Window, called as our mate said, Autoscroll from source
check the image
I hope this can helps someone else :)
Update (2020, eleven years later): see "Source code navigation / Locate a file in the Project tool window"
In the Project tool window, right-click the Project toolbar and, from the context menu, select Always Select Opened File.
After that IntelliJ IDEA will track the file that is currently opened in the active editor tab and locate it in the Project tool window automatically.
Original answer (2009)
That would be : Autoscroll from Source.
Navigate from a file in the Editor that gets the focus, to the corresponding node in the Project Tool Window.
Fried Hoeben comments that
you get there from the config of the project tool window.
It is not present in the general IDE settings (at least in version 12)
In version 2016.3, it's a little icon on the Project Tool Window called Scroll from Source. It's the first icon on the right see screen shot
Right click on the Project Title bar (Project view). Then select the Option "Autoscroll from Resource".
In Intellij 2019.3 community editor, it is to right-click on the Project view and check the item "Always select opened file.
Solution to IntelliJ IDEA 2022.2.4 (Community Edition)
Click on Show Options Menu and select Always Select Opened File