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

3

9

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!

Iggie answered 5/6, 2012 at 15:49 Comment(2)
Here's an old eclipse bug reprt with screenshots attached: bugs.eclipse.org/bugs/show_bug.cgi?id=173773Stricklin
I would love to have a feature like this in eclipse.Vitrescence
B
5

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

Bogy answered 27/11, 2014 at 13:19 Comment(2)
Sorry for the delay :-). Thanks for the answer but this is not really what I meant. IDEA merges the main and test view, so you end up with the test classes next to the classes they test (only visually of course).Iggie
No worries man, sorry for my late response, fell asleep. Didn't even know that that was an option in IDEA, good to know!Bogy
T
0

Screenshots would help for those of us completely unfamiliar with IntelliJ. Have you tried the Java Browsing Perspective and its Projects and Packages Views?

Translocate answered 6/6, 2012 at 17:41 Comment(0)
S
0

You can use the Web perspective to see project structure as same as with intellijenter image description here

Salicin answered 9/7 at 6:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.