Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Eclipse's Package Explorer to display like IntelliJ IDEA's package view?

In IntelliJ IDEA, the "Project" pane on the left has "View as:", with the following options:

  • Project
  • Packages
  • Scope
  • Favorites

If you select "Project" it shows something like Eclipse's "Package Explorer", however if you choose "Packages" and you followed following convention:

  • src
    • main
      • java
      • org
        • ...
      • resources
    • test
      • java
      • org
        • ...
      • resources

it displays a view that merges the "main" and "test" folders, thus showing you the unit tests next to their associate classes (the classes they test). This is quite handy IMO, is there a way to do this in Eclipse (3.7.2)?

Thanks!

like image 868
Gabriel Avatar asked Jun 05 '12 15:06

Gabriel


People also ask

How do I show package explorer in IntelliJ?

You can open it by pressing ⌘+1 on macOS or Alt+1 on Windows and Linux, or by selecting View | Tool Windows | Project from the main menu. The window visualizes the structure of your project and shows you all its components including modules, directories, packages, classes, libraries, SDKs, and so on.

How do I change project structure view in IntelliJ?

To change settings of a module that hosts the file you are currently editing, just press Alt+F1, 7 or open the View menu, select Select In and click Project Structure. IntelliJ IDEA will open the Project Structure dialog and jump to the required module.

How do I show package explorer?

To view the project explorer, click on Window menu then, click on Show View and select Project Explorer. There is simpler way to open project explorer, when you are in the editor press alt + shift + w and select project explorer.

How do I display a package in Eclipse?

Upon running Eclipse you should see a pane labeled 'Package Explorer', probably on the left. If you do not see one, you can open it up by going to the Window menu, selecting Show View and Package Explorer. If it doesn't show up under Show View, select Other, then 'Java', then 'Package Explorer'.


1 Answers

This is the way to do it:

Triangle icon -> Package Presentation -> Hierarchial

Note that IntelliJ and AndroidStudio use Gradle style folders, that is src/main... and eclipse doesn't yet support Gradle and uses the older style.

Eclipse screenshot

like image 155
Squeazer Avatar answered Oct 16 '22 16:10

Squeazer